Compare commits

..
1 Commits
Author SHA1 Message Date
Akinwale Ariwodola c2979c8737 bumpversion 0.2.2 -> 0.2.3 2018-10-02 04:46:43 +01:00
523 changed files with 4329 additions and 145570 deletions

No files matched your search

-19
View File
@@ -34,22 +34,3 @@ Tell us what happens instead
## Screenshots
<!-- If a screenshot would help explain the bug, please include one or two here -->
## Internal Use
### Acceptance Criteria
1.
2.
3.
### Definition of Done
- [ ] Tested against acceptance criteria
- [ ] Tested against the assumptions of the user story
- [ ] The project builds without errors
- [ ] Unit tests are written and passing
- [ ] Tests on devices/browsers listed in the issue have passed
- [ ] QA performed & issues resolved
- [ ] Refactoring completed
- [ ] Any configuration or build changes documented
- [ ] Documentation updated
- [ ] Peer Code Review performed
+6 -11
View File
@@ -1,17 +1,15 @@
sudo: required
dist: xenial
dist: trusty
language: python
python:
- '3.7'
- '2.7'
install:
- deactivate
- export PATH=/usr/bin:$PATH
- export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
- sudo dpkg --add-architecture i386
- sudo add-apt-repository ppa:deadsnakes/ppa -y
- sudo apt-get -qq update
- sudo apt-get -qq install build-essential python3.7 python3.7-dev python3.7-venv python3-pip ccache git libncurses5:i386 libstdc++6:i386 libgtk2.0-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 python2.7 python2.7-dev openjdk-8-jdk unzip zlib1g-dev zlib1g:i386 m4 libc6-dev-i386
- sudo pip install --upgrade cython==0.28.1 pip setuptools
- sudo apt-get -qq install build-essential ccache git libncurses5:i386 libstdc++6:i386 libgtk2.0-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 python2.7 python2.7-dev openjdk-8-jdk unzip zlib1g-dev zlib1g:i386 m4 libc6-dev-i386
- sudo pip install --upgrade cython==0.25.2 pip setuptools
- wget -q https://nodejs.org/dist/v8.11.1/node-v8.11.1-linux-x64.tar.xz
- tar -xf node-v8.11.1-linux-x64.tar.xz
- sudo ln -s $TRAVIS_BUILD_DIR/node-v8.11.1-linux-x64/bin/node /usr/bin/node
@@ -28,14 +26,11 @@ install:
- cd ..
- mv buildozer.spec.travis buildozer.spec
- mkdir -p cd ~/.buildozer/android/platform/
- wget -q 'https://us.crystax.net/download/crystax-ndk-10.3.2-linux-x86_64.tar.xz' -P ~/.buildozer/android/
- wget -q 'https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip' -P ~/.buildozer/android/platform/
- wget -q 'https://dl.google.com/android/android-sdk_r23-linux.tgz' -P ~/.buildozer/android/platform/
- wget -q 'https://dl.google.com/android/repository/platform-27_r01.zip' -P ~/.buildozer/android/platform/
- wget -q 'https://dl.google.com/android/repository/build-tools_r26.0.1-linux.zip' -P ~/.buildozer/android/platform/
- tar -xf ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz -C ~/.buildozer/android/
- cp -f $TRAVIS_BUILD_DIR/scripts/build-target-python.sh ~/.buildozer/android/crystax-ndk-10.3.2/build/tools/build-target-python.sh
- rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
- ln -s ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21 ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
- unzip -qq ~/.buildozer/android/platform/android-ndk-r13b-linux-x86_64.zip -d ~/.buildozer/android/platform/
- tar -xf ~/.buildozer/android/platform/android-sdk_r23-linux.tgz -C ~/.buildozer/android/platform/
- mv ~/.buildozer/android/platform/android-sdk-linux ~/.buildozer/android/platform/android-sdk-23
- unzip -qq ~/.buildozer/android/platform/platform-27_r01.zip -d ~/.buildozer/android/platform/android-sdk-23/platforms
+12 -53
View File
@@ -7,24 +7,23 @@ This app has currently only been built on Ubuntu 14.04, 16.04, 17.10, and 18.04,
#### Requirements
* JDK 1.8
* Android SDK
* Crystax Android NDK
* Android NDK
* Buildozer
* Node.js
* npm
* yarn
#### apt Packages
Based on the quick-start instructions at http://buildozer.readthedocs.io/en/latest/installation.html
#### Apt Packages
Based on the quickstart instructions at http://buildozer.readthedocs.io/en/latest/installation.html
```
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install autoconf autogen build-essential curl libtool libffi-dev python python-pip python-openssl python3.7 python3.7-dev python3-pip ccache git libncurses5:i386 libstdc++6:i386 libgtk2.0-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 python2.7 python2.7-dev openjdk-8-jdk unzip zlib1g-dev zlib1g:i386 m4 libc6-dev-i386
sudo apt-get install autoconf autogen build-essential libtool python python-pip python-openssl ccache git libncurses5:i386 libstdc++6:i386 libgtk2.0-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 python2.7 python2.7-dev openjdk-8-jdk unzip zlib1g-dev zlib1g:i386 m4 libc6-dev-i386
```
Alternatively, the JDK available from http://www.oracle.com/technetwork/java/javase/downloads/index.html can be installed instead of the `openjdk-8-jdk` package.
#### Install Cython and Setuptools
#### Install Cython
```
sudo pip install --upgrade cython==0.28.1 setuptools
sudo pip install --upgrade cython==0.25.2 setuptools
```
#### Install buildozer
@@ -44,8 +43,8 @@ Assuming `lbry-android` as the current working folder:
| Setting | Description |
|:------------------- |:-----------------------------|
| title | application title |
| package.name | package name (e.g. browser) |
| package.domain | package domain (e.g. io.lbry) |
| package.name | package name (eg. browser) |
| package.domain | package domain (eg. io.lbry) |
| source.dir | the location of the application main.py |
| version | application version |
| requirements | the Python module requirements for building the application |
@@ -53,52 +52,12 @@ Assuming `lbry-android` as the current working folder:
| android.permissions | Android manifest permissions required by the application. This should be set to `INTERNET` at the very least to enable internet connectivity |
| android.api | Android API version (Should be at least 23 for Gradle build support) |
| android.sdk | Android SDK version (Should be at least 23 for Gradle build support) |
| android.ndk | Android NDK version (not required when using crystax Android NDK) |
| android.ndk_path | Android NDK path. This should be set to the crystax Android NDK path) |
| android.sdk_path | Android SDK path. This should be set to the path where the Android SDK is manually set up (if not set up in the `.buildozer` path). |
| android.ndk | Android NDK version (13b has been tested to result in a successful build) |
| android.ndk_path | Android NDK path. buildozer will automatically download this if not set |
| android.sdk_path | Android SDK path. buildozer will automatically download this if not set |
| p4a.source_dir | Path to the python-for-android repository folder. Currently set to the included `p4a` folder |
| p4a.local_recipes | Path to a folder containing python_for_android recipes to be used in the build. The included `recipes` folder includes recipes for a successful build |
#### Setup Android SDK for buildozer
Download the Android SDK, platform and build tools archives.
* Android API 23 SDK - https://dl.google.com/android/android-sdk_r23-linux.tgz
* Android API 27 platform - https://dl.google.com/android/repository/platform-27_r01.zip
* Android build tools 26.0.1 - https://dl.google.com/android/repository/build-tools_r26.0.1-linux.
Create the `.buildozer` path (and the `android` sub-path) in your home folder if it doesn't already exist.
`mkdir ~/.buildozer`
`mkdir ~/.buildozer/android`
Extract the API 23 SDK to the `~/.buildozer/android` path and rename the extracted folder.
```
tar -xf android-sdk_r23-linux.tgz ~/.buildozer/android/platform/
mv ~/.buildozer/android/platform/android-sdk-linux ~/.buildozer/android/platform/android-sdk-23
```
Extract the API 27 platform archive into the `android-sdk-23` folder and rename the extracted folder.
```
unzip platform-27_r01.zip -d ~/.buildozer/android/platform/android-sdk-23/platforms
mv ~/.buildozer/android/platform/android-sdk-23/platforms/android-8.1.0 ~/.buildozer/android/platform/android-sdk-23/platforms/android-27
```
Extract the build tools 26.0.1 build tools into the `android-sdk-23` folder and rename the extracted folder.
```
mkdir -p ~/.buildozer/android/platform/android-sdk-23/build-tools
unzip ~/.buildozer/android/platform/build-tools_r26.0.1-linux.zip -d ~/.buildozer/android/platform/android-sdk-23/build-tools
mv ~/.buildozer/android/platform/android-sdk-23/build-tools/android-8.0.0 ~/.buildozer/android/platform/android-sdk-23/build-tools/26.0.1
```
Finally, create the Android SDK license file. This prevents being prompted to accept the SDK license during the build process.
```
mkdir -p ~/.buildozer/android/platform/android-sdk-23/licenses
echo $'\nd56f5187479451eabf01fb78af6dfcb131a6481e' > ~/.buildozer/android/platform/android-sdk-23/licenses/android-sdk-license
```
#### Setup Crystax Android NDK for buildozer
* Download the Crystax Android NDK from https://us.crystax.net/download/crystax-ndk-10.3.2-linux-x86_64.tar.xz and extract. Remember to update `android.ndk_path` in your `buildozer.spec` to the path of the extracted Crystax NDK archive.
* Copy `build-target-python.sh` from the `scripts` folder in the cloned `lbry-android` repository to the `crystax-ndk-10.3.2/build/tools/` folder.
* Delete the `android-9` folder in `crystax-ndk-10.3.2/platforms`, and create a symbolic link named `android-9` to the `android-21` folder.
#### Build and Deploy
Run `npm i` in the `lbry-android/app` folder to install the necessary modules required by the React Native user interface.
@@ -110,7 +69,7 @@ To build and deploy, you can run `./deploy.sh`. This requires a connected device
If you already installed `Android SDK` and `adb`
* Run `adb reverse tcp:8081 tcp:8081`
* Then go to the `lbry-android/app` folder and run `npm start`
* Then go to the `lbry-android/app` folder and run `npm start`
Note: You need to have your device connected with USB debugging.
+1 -1
View File
@@ -12,7 +12,7 @@ The minimum supported Android version is 5.0 Lollipop. There are two ways to ins
1. Direct APK install available at [http://build.lbry.io/android/latest.apk](http://build.lbry.io/android/latest.apk). You will need to enable installation from third-party sources on your device in order to install from this source.
## Usage
The app can be launched by opening **LBRY Browser** from the device's app drawer or via the shortcut on the home screen if that was created upon installation.
The app can be launched by opening **LBRY Browser** from the device's app drawer or via the shortcut on the homescreen if that was created upon install.
## Running from Source
The app is built from source via [Buildozer](https://github.com/kivy/buildozer). After cloning the repository, copy `buildozer.spec.sample` to `buildozer.spec` and modify this file as necessary for your environment. Please see [BUILD.md](BUILD.md) for detailed build instructions.
Vendored
+4 -7
View File
@@ -43,7 +43,7 @@ Vagrant.configure("2") do |config|
dpkg --add-architecture i386
apt-get update
apt-get install -y libssl-dev
apt-get install -y python3.6 python3.6-dev python3-pip autoconf libffi-dev pkg-config libtool build-essential ccache git libncurses5:i386 libstdc++6:i386 libgtk2.0-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 python2.7 python2.7-dev openjdk-8-jdk unzip zlib1g-dev zlib1g:i386 m4 libc6-dev-i386 python-pip
apt-get install -y autoconf libffi-dev pkg-config libtool build-essential ccache git libncurses5:i386 libstdc++6:i386 libgtk2.0-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 python2.7 python2.7-dev openjdk-8-jdk unzip zlib1g-dev zlib1g:i386 m4 libc6-dev-i386 python-pip
pip install -f --upgrade setuptools pyopenssl
git clone https://github.com/lbryio/buildozer.git
cd buildozer
@@ -63,15 +63,12 @@ Vagrant.configure("2") do |config|
cp $HOME/lbry-android/buildozer.spec.vagrant $HOME/lbry-android/buildozer.spec
mkdir -p cd $HOME/.buildozer/android/platform/
wget -q 'https://us.crystax.net/download/crystax-ndk-10.3.2-linux-x86_64.tar.xz' -P $HOME/.buildozer/android/
wget -q 'https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip' -P $HOME/.buildozer/android/platform/
wget -q 'https://dl.google.com/android/android-sdk_r23-linux.tgz' -P $HOME/.buildozer/android/platform/
wget -q 'https://dl.google.com/android/repository/platform-27_r01.zip' -P $HOME/.buildozer/android/platform/
wget -q 'https://dl.google.com/android/repository/build-tools_r26.0.1-linux.zip' -P $HOME/.buildozer/android/platform/
tar -xf ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz -C $HOME/.buildozer/android/
rm $HOME/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz
ln -s $HOME/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21 $HOME/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
cp -f $HOME/lbry-android/scripts/build-target-python.sh $HOME/.buildozer/android/crystax-ndk-10.3.2/build/tools/build-target-python.sh
rm -rf $HOME/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
unzip -qq $HOME/.buildozer/android/platform/android-ndk-r13b-linux-x86_64.zip -d $HOME/.buildozer/android/platform/
rm $HOME/.buildozer/android/platform/android-ndk-r13b-linux-x86_64.zip
tar -xf $HOME/.buildozer/android/platform/android-sdk_r23-linux.tgz -C $HOME/.buildozer/android/platform/
rm $HOME/.buildozer/android/platform/android-sdk_r23-linux.tgz
mv $HOME/.buildozer/android/platform/android-sdk-linux $HOME/.buildozer/android/platform/android-sdk-23
-8
View File
@@ -1,8 +0,0 @@
{
"presets": ["react-native"],
"plugins": [
["module-resolver", {
root: ["./src"],
}],
]
}
+43 -168
View File
@@ -644,56 +644,6 @@
}
}
},
"@expo/vector-icons": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/@expo/vector-icons/-/vector-icons-8.1.0.tgz",
"integrity": "sha512-/aKa+bgp3LIcTKJWPLRYTYCL0wf/Fr4dwl4XYmNGFG092pK3McuBoDk3b8tWyZnXBnEiqnMLd6Qwr+LEX6Jc0Q==",
"requires": {
"lodash": "^4.17.4",
"react-native-vector-icons": "6.0.0"
},
"dependencies": {
"prop-types": {
"version": "15.6.2",
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.2.tgz",
"integrity": "sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ==",
"requires": {
"loose-envify": "^1.3.1",
"object-assign": "^4.1.1"
}
},
"react-native-vector-icons": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/react-native-vector-icons/-/react-native-vector-icons-6.0.0.tgz",
"integrity": "sha512-uF3oWb3TV42uXi2apVOZHw9oy9Nr5SXDVwOo1umQWo/yYCrDzXyVfq14DzezgEbJ9jfc/yghBelj0agkXmOKlg==",
"requires": {
"lodash": "^4.0.0",
"prop-types": "^15.6.2",
"yargs": "^8.0.2"
}
},
"yargs": {
"version": "8.0.2",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-8.0.2.tgz",
"integrity": "sha1-YpmpBVsc78lp/355wdkY3Osiw2A=",
"requires": {
"camelcase": "^4.1.0",
"cliui": "^3.2.0",
"decamelize": "^1.1.1",
"get-caller-file": "^1.0.1",
"os-locale": "^2.0.0",
"read-pkg-up": "^2.0.0",
"require-directory": "^2.1.1",
"require-main-filename": "^1.0.1",
"set-blocking": "^2.0.0",
"string-width": "^2.0.0",
"which-module": "^2.0.0",
"y18n": "^3.2.1",
"yargs-parser": "^7.0.0"
}
}
}
},
"absolute-path": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/absolute-path/-/absolute-path-0.0.0.tgz",
@@ -1362,19 +1312,6 @@
"babel-runtime": "^6.22.0"
}
},
"babel-plugin-module-resolver": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/babel-plugin-module-resolver/-/babel-plugin-module-resolver-3.1.1.tgz",
"integrity": "sha512-1Q77Al4ydp6nYApJ7sQ2fmgz30WuQgJZegIYuyOdbdpxenB/bSezQ3hDPsumIXGlUS4vUIv+EwFjzzXZNWtARw==",
"dev": true,
"requires": {
"find-babel-config": "^1.1.0",
"glob": "^7.1.2",
"pkg-up": "^2.0.0",
"reselect": "^3.0.1",
"resolve": "^1.4.0"
}
},
"babel-plugin-react-transform": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/babel-plugin-react-transform/-/babel-plugin-react-transform-3.0.0.tgz",
@@ -2162,11 +2099,6 @@
"resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.28.tgz",
"integrity": "sha512-OJT3rzgtsYca/5WmmEuFJDPMwROVh5SSjoEX9wIrpfbbWJ4KqRzShs8Cj6jWHaatBYAeWngBA+kmmrcHSklT1g=="
},
"bluebird": {
"version": "3.5.3",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.3.tgz",
"integrity": "sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw=="
},
"bplist-creator": {
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.0.7.tgz",
@@ -2509,9 +2441,9 @@
}
},
"create-react-context": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/create-react-context/-/create-react-context-0.2.2.tgz",
"integrity": "sha512-KkpaLARMhsTsgp0d2NA/R94F/eDLbhXERdIq3LvX2biCAXcDvHYoOqHfWCHf1+OLj+HKBotLG3KqaOOf+C1C+A==",
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/create-react-context/-/create-react-context-0.2.3.tgz",
"integrity": "sha512-CQBmD0+QGgTaxDL3OX1IDXYqjkp2It4RIbcb99jS6AEg27Ga+a9G3JtK6SIu0HBwPLZlmwt9F7UwWA4Bn92Rag==",
"requires": {
"fbjs": "^0.8.0",
"gud": "^1.0.0"
@@ -2890,16 +2822,6 @@
"unpipe": "~1.0.0"
}
},
"find-babel-config": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/find-babel-config/-/find-babel-config-1.1.0.tgz",
"integrity": "sha1-rMAQQ6Z0n+w0Qpvmtk9ULrtdY1U=",
"dev": true,
"requires": {
"json5": "^0.5.1",
"path-exists": "^3.0.0"
}
},
"find-cache-dir": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz",
@@ -4060,44 +3982,19 @@
}
},
"lbry-redux": {
"version": "github:lbryio/lbry-redux#18fec9f1f0f5ad366ebe12279e5dd0d67a37b2d5",
"from": "github:lbryio/lbry-redux#mobile-channel-pagination",
"version": "github:lbryio/lbry-redux#31f7afa8a37f5741dac01fc1ecdf153f3bed95dc",
"from": "github:lbryio/lbry-redux",
"requires": {
"proxy-polyfill": "0.1.6",
"reselect": "^3.0.0",
"uuid": "^3.3.2"
},
"dependencies": {
"uuid": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
"integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
}
"reselect": "^3.0.0"
}
},
"lbryinc": {
"version": "github:lbryio/lbryinc#4d24cef00106294d3e848b6c2b261e01382fce17",
"from": "github:lbryio/lbryinc#subscriptions",
"version": "github:lbryio/lbryinc#f2fff2a331578aef84eb77c108f976967afc50e0",
"from": "github:lbryio/lbryinc",
"requires": {
"bluebird": "^3.5.1",
"lbry-redux": "github:lbryio/lbry-redux#84b7d396934d57a37802aadbef71db91230a9404",
"lbry-redux": "github:lbryio/lbry-redux#31f7afa8a37f5741dac01fc1ecdf153f3bed95dc",
"reselect": "^3.0.0"
},
"dependencies": {
"lbry-redux": {
"version": "github:lbryio/lbry-redux#84b7d396934d57a37802aadbef71db91230a9404",
"from": "github:lbryio/lbry-redux#84b7d396934d57a37802aadbef71db91230a9404",
"requires": {
"proxy-polyfill": "0.1.6",
"reselect": "^3.0.0",
"uuid": "^3.3.2"
}
},
"uuid": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
"integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
}
}
},
"lcid": {
@@ -5063,15 +4960,6 @@
"find-up": "^2.1.0"
}
},
"pkg-up": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz",
"integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=",
"dev": true,
"requires": {
"find-up": "^2.1.0"
}
},
"plist": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/plist/-/plist-1.2.0.tgz",
@@ -5161,9 +5049,9 @@
"integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM="
},
"query-string": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/query-string/-/query-string-6.2.0.tgz",
"integrity": "sha512-5wupExkIt8RYL4h/FE+WTg3JHk62e6fFPWtAZA9J5IWK1PfTfKkMS93HBUHcFpeYi9KsY5pFbh+ldvEyaz5MyA==",
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/query-string/-/query-string-6.1.0.tgz",
"integrity": "sha512-pNB/Gr8SA8ff8KpUFM36o/WFAlthgaThka5bV19AD9PNTH20Pwq5Zxodif2YyHwrctp6SkL4GqlOot0qR/wGaw==",
"requires": {
"decode-uri-component": "^0.2.0",
"strict-uri-encode": "^2.0.0"
@@ -5247,11 +5135,6 @@
}
}
},
"react-is": {
"version": "16.7.0",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.7.0.tgz",
"integrity": "sha512-Z0VRQdF4NPDoI0tsXVMLkJLiwEBa+RP66g0xDHxgxysxSoCUccSten4RTF/UFvZF1dZvZ9Zu1sx+MDXwcOR34g=="
},
"react-lifecycles-compat": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz",
@@ -5389,11 +5272,6 @@
"react-native-drawer-layout": "1.3.2"
}
},
"react-native-exception-handler": {
"version": "2.9.0",
"resolved": "https://registry.npmjs.org/react-native-exception-handler/-/react-native-exception-handler-2.9.0.tgz",
"integrity": "sha512-XRHhGH5aM4lSenX4zZBa07JaszJGXeF8cv1KY314Q4qJWOihKWLpkdvwqwsBieZ2iy8DPhdAVioQzw8JLD/Okw=="
},
"react-native-fast-image": {
"version": "5.0.3",
"resolved": "https://registry.npmjs.org/react-native-fast-image/-/react-native-fast-image-5.0.3.tgz",
@@ -5446,18 +5324,13 @@
}
},
"react-native-safe-area-view": {
"version": "0.11.0",
"resolved": "https://registry.npmjs.org/react-native-safe-area-view/-/react-native-safe-area-view-0.11.0.tgz",
"integrity": "sha512-N3nElaahu1Me2ltnfc9acpgt1znm6pi8DSadKy79kvdzKwvVIzw0IXueA/Hjr51eCW1BsfNw7D1SgBT9U6qEkA==",
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/react-native-safe-area-view/-/react-native-safe-area-view-0.9.0.tgz",
"integrity": "sha512-y792ScHMzvgwquxL869S9CER4dwiFu/TuCiXdy0xBtygmScMK4eWonnUT65LvOrsSSdr8o6XEK1mbI51h6ozvQ==",
"requires": {
"hoist-non-react-statics": "^2.3.1"
}
},
"react-native-screens": {
"version": "1.0.0-alpha.22",
"resolved": "https://registry.npmjs.org/react-native-screens/-/react-native-screens-1.0.0-alpha.22.tgz",
"integrity": "sha512-kSyAt0AeVU6N7ZonfV6dP6iZF8B7Bce+tk3eujXhzBGsLg0VSLnU7uE9VqJF0xdQrHR91ZjGgVMieo/8df9KTA=="
},
"react-native-tab-view": {
"version": "0.0.77",
"resolved": "https://registry.npmjs.org/react-native-tab-view/-/react-native-tab-view-0.0.77.tgz",
@@ -5514,23 +5387,21 @@
}
},
"react-navigation": {
"version": "2.18.3",
"resolved": "https://registry.npmjs.org/react-navigation/-/react-navigation-2.18.3.tgz",
"integrity": "sha512-/5KGMG1Oj5LN/x/7AKF0MWrpX9Qe29307RxEsMCiRT/A4jCYT0DPY99Bl7ZAGtROxExEy3rwTfTrtvpIT+CU7A==",
"version": "2.12.1",
"resolved": "https://registry.npmjs.org/react-navigation/-/react-navigation-2.12.1.tgz",
"integrity": "sha512-C+do+STPvvd/5LbaDhrZyf1P8tCeffttdlHyIRe1NgGg8Nj93FZHWOThi2hnmEZ75kXsS/JGxox4DDPqYVAxeQ==",
"requires": {
"clamp": "^1.0.1",
"create-react-context": "0.2.2",
"create-react-context": "^0.2.1",
"hoist-non-react-statics": "^2.2.0",
"path-to-regexp": "^1.7.0",
"query-string": "^6.1.0",
"react-is": "^16.5.2",
"react-lifecycles-compat": "^3",
"react-native-safe-area-view": "0.11.0",
"react-native-screens": "^1.0.0-alpha.11",
"react-native-safe-area-view": "^0.9.0",
"react-navigation-deprecated-tab-navigator": "1.3.0",
"react-navigation-drawer": "0.5.0",
"react-navigation-stack": "0.7.0",
"react-navigation-tabs": "0.8.4"
"react-navigation-stack": "0.2.3",
"react-navigation-tabs": "0.6.0"
}
},
"react-navigation-deprecated-tab-navigator": {
@@ -5550,33 +5421,42 @@
}
},
"react-navigation-redux-helpers": {
"version": "2.0.9",
"resolved": "https://registry.npmjs.org/react-navigation-redux-helpers/-/react-navigation-redux-helpers-2.0.9.tgz",
"integrity": "sha512-V1eyQ22T1znZeaou38f/JBp5DUV5X2T4hVVSlsjh8dk2unkWhaugzvrgFMF80Mzg1gH4rVE1yADyI9hzuwbbSw==",
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/react-navigation-redux-helpers/-/react-navigation-redux-helpers-2.0.5.tgz",
"integrity": "sha512-oxDpPqmXdzUJJ32ef8NY6Cu9XDJNO4DU91p0+ZgleEfaZwec9t2ua6sKwQyOfdWQPDwbJAxiXfZIAe3ao5MG6Q==",
"requires": {
"invariant": "^2.2.2"
}
},
"react-navigation-stack": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/react-navigation-stack/-/react-navigation-stack-0.7.0.tgz",
"integrity": "sha512-3Tbb/SsustBrM9R/qaI6XuOfyqYMVbwkeHFC8NbU890vB0aKZvjAtioWLZ18e/4LgbiOCmoTdp37z3gkGDyNDQ=="
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/react-navigation-stack/-/react-navigation-stack-0.2.3.tgz",
"integrity": "sha512-xjVqiI/ztcQt45jxQ3vfO8Lr+9bVq+0J/lRhMdZCvCDwiyOVuB64wx7qPNJW16pnBBLiI5h6H7uhWE3rAT0r/w=="
},
"react-navigation-tabs": {
"version": "0.8.4",
"resolved": "https://registry.npmjs.org/react-navigation-tabs/-/react-navigation-tabs-0.8.4.tgz",
"integrity": "sha512-CbS3xIVJVtpu+AYslv0PMLmjddJFVtU3XAhSJ9XnMrKLUJNmnQdW/L0w/Gp5qcBEF9h6bgsY3CoTtp7I6bqyOQ==",
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/react-navigation-tabs/-/react-navigation-tabs-0.6.0.tgz",
"integrity": "sha512-Ax1rujJ51R1Jrz7b5bHUAIgsYC1VrFws+d3hxlPy5dXG84iJdV5dnDFRvdQMDDfDZc+NDx2a223lAYsc3p2+XA==",
"requires": {
"hoist-non-react-statics": "^2.5.0",
"prop-types": "^15.6.1",
"react-lifecycles-compat": "^3.0.4",
"react-native-safe-area-view": "^0.7.0",
"react-native-tab-view": "^1.0.0"
},
"dependencies": {
"react-native-safe-area-view": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/react-native-safe-area-view/-/react-native-safe-area-view-0.7.0.tgz",
"integrity": "sha512-SjLdW/Th0WVMhyngH4O6yC21S+O4U4AAG3QxBr7fZ2ftgjXSpKbDHAhEpxBdFwei6HsnsC2h9oYMtPpaW9nfGg==",
"requires": {
"hoist-non-react-statics": "^2.3.1"
}
},
"react-native-tab-view": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/react-native-tab-view/-/react-native-tab-view-1.3.1.tgz",
"integrity": "sha512-QNt6VkEW8SP1UJ7yjD5P4bOTWwHQfoIMD5CqnA06pcubdNwHR1NmjiNZsVnIvp5wAEVbW6yTHjLXOh1fzab4xg==",
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/react-native-tab-view/-/react-native-tab-view-1.0.2.tgz",
"integrity": "sha512-x8I43V1X7/AyMnIwnqJGMU54LqQRlV6vJ9irbls9asA/axdHIdxagPIV6Jx1ttFe/bPKhFwXL+lRYdYxGyUlWg==",
"requires": {
"prop-types": "^15.6.1"
}
@@ -7123,11 +7003,6 @@
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
"integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68="
},
"y18n": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
"integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE="
},
"yallist": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
+4 -7
View File
@@ -7,22 +7,20 @@
},
"dependencies": {
"base-64": "^0.1.0",
"@expo/vector-icons": "^8.1.0",
"lbry-redux": "lbryio/lbry-redux#mobile-channel-pagination",
"lbryinc": "lbryio/lbryinc#subscriptions",
"lbry-redux": "lbryio/lbry-redux",
"lbryinc": "lbryio/lbryinc",
"moment": "^2.22.1",
"react": "16.2.0",
"react-native": "0.55.3",
"react-native-country-picker-modal": "^0.6.2",
"react-native-exception-handler": "2.9.0",
"react-native-fast-image": "^5.0.3",
"react-native-fetch-blob": "^0.10.8",
"react-native-image-zoom-viewer": "^2.2.5",
"react-native-phone-input": "lbryio/react-native-phone-input",
"react-native-vector-icons": "^5.0.0",
"react-native-video": "lbryio/react-native-video#exoplayer-lbry-android",
"react-navigation": "^2.18.3",
"react-navigation-redux-helpers": "^2.0.9",
"react-navigation": "^2.12.1",
"react-navigation-redux-helpers": "^2.0.5",
"react-redux": "^5.0.3",
"redux": "^3.6.0",
"redux-logger": "3.0.6",
@@ -35,7 +33,6 @@
"devDependencies": {
"babel-preset-env": "^1.6.1",
"babel-preset-stage-2": "^6.18.0",
"babel-plugin-module-resolver": "^3.1.1",
"flow-babel-webpack-plugin": "^1.1.1"
}
}
+46 -68
View File
@@ -9,7 +9,6 @@ import TrendingPage from '../page/trending';
import SearchPage from '../page/search';
import SettingsPage from '../page/settings';
import SplashScreen from '../page/splash';
import SubscriptionsPage from '../page/subscriptions';
import TransactionHistoryPage from '../page/transactionHistory';
import WalletPage from '../page/wallet';
import SearchInput from '../component/searchInput';
@@ -33,10 +32,8 @@ import {
TextInput,
ToastAndroid
} from 'react-native';
import { doPopDrawerStack } from 'redux/actions/drawer';
import { doDeleteCompleteBlobs } from 'redux/actions/file';
import { selectDrawerStack } from 'redux/selectors/drawer';
import { SETTINGS, doDismissToast, doToast, selectToast } from 'lbry-redux';
import { doDeleteCompleteBlobs } from '../redux/actions/file';
import { SETTINGS, doHideNotification, doNotify, selectNotification } from 'lbry-redux';
import {
doUserEmailVerify,
doUserEmailVerifyFailure,
@@ -45,16 +42,16 @@ import {
selectEmailVerifyErrorMessage,
selectUser
} from 'lbryinc';
import { makeSelectClientSetting } from 'redux/selectors/settings';
import { makeSelectClientSetting } from '../redux/selectors/settings';
import { decode as atob } from 'base-64';
import { dispatchNavigateBack, dispatchNavigateToUri } from 'utils/helper';
import Colors from 'styles/colors';
import Constants from 'constants';
import { dispatchNavigateToUri } from '../utils/helper';
import Colors from '../styles/colors';
import Constants from '../constants';
import Icon from 'react-native-vector-icons/FontAwesome5';
import NavigationButton from 'component/navigationButton';
import discoverStyle from 'styles/discover';
import searchStyle from 'styles/search';
import SearchRightHeaderIcon from 'component/searchRightHeaderIcon';
import NavigationButton from '../component/navigationButton';
import discoverStyle from '../styles/discover';
import searchStyle from '../styles/search';
import SearchRightHeaderIcon from '../component/searchRightHeaderIcon';
const menuNavigationButton = (navigation) => <NavigationButton
name="bars"
@@ -67,45 +64,33 @@ const discoverStack = createStackNavigator({
Discover: {
screen: DiscoverPage,
navigationOptions: ({ navigation }) => ({
title: 'Explore',
title: 'Discover',
headerLeft: menuNavigationButton(navigation),
headerTitleStyle: discoverStyle.titleText
})
},
File: {
screen: FilePage,
navigationOptions: ({ navigation }) => ({
header: null
})
navigationOptions: {
header: null,
drawerLockMode: 'locked-closed'
}
},
Search: {
screen: SearchPage,
navigationOptions: ({ navigation }) => ({
headerTitleStyle: discoverStyle.titleText
drawerLockMode: 'locked-closed'
})
}
}, {
headerMode: 'screen'
});
discoverStack.navigationOptions = ({ navigation }) => {
let drawerLockMode = 'unlocked';
if (navigation.state.index > 0) {
drawerLockMode = 'locked-closed';
}
return {
drawerLockMode
};
};
const trendingStack = createStackNavigator({
Trending: {
screen: TrendingPage,
navigationOptions: ({ navigation }) => ({
title: 'Trending',
headerLeft: menuNavigationButton(navigation),
headerTitleStyle: discoverStyle.titleText
})
}
});
@@ -116,18 +101,6 @@ const myLbryStack = createStackNavigator({
navigationOptions: ({ navigation }) => ({
title: 'My LBRY',
headerLeft: menuNavigationButton(navigation),
headerTitleStyle: discoverStyle.titleText
})
}
});
const mySubscriptionsStack = createStackNavigator({
Subscriptions: {
screen: SubscriptionsPage,
navigationOptions: ({ navigation }) => ({
title: 'My Subscriptions',
headerLeft: menuNavigationButton(navigation),
headerTitleStyle: discoverStyle.titleText
})
}
});
@@ -138,7 +111,6 @@ const rewardsStack = createStackNavigator({
navigationOptions: ({ navigation }) => ({
title: 'Rewards',
headerLeft: menuNavigationButton(navigation),
headerTitleStyle: discoverStyle.titleText
})
}
});
@@ -149,15 +121,13 @@ const walletStack = createStackNavigator({
navigationOptions: ({ navigation }) => ({
title: 'Wallet',
headerLeft: menuNavigationButton(navigation),
headerTitleStyle: discoverStyle.titleText
})
},
TransactionHistory: {
screen: TransactionHistoryPage,
navigationOptions: {
title: 'Transaction History',
drawerLockMode: 'locked-closed',
headerTitleStyle: discoverStyle.titleText
drawerLockMode: 'locked-closed'
}
}
}, {
@@ -166,22 +136,19 @@ const walletStack = createStackNavigator({
const drawer = createDrawerNavigator({
DiscoverStack: { screen: discoverStack, navigationOptions: {
title: 'Explore', drawerIcon: ({ tintColor }) => <Icon name="home" size={20} style={{ color: tintColor }} />
title: 'Discover', drawerIcon: ({ tintColor }) => <Icon name="compass" size={20} style={{ color: tintColor }} />
}},
TrendingStack: { screen: trendingStack, navigationOptions: {
title: 'Trending', drawerIcon: ({ tintColor }) => <Icon name="fire" size={20} style={{ color: tintColor }} />
}},
MySubscriptionsStack: { screen: mySubscriptionsStack, navigationOptions: {
title: 'My Subscriptions', drawerIcon: ({ tintColor }) => <Icon name="rss-square" size={20} style={{ color: tintColor }} />
}},
WalletStack: { screen: walletStack, navigationOptions: {
title: 'Wallet', drawerIcon: ({ tintColor }) => <Icon name="wallet" size={20} style={{ color: tintColor }} />
MyLBRYStack: { screen: myLbryStack, navigationOptions: {
title: 'My LBRY', drawerIcon: ({ tintColor }) => <Icon name="folder" size={20} style={{ color: tintColor }} />
}},
Rewards: { screen: rewardsStack, navigationOptions: {
drawerIcon: ({ tintColor }) => <Icon name="trophy" size={20} style={{ color: tintColor }} />
}},
MyLBRYStack: { screen: myLbryStack, navigationOptions: {
title: 'My LBRY', drawerIcon: ({ tintColor }) => <Icon name="folder" size={20} style={{ color: tintColor }} />
WalletStack: { screen: walletStack, navigationOptions: {
title: 'Wallet', drawerIcon: ({ tintColor }) => <Icon name="wallet" size={20} style={{ color: tintColor }} />
}},
Settings: { screen: SettingsPage, navigationOptions: {
drawerLockMode: 'locked-closed',
@@ -195,8 +162,7 @@ const drawer = createDrawerNavigator({
drawerWidth: 300,
headerMode: 'none',
contentOptions: {
activeTintColor: Colors.LbryGreen,
labelStyle: discoverStyle.menuText
activeTintColor: Colors.LbryGreen
}
});
@@ -243,7 +209,7 @@ class AppWithNavigationState extends React.Component {
componentWillMount() {
AppState.addEventListener('change', this._handleAppStateChange);
BackHandler.addEventListener('hardwareBackPress', function() {
const { dispatch, nav, drawerStack, popDrawerStack } = this.props;
const { dispatch, nav } = this.props;
// There should be a better way to check this
if (nav.routes.length > 0) {
if (nav.routes[0].routeName === 'Main') {
@@ -252,7 +218,7 @@ class AppWithNavigationState extends React.Component {
mainRoute.routes[0].index > 0 /* Discover stack index */ ||
mainRoute.routes[4].index > 0 /* Wallet stack index */ ||
mainRoute.index >= 5 /* Settings and About screens */) {
dispatchNavigateBack(dispatch, nav, drawerStack, doPopDrawerStack);
dispatch(NavigationActions.back());
return true;
}
}
@@ -274,16 +240,28 @@ class AppWithNavigationState extends React.Component {
componentWillUpdate(nextProps) {
const { dispatch } = this.props;
const {
toast,
notification,
emailToVerify,
emailVerifyPending,
emailVerifyErrorMessage,
user
} = nextProps;
if (toast) {
const { message } = toast;
if (notification) {
const { displayType, message } = notification;
let currentDisplayType;
if (displayType && displayType.length) {
for (let i = 0; i < displayType.length; i++) {
const type = displayType[i];
if (AppWithNavigationState.supportedDisplayTypes.indexOf(type) > -1) {
currentDisplayType = type;
break;
}
}
} else if (AppWithNavigationState.supportedDisplayTypes.indexOf(displayType) > -1) {
currentDisplayType = displayType;
}
if (!currentDisplayType && message) {
// default to toast if no display type set and there is a message specified
currentDisplayType = 'toast';
@@ -293,7 +271,7 @@ class AppWithNavigationState extends React.Component {
ToastAndroid.show(message, ToastAndroid.LONG);
}
dispatch(doDismissToast());
dispatch(doHideNotification());
}
if (user &&
@@ -309,7 +287,7 @@ class AppWithNavigationState extends React.Component {
AsyncStorage.removeItem(Constants.KEY_FIRST_RUN_EMAIL);
}
AsyncStorage.removeItem(Constants.KEY_SHOULD_VERIFY_EMAIL);
dispatch(doToast({ message }));
dispatch(doNotify({ message, displayType: ['toast'] }));
}
});
}
@@ -362,11 +340,12 @@ class AppWithNavigationState extends React.Component {
} catch (error) {
const message = 'Invalid Verification Token';
dispatch(doUserEmailVerifyFailure(message));
dispatch(doToast({ message }));
dispatch(doNotify({ message, displayType: ['toast'] }));
}
} else {
dispatch(doToast({
dispatch(doNotify({
message: 'Invalid Verification URI',
displayType: ['toast'],
}));
}
} else {
@@ -384,8 +363,7 @@ const mapStateToProps = state => ({
backgroundPlayEnabled: makeSelectClientSetting(SETTINGS.BACKGROUND_PLAY_ENABLED)(state),
keepDaemonRunning: makeSelectClientSetting(SETTINGS.KEEP_DAEMON_RUNNING)(state),
nav: state.nav,
toast: selectToast(state),
drawerStack: selectDrawerStack(state),
notification: selectNotification(state),
emailToVerify: selectEmailToVerify(state),
emailVerifyPending: selectEmailVerifyIsPending(state),
emailVerifyErrorMessage: selectEmailVerifyErrorMessage(state),
+2 -2
View File
@@ -1,7 +1,7 @@
import { connect } from 'react-redux';
import { doToast } from 'lbry-redux';
import { doNotify } from 'lbry-redux';
import Address from './view';
export default connect(null, {
doToast,
doNotify,
})(Address);
+5 -4
View File
@@ -6,20 +6,21 @@ import walletStyle from '../../styles/wallet';
type Props = {
address: string,
doToast: ({ message: string }) => void,
doNotify: ({ message: string, displayType: Array<string> }) => void,
};
export default class Address extends React.PureComponent<Props> {
render() {
const { address, doToast, style } = this.props;
const { address, doNotify, style } = this.props;
return (
<View style={[walletStyle.row, style]}>
<Text selectable={true} numberOfLines={1} style={walletStyle.address}>{address || ''}</Text>
<Button icon={'clipboard'} style={walletStyle.button} onPress={() => {
Clipboard.setString(address);
doToast({
doNotify({
message: 'Address copied',
displayType: ['toast'],
});
}} />
</View>
+1 -8
View File
@@ -11,8 +11,6 @@ export default class Button extends React.PureComponent {
style,
text,
icon,
iconColor,
solid,
theme,
onPress,
onLayout
@@ -43,14 +41,9 @@ export default class Button extends React.PureComponent {
textStyles.push(buttonStyle.textLight);
}
let renderIcon = (<Icon name={icon} size={18} color={iconColor ? iconColor : ('light' === theme ? Colors.DarkGrey : Colors.White)} />);
if (solid) {
renderIcon = (<Icon name={icon} size={18} color={iconColor ? iconColor : ('light' === theme ? Colors.DarkGrey : Colors.White)} solid />);
}
return (
<TouchableOpacity disabled={disabled} style={styles} onPress={onPress} onLayout={onLayout}>
{icon && renderIcon}
{icon && <Icon name={icon} size={18} color={'light' === theme ? Colors.DarkGrey : Colors.White} />}
{text && (text.trim().length > 0) && <Text style={textStyles}>{text}</Text>}
</TouchableOpacity>
);
@@ -1,26 +0,0 @@
import { connect } from 'react-redux';
import { doToast } from 'lbry-redux';
import {
doClaimRewardType,
doClaimRewardClearError,
makeSelectClaimRewardError,
makeSelectIsRewardClaimPending,
rewards as REWARD_TYPES
} from 'lbryinc';
import CustomRewardCard from './view';
const select = state => ({
rewardIsPending: makeSelectIsRewardClaimPending()(state, {
reward_type: REWARD_TYPES.TYPE_REWARD_CODE,
}),
error: makeSelectClaimRewardError()(state, { reward_type: REWARD_TYPES.TYPE_REWARD_CODE }),
});
const perform = dispatch => ({
claimReward: reward => dispatch(doClaimRewardType(reward.reward_type, true)),
clearError: reward => dispatch(doClaimRewardClearError(reward)),
notify: data => dispatch(doToast(data)),
submitRewardCode: code => dispatch(doClaimRewardType(REWARD_TYPES.TYPE_REWARD_CODE, { params: { code } }))
});
export default connect(select, perform)(CustomRewardCard);
@@ -1,85 +0,0 @@
// @flow
import React from 'react';
import { ActivityIndicator, Keyboard, Text, TextInput, TouchableOpacity, View } from 'react-native';
import Colors from '../../styles/colors';
import Icon from 'react-native-vector-icons/FontAwesome5';
import Button from '../button';
import Link from '../link';
import rewardStyle from '../../styles/reward';
class CustomRewardCard extends React.PureComponent<Props> {
state = {
claimStarted: false,
rewardCode: ''
};
componentWillReceiveProps(nextProps) {
const { error, rewardIsPending } = nextProps;
const { clearError, notify } = this.props;
if (this.state.claimStarted && !rewardIsPending) {
if (error && error.trim().length > 0) {
notify({ message: error });
} else {
notify({ message: 'Reward successfully claimed!' });
this.setState({ rewardCode: '' });
}
this.setState({ claimStarted: false });
}
}
onClaimPress = () => {
const { canClaim, notify, submitRewardCode } = this.props;
const { rewardCode } = this.state;
Keyboard.dismiss();
if (!canClaim) {
notify({ message: 'Unfortunately, you are not eligible to claim this reward at this time.' });
return;
}
if (!rewardCode || rewardCode.trim().length === 0) {
notify({ message: 'Please enter a reward code to claim.' });
return;
}
this.setState({ claimStarted: true }, () => {
submitRewardCode(rewardCode);
});
}
render() {
const { canClaim, rewardIsPending } = this.props;
return (
<View style={[rewardStyle.rewardCard, rewardStyle.row]} >
<View style={rewardStyle.leftCol}>
{rewardIsPending && <ActivityIndicator size="small" color={Colors.LbryGreen} />}
</View>
<View style={rewardStyle.midCol}>
<Text style={rewardStyle.rewardTitle}>Custom Code</Text>
<Text style={rewardStyle.rewardDescription}>Are you a supermodel or rockstar that received a custom reward code? Claim it here.</Text>
<View>
<TextInput style={rewardStyle.customCodeInput}
placeholder={"0123abc"}
onChangeText={text => this.setState({ rewardCode: text })}
value={this.state.rewardCode} />
<Button style={rewardStyle.redeemButton}
text={"Redeem"}
disabled={(!this.state.rewardCode || this.state.rewardCode.trim().length === 0 || rewardIsPending)}
onPress={() => {
if (!rewardIsPending) { this.onClaimPress(); }
}} />
</View>
</View>
<View style={rewardStyle.rightCol}>
<Text style={rewardStyle.rewardAmount}>?</Text>
<Text style={rewardStyle.rewardCurrency}>LBC</Text>
</View>
</View>
);
}
};
export default CustomRewardCard;
-16
View File
@@ -1,16 +0,0 @@
import { connect } from 'react-redux';
import { doFetchBlock, makeSelectBlockDate } from 'lbry-redux';
import DateTime from './view';
const select = (state, props) => ({
date: !props.date && props.block ? makeSelectBlockDate(props.block)(state) : props.date,
});
const perform = dispatch => ({
fetchBlock: height => dispatch(doFetchBlock(height)),
});
export default connect(
select,
perform
)(DateTime);
-55
View File
@@ -1,55 +0,0 @@
// @flow
import React from 'react';
import moment from 'moment';
import { View, Text } from 'react-native';
type Props = {
date?: number,
timeAgo?: boolean,
formatOptions: {},
show?: string,
};
class DateTime extends React.PureComponent<Props> {
static SHOW_DATE = 'date';
static SHOW_TIME = 'time';
static SHOW_BOTH = 'both';
static defaultProps = {
formatOptions: {
month: 'long',
day: 'numeric',
year: 'numeric',
},
};
render() {
const { date, formatOptions, timeAgo, style, textStyle } = this.props;
const show = this.props.show || DateTime.SHOW_BOTH;
const locale = 'en-US'; // default to en-US until we get a working i18n module for RN
if (timeAgo) {
return date ? <View style={style}><Text style={textStyle}>{moment(date).from(moment())}</Text></View> : null;
}
// TODO: formatOptions not working as expected in RN
// date.toLocaleDateString([locale, 'en-US'], formatOptions)}
return (
<View style={style}>
<Text style={textStyle}>
{date &&
(show === DateTime.SHOW_BOTH || show === DateTime.SHOW_DATE) &&
moment(date).format('MMMM D, YYYY')}
{show === DateTime.SHOW_BOTH && ' '}
{date &&
(show === DateTime.SHOW_BOTH || show === DateTime.SHOW_TIME) &&
date.toLocaleTimeString()}
{!date && '...'}
</Text>
</View>
);
}
}
export default DateTime;
@@ -5,7 +5,7 @@ import {
selectEmailNewIsPending,
selectEmailToVerify
} from 'lbryinc';
import { doToast } from 'lbry-redux';
import { doNotify } from 'lbry-redux';
import EmailRewardSubcard from './view';
const select = state => ({
@@ -16,7 +16,7 @@ const select = state => ({
const perform = dispatch => ({
addUserEmail: email => dispatch(doUserEmailNew(email)),
notify: data => dispatch(doToast(data))
notify: data => dispatch(doNotify(data))
});
export default connect(select, perform)(EmailRewardSubcard);
export default connect(select, perform)(EmailRewardSubcard);
+3 -1
View File
@@ -38,11 +38,12 @@ class EmailRewardSubcard extends React.PureComponent {
if (this.state.verifyStarted && !emailNewPending) {
if (emailNewErrorMessage) {
notify({ message: String(emailNewErrorMessage), isError: true });
notify({ message: String(emailNewErrorMessage), displayType: ['toast']});
this.setState({ verifyStarted: false });
} else {
notify({
message: 'Please follow the instructions in the email sent to your address to continue.',
displayType: ['toast']
});
}
}
@@ -64,6 +65,7 @@ class EmailRewardSubcard extends React.PureComponent {
if (!email || email.trim().length === 0 || email.indexOf('@') === -1) {
return notify({
message: 'Please provide a valid email address to continue.',
displayType: ['toast'],
});
}
@@ -6,7 +6,7 @@ import {
makeSelectLoadingForUri,
makeSelectCostInfoForUri
} from 'lbry-redux';
import { doPurchaseUri, doStartDownload } from 'redux/actions/file';
import { doPurchaseUri, doStartDownload } from '../../redux/actions/file';
import FileDownloadButton from './view';
const select = (state, props) => ({
+2 -7
View File
@@ -38,9 +38,7 @@ class FileDownloadButton extends React.PureComponent {
purchaseUri,
costInfo,
isPlayable,
isViewable,
onPlay,
onView,
loading,
doPause,
style,
@@ -70,7 +68,7 @@ class FileDownloadButton extends React.PureComponent {
}
return (
<Button icon={isPlayable ? 'play' : null}
text={(isPlayable ? 'Play' : (isViewable ? 'View' : 'Download'))}
text={isPlayable ? 'Play' : 'Download'}
onLayout={onButtonLayout}
style={[style, fileDownloadButtonStyle.container]} onPress={() => {
if (NativeModules.Mixpanel) {
@@ -80,16 +78,13 @@ class FileDownloadButton extends React.PureComponent {
if (isPlayable && onPlay) {
this.props.onPlay();
}
if (isViewable && onView) {
this.props.onView();
}
}} />
);
} else if (fileInfo && fileInfo.download_path) {
return (
<TouchableOpacity onLayout={onButtonLayout}
style={[style, fileDownloadButtonStyle.container]} onPress={openFile}>
<Text style={fileDownloadButtonStyle.text}>{isViewable ? 'View' : 'Open'}</Text>
<Text style={fileDownloadButtonStyle.text}>Open</Text>
</TouchableOpacity>
);
}
+12 -17
View File
@@ -2,15 +2,14 @@ import React from 'react';
import { normalizeURI } from 'lbry-redux';
import { NavigationActions } from 'react-navigation';
import { NativeModules, Text, View, TouchableOpacity } from 'react-native';
import { navigateToUri } from 'utils/helper';
import Colors from 'styles/colors';
import DateTime from 'component/dateTime';
import FileItemMedia from 'component/fileItemMedia';
import FilePrice from 'component/filePrice';
import { navigateToUri } from '../../utils/helper';
import Colors from '../../styles/colors';
import FileItemMedia from '../fileItemMedia';
import FilePrice from '../filePrice';
import Icon from 'react-native-vector-icons/FontAwesome5';
import Link from 'component/link';
import NsfwOverlay from 'component/nsfwOverlay';
import discoverStyle from 'styles/discover';
import Link from '../link';
import NsfwOverlay from '../nsfwOverlay';
import discoverStyle from '../../styles/discover';
class FileItem extends React.PureComponent {
constructor(props) {
@@ -51,7 +50,6 @@ class FileItem extends React.PureComponent {
const obscureNsfw = this.props.obscureNsfw && metadata && metadata.nsfw;
const isRewardContent = claim && rewardedContentClaimIds.includes(claim.claim_id);
const channelName = claim ? claim.channel_name : null;
const height = claim ? claim.height : null;
return (
<View style={style}>
@@ -73,14 +71,11 @@ class FileItem extends React.PureComponent {
<Text style={[discoverStyle.fileItemName, discoverStyle.rewardTitle]}>{title}</Text>
{isRewardContent && <Icon style={discoverStyle.rewardIcon} name="award" size={20} />}
</View>
<View style={discoverStyle.detailsRow}>
{channelName &&
<Link style={discoverStyle.channelName} text={channelName} onPress={() => {
const channelUri = normalizeURI(channelName);
navigateToUri(navigation, channelUri);
}} />}
<DateTime style={discoverStyle.dateTime} textStyle={discoverStyle.dateTimeText} timeAgo block={height} />
</View>
{channelName &&
<Link style={discoverStyle.channelName} text={channelName} onPress={() => {
const channelUri = normalizeURI(channelName);
navigateToUri(navigation, channelUri);
}} />}
</TouchableOpacity>
{obscureNsfw && <NsfwOverlay onPress={() => navigation.navigate({ routeName: 'Settings', key: 'settingsPage' })} />}
</View>
+2 -2
View File
@@ -1,8 +1,8 @@
import React from 'react';
import { ActivityIndicator, Image, Text, View } from 'react-native';
import Colors from 'styles/colors';
import Colors from '../../styles/colors';
import FastImage from 'react-native-fast-image'
import fileItemMediaStyle from 'styles/fileItemMedia';
import fileItemMediaStyle from '../../styles/fileItemMedia';
class FileItemMedia extends React.PureComponent {
static AUTO_THUMB_STYLES = [
+2 -2
View File
@@ -166,7 +166,7 @@ class FileList extends React.PureComponent<Props, State> {
items.push(uri);
});
return (
<FlatList
style={style}
@@ -176,7 +176,7 @@ class FileList extends React.PureComponent<Props, State> {
<FileItem style={discoverStyle.fileItem}
uri={item}
navigation={navigation} />
)} />
)} />
);
}
}
+9 -14
View File
@@ -8,13 +8,12 @@ import {
TouchableOpacity,
View
} from 'react-native';
import { navigateToUri, formatBytes } from 'utils/helper';
import Colors from 'styles/colors';
import DateTime from 'component/dateTime';
import FileItemMedia from 'component/fileItemMedia';
import Link from 'component/link';
import NsfwOverlay from 'component/nsfwOverlay';
import fileListStyle from 'styles/fileList';
import { navigateToUri, formatBytes } from '../../utils/helper';
import Colors from '../../styles/colors';
import FileItemMedia from '../fileItemMedia';
import Link from '../../component/link';
import NsfwOverlay from '../../component/nsfwOverlay';
import fileListStyle from '../../styles/fileList';
class FileListItem extends React.PureComponent {
getStorageForFileInfo = (fileInfo) => {
@@ -63,11 +62,11 @@ class FileListItem extends React.PureComponent {
const isResolving = !fileInfo && isResolvingUri;
const title = fileInfo ? fileInfo.metadata.title : metadata && metadata.title ? metadata.title : parseURI(uri).contentName;
let name, channel, height;
let name;
let channel;
if (claim) {
name = claim.name;
channel = claim.channel_name;
height = claim.height;
}
return (
@@ -94,13 +93,9 @@ class FileListItem extends React.PureComponent {
navigateToUri(navigation, channelUri);
}} />}
<View style={fileListStyle.info}>
{fileInfo && <Text style={fileListStyle.infoText}>{this.getStorageForFileInfo(fileInfo)}</Text>}
<DateTime style={fileListStyle.publishInfo} textStyle={fileListStyle.infoText} timeAgo block={height} />
</View>
{fileInfo &&
<View style={fileListStyle.downloadInfo}>
<Text style={fileListStyle.downloadStorage}>{this.getStorageForFileInfo(fileInfo)}</Text>
{!fileInfo.completed &&
<View style={fileListStyle.progress}>
<View style={[fileListStyle.progressCompleted, { flex: this.getDownloadProgress(fileInfo) } ]} />
@@ -20,7 +20,7 @@ class FloatingWalletBalance extends React.PureComponent<Props> {
onPress={() => navigation && navigation.navigate({ routeName: 'WalletStack' })}>
{isNaN(balance) && <ActivityIndicator size="small" color={Colors.White} />}
<Text style={floatingButtonStyle.text}>
{(balance || balance === 0) && (formatCredits(parseFloat(balance), 2) + ' LBC')}
{(balance || balance === 0) && (formatCredits(balance, 2) + ' LBC')}
</Text>
</TouchableOpacity>
);
+2 -2
View File
@@ -1,9 +1,9 @@
import { connect } from 'react-redux';
import { doToast } from 'lbry-redux';
import { doNotify } from 'lbry-redux';
import Link from './view';
const perform = dispatch => ({
notify: (data) => dispatch(doToast(data))
notify: (data) => dispatch(doNotify(data))
});
export default connect(null, perform)(Link);
+2 -10
View File
@@ -21,7 +21,7 @@ export default class Link extends React.PureComponent {
Linking.openURL(href)
.then(() => setTimeout(() => { this.setState({ tappedStyle: false }); }, 2000))
.catch(err => {
notify({ message: error, isError: true })
notify({ message: error, displayType: ['toast']})
this.setState({tappedStyle: false})
}
);
@@ -35,8 +35,6 @@ export default class Link extends React.PureComponent {
render() {
const {
ellipsizeMode,
numberOfLines,
onPress,
style,
text
@@ -56,13 +54,7 @@ export default class Link extends React.PureComponent {
}
return (
<Text
style={styles}
numberOfLines={numberOfLines}
ellipsizeMode={ellipsizeMode}
onPress={onPress ? onPress : this.handlePress}>
{text}
</Text>
<Text style={styles} onPress={onPress ? onPress : this.handlePress}>{text}</Text>
);
}
};
+2 -13
View File
@@ -9,11 +9,10 @@ import {
ScrollView,
TouchableOpacity
} from 'react-native';
import FastImage from 'react-native-fast-image'
import Video from 'react-native-video';
import Icon from 'react-native-vector-icons/FontAwesome5';
import FileItemMedia from 'component/fileItemMedia';
import mediaPlayerStyle from 'styles/mediaPlayer';
import FileItemMedia from '../fileItemMedia';
import mediaPlayerStyle from '../../styles/mediaPlayer';
class MediaPlayer extends React.PureComponent {
static ControlsTimeout = 3000;
@@ -154,9 +153,6 @@ class MediaPlayer extends React.PureComponent {
onEnd = () => {
this.setState({ paused: true });
if (this.props.onPlaybackFinished) {
this.props.onPlaybackFinished();
}
this.video.seek(0);
}
@@ -359,13 +355,6 @@ class MediaPlayer extends React.PureComponent {
onEnd={this.onEnd}
/>
{this.state.firstPlay && thumbnail &&
<FastImage
source={{uri: thumbnail}}
resizeMode={FastImage.resizeMode.cover}
style={mediaPlayerStyle.playerThumbnail}
/>}
<TouchableOpacity style={mediaPlayerStyle.playerControls} onPress={this.togglePlayerControls}>
{this.renderPlayerControls()}
</TouchableOpacity>
@@ -1,5 +1,5 @@
import { connect } from 'react-redux';
import { doToast } from 'lbry-redux';
import { doNotify } from 'lbry-redux';
import {
doUserPhoneNew,
doUserPhoneVerify,
@@ -22,7 +22,7 @@ const select = state => ({
const perform = dispatch => ({
addUserPhone: (phone, country_code) => dispatch(doUserPhoneNew(phone, country_code)),
verifyPhone: (verificationCode) => dispatch(doUserPhoneVerify(verificationCode)),
notify: data => dispatch(doToast(data)),
notify: data => dispatch(doNotify(data)),
});
export default connect(select, perform)(PhoneNumberRewardSubcard);
export default connect(select, perform)(PhoneNumberRewardSubcard);
@@ -11,14 +11,14 @@ import {
TouchableOpacity,
View
} from 'react-native';
import Button from 'component/button';
import Colors from 'styles/colors';
import Constants from 'constants';
import Button from '../button';
import Colors from '../../styles/colors';
import Constants from '../../constants';
import CountryPicker from 'react-native-country-picker-modal';
import Icon from 'react-native-vector-icons/FontAwesome5';
import Link from 'component/link';
import Link from '../link';
import PhoneInput from 'react-native-phone-input';
import rewardStyle from 'styles/reward';
import rewardStyle from '../../styles/reward';
class PhoneNumberRewardSubcard extends React.PureComponent {
phoneInput = null;
@@ -35,13 +35,12 @@ class PhoneNumberRewardSubcard extends React.PureComponent {
countryCode: null,
newPhoneAdded: false,
number: null,
phoneVerifyFailed: false,
verificationCode: null,
};
}
componentDidMount() {
//DeviceEventEmitter.addListener('onReceiveSmsPermissionGranted', this.receiveSmsPermissionGranted);
DeviceEventEmitter.addListener('onReceiveSmsPermissionGranted', this.receiveSmsPermissionGranted);
DeviceEventEmitter.addListener('onVerificationCodeReceived', this.receiveVerificationCode);
const { phone } = this.props;
@@ -49,13 +48,13 @@ class PhoneNumberRewardSubcard extends React.PureComponent {
this.setState({ newPhoneAdded: true });
}
/*if (NativeModules.UtilityModule) {
if (NativeModules.UtilityModule) {
NativeModules.UtilityModule.canReceiveSms().then(canReceiveSms => this.setState({ canReceiveSms }));
}*/
}
}
componentWillUnmount() {
//DeviceEventEmitter.removeListener('onReceiveSmsPermissionGranted', this.receiveSmsPermissionGranted);
DeviceEventEmitter.removeListener('onReceiveSmsPermissionGranted', this.receiveSmsPermissionGranted);
DeviceEventEmitter.removeListener('onVerificationCodeReceived', this.receiveVerificationCode);
}
@@ -71,19 +70,18 @@ class PhoneNumberRewardSubcard extends React.PureComponent {
if (!phoneNewIsPending && (phoneNewIsPending !== prevProps.phoneNewIsPending)) {
if (phoneNewErrorMessage) {
notify({ message: String(phoneNewErrorMessage) });
this.setState({ phoneVerifyFailed: true });
notify({ message: String(phoneNewErrorMessage), displayType: ['toast'] });
} else {
this.setState({ newPhoneAdded: true, phoneVerifyFailed: false });
this.setState({ newPhoneAdded: true });
}
}
if (!phoneVerifyIsPending && (phoneVerifyIsPending !== prevProps.phoneVerifyIsPending)) {
if (phoneVerifyErrorMessage) {
notify({ message: String(phoneVerifyErrorMessage) });
this.setState({ codeVerifyStarted: false, phoneVerifyFailed: true });
notify({ message: String(phoneVerifyErrorMessage), displayType: ['toast'] });
this.setState({ codeVerifyStarted: false });
} else {
notify({ message: 'Your phone number was successfully verified.' });
this.setState({ codeVerifySuccessful: true, phoneVerifyFailed: false });
notify({ message: 'Your phone number was successfully verified.', displayType: ['toast'] });
this.setState({ codeVerifySuccessful: true });
if (onPhoneVerifySuccessful) {
onPhoneVerifySuccessful();
}
@@ -91,6 +89,10 @@ class PhoneNumberRewardSubcard extends React.PureComponent {
}
}
receiveSmsPermissionGranted = () => {
this.setState({ canReceiveSms: true });
}
receiveVerificationCode = (evt) => {
if (!this.state.newPhoneAdded || this.state.codeVerifySuccessful) {
return;
@@ -101,16 +103,27 @@ class PhoneNumberRewardSubcard extends React.PureComponent {
verifyPhone(evt.code);
}
onAllowAccessPressed = () => {
if (!NativeModules.UtilityModule) {
return notify({
message: 'The required permission could not be obtained due to a missing module.',
displayType: ['toast']
});
}
NativeModules.UtilityModule.requestReceiveSmsPermission();
}
onSendTextPressed = () => {
const { addUserPhone, notify } = this.props;
if (!this.phoneInput.isValidNumber()) {
return notify({
message: 'Please provide a valid telephone number.',
displayType: ['toast']
});
}
this.setState({ phoneVerifyFailed: false });
const countryCode = this.phoneInput.getCountryCode();
const number = this.phoneInput.getValue().replace('+' + countryCode, '');
this.setState({ countryCode, number });
@@ -123,7 +136,7 @@ class PhoneNumberRewardSubcard extends React.PureComponent {
}
const { verifyPhone } = this.props;
this.setState({ codeVerifyStarted: true, phoneVerifyFailed: false });
this.setState({ codeVerifyStarted: true });
verifyPhone(this.state.verificationCode);
}
@@ -158,6 +171,17 @@ class PhoneNumberRewardSubcard extends React.PureComponent {
return (
<View style={rewardStyle.subcard}>
<Text style={rewardStyle.subtitle}>Pending action: Verify Phone Number</Text>
{!this.state.canReceiveSms &&
<View style={rewardStyle.smsPermissionContainer}>
<Text style={[rewardStyle.bottomMarginMedium, rewardStyle.subcardText]}>
You can grant access to the receive SMS permission in order to verify phone number. Alternatively, you can enter the verification code manually.
</Text>
<Button
style={rewardStyle.actionButton}
text={"Allow access"}
onPress={this.onAllowAccessPressed}
/>
</View>}
<View style={rewardStyle.phoneVerificationContainer}>
{!this.state.newPhoneAdded &&
<View>
@@ -210,12 +234,6 @@ class PhoneNumberRewardSubcard extends React.PureComponent {
</View>}
</View>
}
{this.state.phoneVerifyFailed &&
<View style={rewardStyle.failureFootnote}>
<Text style={rewardStyle.subcardText}>
Sorry, we were unable to verify your phone number. Please go to <Link style={rewardStyle.textLink} href="http://chat.lbry.io" text="chat.lbry.io" /> for manual verification if this keeps happening.
</Text>
</View>}
</View>
<CountryPicker
+2 -2
View File
@@ -1,5 +1,5 @@
import { connect } from 'react-redux';
import { doToast } from 'lbry-redux';
import { doNotify } from 'lbry-redux';
import {
doClaimRewardType,
doClaimRewardClearError,
@@ -23,7 +23,7 @@ const makeSelect = () => {
const perform = dispatch => ({
claimReward: reward => dispatch(doClaimRewardType(reward.reward_type, true)),
clearError: reward => dispatch(doClaimRewardClearError(reward)),
notify: data => dispatch(doToast(data))
notify: data => dispatch(doNotify(data))
});
export default connect(makeSelect, perform)(RewardCard);
+5 -9
View File
@@ -30,10 +30,10 @@ class RewardCard extends React.PureComponent<Props> {
const { clearError, notify, reward } = this.props;
if (this.state.claimStarted && !isPending) {
if (errorMessage && errorMessage.trim().length > 0) {
notify({ message: errorMessage });
notify({ message: errorMessage, displayType: ['toast'] });
clearError(reward);
} else {
notify({ message: 'Reward successfully claimed!' });
notify({ message: 'Reward successfully claimed!', displayType: ['toast'] });
}
this.setState({ claimStarted: false });
}
@@ -48,7 +48,7 @@ class RewardCard extends React.PureComponent<Props> {
} = this.props;
if (!canClaim) {
notify({ message: 'Unfortunately, you are not eligible to claim this reward at this time.' });
notify({ message: 'Unfortunately, you are not eligible to claim this reward at this time.', displayType: ['toast'] });
return;
}
@@ -62,11 +62,7 @@ class RewardCard extends React.PureComponent<Props> {
const claimed = !!reward.transaction_id;
return (
<TouchableOpacity style={[rewardStyle.rewardCard, rewardStyle.row]} onPress={() => {
if (!isPending && !claimed) {
this.onClaimPress();
}
}}>
<View style={[rewardStyle.rewardCard, rewardStyle.row]}>
<View style={rewardStyle.leftCol}>
{!isPending && <TouchableOpacity onPress={() => {
if (!claimed) {
@@ -91,7 +87,7 @@ class RewardCard extends React.PureComponent<Props> {
<Text style={rewardStyle.rewardAmount}>{reward.reward_amount}</Text>
<Text style={rewardStyle.rewardCurrency}>LBC</Text>
</View>
</TouchableOpacity>
</View>
);
}
};
+2 -2
View File
@@ -1,5 +1,5 @@
import { connect } from 'react-redux';
import { doToast } from 'lbry-redux';
import { doNotify } from 'lbry-redux';
import { doRewardList, selectUnclaimedRewardValue, selectFetchingRewards, selectUser } from 'lbryinc';
import RewardSummary from './view';
@@ -11,7 +11,7 @@ const select = state => ({
const perform = dispatch => ({
fetchRewards: () => dispatch(doRewardList()),
notify: data => dispatch(doToast(data))
notify: data => dispatch(doNotify(data))
});
export default connect(select, perform)(RewardSummary);
+1
View File
@@ -38,6 +38,7 @@ class RewardSummary extends React.Component {
this.setState({ dismissed: true });
this.props.notify({
message: 'You can always claim your rewards from the Rewards page.',
displayType: ['toast']
});
}
@@ -1,23 +0,0 @@
import { connect } from 'react-redux';
import {
doChannelSubscribe,
doChannelUnsubscribe,
selectSubscriptions,
makeSelectIsSubscribed,
} from 'lbryinc';
import { doToast } from 'lbry-redux';
import SubscribeButton from './view';
const select = (state, props) => ({
subscriptions: selectSubscriptions(state),
isSubscribed: makeSelectIsSubscribed(props.uri, true)(state),
});
export default connect(
select,
{
doChannelSubscribe,
doChannelUnsubscribe,
doToast,
}
)(SubscribeButton);
-49
View File
@@ -1,49 +0,0 @@
import React from 'react';
import { parseURI } from 'lbry-redux';
import { NativeModules, Text, View, TouchableOpacity } from 'react-native';
import Button from '../button';
import Colors from '../../styles/colors';
class SubscribeButton extends React.PureComponent {
render() {
const {
uri,
isSubscribed,
doChannelSubscribe,
doChannelUnsubscribe,
style
} = this.props;
let styles = [];
if (style) {
if (style.length) {
styles = styles.concat(style);
} else {
styles.push(style);
}
}
const iconColor = isSubscribed ? null : Colors.Red;
const subscriptionHandler = isSubscribed ? doChannelUnsubscribe : doChannelSubscribe;
const subscriptionLabel = isSubscribed ? __('Unsubscribe') : __('Subscribe');
const { claimName } = parseURI(uri);
return (
<Button
style={styles}
theme={"light"}
icon={"heart"}
iconColor={iconColor}
solid={isSubscribed ? false : true}
text={subscriptionLabel}
onPress={() => {
subscriptionHandler({
channelName: claimName,
uri,
});
}} />
);
}
}
export default SubscribeButton;
@@ -1,25 +0,0 @@
import { connect } from 'react-redux';
import {
doChannelSubscriptionEnableNotifications,
doChannelSubscriptionDisableNotifications,
selectEnabledChannelNotifications,
selectSubscriptions,
makeSelectIsSubscribed,
} from 'lbryinc';
import { doToast } from 'lbry-redux';
import SubscribeNotificationButton from './view';
const select = (state, props) => ({
enabledChannelNotifications: selectEnabledChannelNotifications(state),
subscriptions: selectSubscriptions(state),
isSubscribed: makeSelectIsSubscribed(props.uri, true)(state),
});
export default connect(
select,
{
doChannelSubscriptionEnableNotifications,
doChannelSubscriptionDisableNotifications,
doToast,
}
)(SubscribeNotificationButton);
@@ -1,55 +0,0 @@
import React from 'react';
import { parseURI } from 'lbry-redux';
import { NativeModules, Text, View, TouchableOpacity } from 'react-native';
import Button from 'component/button';
import Colors from 'styles/colors';
class SubscribeNotificationButton extends React.PureComponent {
render() {
const {
uri,
name,
doChannelSubscriptionEnableNotifications,
doChannelSubscriptionDisableNotifications,
doToast,
enabledChannelNotifications,
isSubscribed,
style
} = this.props;
if (!isSubscribed) {
return null;
}
let styles = [];
if (style) {
if (style.length) {
styles = styles.concat(style);
} else {
styles.push(style);
}
}
const shouldNotify = enabledChannelNotifications.indexOf(name) > -1;
const { claimName } = parseURI(uri);
return (
<Button
style={styles}
theme={"light"}
icon={shouldNotify ? "bell-slash" : "bell"}
solid={true}
onPress={() => {
if (shouldNotify) {
doChannelSubscriptionDisableNotifications(name);
doToast({ message: 'You will not receive notifications for new content.' });
} else {
doChannelSubscriptionEnableNotifications(name);
doToast({ message: 'You will receive all notifications for new content.' });
}
}} />
);
}
}
export default SubscribeNotificationButton;
+1 -1
View File
@@ -19,7 +19,7 @@ class WalletBalance extends React.PureComponent<Props> {
<Text style={walletStyle.balanceTitle}>Balance</Text>
<Text style={walletStyle.balanceCaption}>You currently have</Text>
<Text style={walletStyle.balance}>
{(balance || balance === 0) && (formatCredits(parseFloat(balance), 2) + ' LBC')}
{(balance || balance === 0) && (formatCredits(balance, 2) + ' LBC')}
</Text>
</View>
);
+6 -6
View File
@@ -1,6 +1,6 @@
import { connect } from 'react-redux';
import {
doToast,
doNotify,
doSendDraftTransaction,
selectDraftTransaction,
selectDraftTransactionError,
@@ -8,15 +8,15 @@ import {
} from 'lbry-redux';
import WalletSend from './view';
const perform = dispatch => ({
sendToAddress: (address, amount) => dispatch(doSendDraftTransaction(address, amount)),
notify: (data) => dispatch(doNotify(data))
});
const select = state => ({
balance: selectBalance(state),
draftTransaction: selectDraftTransaction(state),
transactionError: selectDraftTransactionError(state),
});
const perform = dispatch => ({
sendToAddress: (address, amount) => dispatch(doSendDraftTransaction(address, amount)),
notify: (data) => dispatch(doToast(data))
});
export default connect(select, perform)(WalletSend);
+6 -12
View File
@@ -1,7 +1,7 @@
// @flow
import React from 'react';
import { regexAddress } from 'lbry-redux';
import { Alert, TextInput, Text, View } from 'react-native';
import { TextInput, Text, View } from 'react-native';
import Button from '../button';
import walletStyle from '../../styles/wallet';
@@ -38,6 +38,7 @@ class WalletSend extends React.PureComponent<Props> {
if (address && !regexAddress.test(address)) {
notify({
message: 'The recipient address is not a valid LBRY address.',
displayType: ['toast']
});
return;
}
@@ -45,22 +46,14 @@ class WalletSend extends React.PureComponent<Props> {
if (amount > balance) {
notify({
message: 'Insufficient credits',
displayType: ['toast']
});
return;
}
if (amount && address) {
// Show confirmation before send
Alert.alert(
'Send LBC',
`Are you sure you want to send ${amount} LBC to ${address}?`,
[
{ text: 'No' },
{ text: 'Yes', onPress: () => {
sendToAddress(address, parseFloat(amount));
this.setState({ address: null, amount: null });
}}
]);
sendToAddress(address, parseFloat(amount));
this.setState({ address: null, amount: null });
}
}
@@ -69,6 +62,7 @@ class WalletSend extends React.PureComponent<Props> {
const { notify } = this.props;
notify({
message: 'The recipient address is not a valid LBRY address.',
displayType: ['toast']
});
}
}
-28
View File
@@ -6,34 +6,6 @@ const Constants = {
ACTION_DELETE_COMPLETED_BLOBS: "DELETE_COMPLETED_BLOBS",
ACTION_FIRST_RUN_PAGE_CHANGED: "FIRST_RUN_PAGE_CHANGED",
ACTION_PUSH_DRAWER_STACK: "PUSH_DRAWER_STACK",
ACTION_POP_DRAWER_STACK: "POP_DRAWER_STACK",
PAGE_REWARDS: "rewards",
PAGE_SETTINGS: "settings",
PAGE_TRENDING: "trending",
PAGE_WALLET: "wallet",
DRAWER_ROUTE_DISCOVER: "Discover",
DRAWER_ROUTE_TRENDING: "Trending",
DRAWER_ROUTE_SUBSCRIPTIONS: "Subscriptions",
DRAWER_ROUTE_MY_LBRY: "Downloads",
DRAWER_ROUTE_REWARDS: "Rewards",
DRAWER_ROUTE_WALLET: "Wallet",
DRAWER_ROUTE_SETTINGS: "Settings",
DRAWER_ROUTE_ABOUT: "About"
};
export default Constants;
export const DrawerRoutes = [
Constants.DRAWER_ROUTE_DISCOVER,
Constants.DRAWER_ROUTE_TRENDING,
Constants.DRAWER_ROUTE_SUBSCRIPTIONS,
Constants.DRAWER_ROUTE_MY_LBRY,
Constants.DRAWER_ROUTE_REWARDS,
Constants.DRAWER_ROUTE_WALLET,
Constants.DRAWER_ROUTE_SETTINGS,
Constants.DRAWER_ROUTE_ABOUT
];
+4 -16
View File
@@ -1,5 +1,4 @@
import React from 'react';
import { setJSExceptionHandler } from 'react-native-exception-handler';
import { Provider, connect } from 'react-redux';
import {
AppRegistry,
@@ -19,28 +18,19 @@ import {
searchReducer,
walletReducer
} from 'lbry-redux';
import { authReducer, rewardsReducer, subscriptionsReducer, userReducer } from 'lbryinc';
import { authReducer, rewardsReducer, userReducer } from 'lbryinc';
import { createStore, applyMiddleware, compose, combineReducers } from 'redux';
import { createLogger } from 'redux-logger';
import { AppNavigator } from 'component/AppNavigator';
import { AppNavigator } from './component/AppNavigator';
import { persistStore, autoRehydrate } from 'redux-persist';
import AppWithNavigationState, { reactNavigationMiddleware } from './component/AppNavigator';
import FilesystemStorage from 'redux-persist-filesystem-storage';
import createCompressor from 'redux-persist-transform-compress';
import createFilter from 'redux-persist-transform-filter';
import moment from 'moment';
import drawerReducer from 'redux/reducers/drawer';
import settingsReducer from 'redux/reducers/settings';
import settingsReducer from './redux/reducers/settings';
import thunk from 'redux-thunk';
const globalExceptionHandler = (error, isFatal) => {
if (error && NativeModules.Mixpanel) {
NativeModules.Mixpanel.logException(isFatal, error.message ? error.message : "No message", error);
}
};
setJSExceptionHandler(globalExceptionHandler, true);
function isFunction(object) {
return typeof object === 'function';
}
@@ -82,14 +72,12 @@ const reducers = combineReducers({
blacklist: blacklistReducer,
claims: claimsReducer,
costInfo: costInfoReducer,
drawer: drawerReducer,
fileInfo: fileInfoReducer,
nav: navigatorReducer,
notifications: notificationsReducer,
rewards: rewardsReducer,
settings: settingsReducer,
search: searchReducer,
subscriptions: subscriptionsReducer,
user: userReducer,
wallet: walletReducer
});
@@ -114,7 +102,7 @@ window.store = store;
const compressor = createCompressor();
const authFilter = createFilter('auth', ['authToken']);
const saveClaimsFilter = createFilter('claims', ['byId', 'claimsByUri']);
const subscriptionsFilter = createFilter('subscriptions', ['enabledChannelNotifications', 'subscriptions']);
const subscriptionsFilter = createFilter('subscriptions', ['subscriptions']);
const settingsFilter = createFilter('settings', ['clientSettings']);
const walletFilter = createFilter('wallet', ['receiveAddress']);
+2 -18
View File
@@ -1,22 +1,6 @@
import { connect } from 'react-redux';
import { doToast } from 'lbry-redux';
import { doFetchAccessToken, selectAccessToken, selectUserEmail } from 'lbryinc';
import { doPushDrawerStack, doPopDrawerStack } from 'redux/actions/drawer';
import { selectDrawerStack } from 'redux/selectors/drawer';
import AboutPage from './view';
import Constants from 'constants';
const select = state => ({
accessToken: selectAccessToken(state),
userEmail: selectUserEmail(state),
drawerStack: selectDrawerStack(state),
});
const perform = dispatch => ({});
const perform = dispatch => ({
fetchAccessToken: () => dispatch(doFetchAccessToken()),
notify: data => dispatch(doToast(data)),
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_ABOUT)),
popDrawerStack: () => dispatch(doPopDrawerStack()),
});
export default connect(select, perform)(AboutPage);
export default connect(null, perform)(AboutPage);
+11 -40
View File
@@ -1,10 +1,9 @@
import React from 'react';
import { Lbry } from 'lbry-redux';
import { NativeModules, Text, View, ScrollView } from 'react-native';
import { navigateBack } from 'utils/helper';
import Link from 'component/link';
import PageHeader from 'component/pageHeader';
import aboutStyle from 'styles/about';
import Link from '../../component/link';
import PageHeader from '../../component/pageHeader';
import aboutStyle from '../../styles/about';
class AboutPage extends React.PureComponent {
state = {
@@ -14,7 +13,6 @@ class AboutPage extends React.PureComponent {
};
componentDidMount() {
this.props.pushDrawerStack();
if (NativeModules.VersionInfo) {
NativeModules.VersionInfo.getAppVersion().then(version => {
this.setState({appVersion: version});
@@ -30,19 +28,17 @@ class AboutPage extends React.PureComponent {
lbryId: info.installation_id,
});
});
if (!this.props.accessToken) this.props.fetchAccessToken();
}
render() {
const { accessToken, drawerStack, navigation, notify, popDrawerStack, userEmail } = this.props;
const { navigation } = this.props;
const loading = 'Loading...';
const ver = this.state.versionInfo ? this.state.versionInfo : null;
return (
<View style={aboutStyle.container}>
<PageHeader title={"About LBRY"}
onBackPressed={() => navigateBack(navigation, drawerStack, popDrawerStack)} />
onBackPressed={() => navigation.goBack(navigation.state.key)} />
<ScrollView style={aboutStyle.scrollContainer}>
<Text style={aboutStyle.title}>Content Freedom</Text>
<Text style={aboutStyle.paragraph}>
@@ -53,7 +49,6 @@ class AboutPage extends React.PureComponent {
</Text>
<View style={aboutStyle.links}>
<Link style={aboutStyle.link} href="https://lbry.io/faq/what-is-lbry" text="What is LBRY?" />
<Link style={aboutStyle.link} href="https://lbry.io/faq/android-basics" text="Android App Basics" />
<Link style={aboutStyle.link} href="https://lbry.io/faq" text="Frequently Asked Questions" />
</View>
<Text style={aboutStyle.socialTitle}>Get Social</Text>
@@ -68,21 +63,7 @@ class AboutPage extends React.PureComponent {
<Link style={aboutStyle.link} href="https://reddit.com/r/lbry" text="Reddit" />
<Link style={aboutStyle.link} href="https://t.me/lbryofficial" text="Telegram" />
</View>
<Text style={aboutStyle.releaseInfoTitle}>App info</Text>
{userEmail && userEmail.trim().length > 0 &&
<View style={aboutStyle.verticalRow}>
<View style={aboutStyle.innerRow}>
<View style={aboutStyle.col}><Text style={aboutStyle.text}>Connected Email</Text></View>
<View style={aboutStyle.col}><Text selectable={true} style={aboutStyle.valueText}>{userEmail}</Text></View>
</View>
<View>
<Link
style={aboutStyle.listLink}
href={`http://lbry.io/list/edit/${accessToken}`}
text="Update mailing preferences" />
</View>
</View>}
<Text style={aboutStyle.releaseInfoTitle}>Release information</Text>
<View style={aboutStyle.row}>
<View style={aboutStyle.col}><Text style={aboutStyle.text}>App version</Text></View>
<View style={aboutStyle.col}><Text selectable={true} style={aboutStyle.valueText}>{this.state.appVersion}</Text></View>
@@ -93,6 +74,11 @@ class AboutPage extends React.PureComponent {
<View style={aboutStyle.col}><Text selectable={true} style={aboutStyle.valueText}>{ver ? ver.lbrynet_version : loading }</Text></View>
</View>
<View style={aboutStyle.row}>
<View style={aboutStyle.col}><Text style={aboutStyle.text}>Wallet (lbryum)</Text></View>
<View style={aboutStyle.col}><Text selectable={true} style={aboutStyle.valueText}>{ver ? ver.lbryum_version : loading }</Text></View>
</View>
<View style={aboutStyle.row}>
<View style={aboutStyle.col}><Text style={aboutStyle.text}>Platform</Text></View>
<View style={aboutStyle.col}><Text selectable={true} style={aboutStyle.valueText}>{ver ? ver.platform : loading }</Text></View>
@@ -104,21 +90,6 @@ class AboutPage extends React.PureComponent {
<Text selectable={true} style={aboutStyle.lineValueText}>{this.state.lbryId ? this.state.lbryId : loading}</Text>
</View>
</View>
<View style={aboutStyle.row}>
<View style={aboutStyle.col}><Text style={aboutStyle.text}>Logs</Text></View>
<View style={aboutStyle.col}>
<Link style={aboutStyle.listLink} text="Send log" onPress={() => {
if (NativeModules.UtilityModule) {
NativeModules.UtilityModule.shareLogFile((error) => {
if (error) {
notify(error);
}
});
}
}} />
</View>
</View>
</ScrollView>
</View>
);
+2 -8
View File
@@ -3,26 +3,20 @@ import {
doFetchClaimsByChannel,
doFetchClaimCountByChannel,
makeSelectClaimForUri,
makeSelectClaimsInChannelForCurrentPageState,
makeSelectClaimsInChannelForPage,
makeSelectFetchingChannelClaims,
makeSelectTotalPagesForChannel
} from 'lbry-redux';
import { doPopDrawerStack } from 'redux/actions/drawer';
import { selectDrawerStack } from 'redux/selectors/drawer';
import ChannelPage from './view';
const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state),
claimsInChannel: makeSelectClaimsInChannelForCurrentPageState(props.uri)(state),
drawerStack: selectDrawerStack(state),
claimsInChannel: makeSelectClaimsInChannelForPage(props.uri, props.page || 1)(state),
fetching: makeSelectFetchingChannelClaims(props.uri)(state),
totalPages: makeSelectTotalPagesForChannel(props.uri, 10)(state), // Update to use a default PAGE_SIZE constant
});
const perform = dispatch => ({
fetchClaims: (uri, page) => dispatch(doFetchClaimsByChannel(uri, page)),
fetchClaimCount: uri => dispatch(doFetchClaimCountByChannel(uri)),
popDrawerStack: () => dispatch(doPopDrawerStack())
});
export default connect(select, perform)(ChannelPage);
+9 -56
View File
@@ -1,57 +1,24 @@
// @flow
import React from 'react';
import { ActivityIndicator, Text, View } from 'react-native';
import { navigateBack } from 'utils/helper';
import Colors from 'styles/colors';
import Button from 'component/button';
import FileList from 'component/fileList';
import PageHeader from 'component/pageHeader';
import UriBar from 'component/uriBar';
import channelPageStyle from 'styles/channelPage';
import Colors from '../../styles/colors';
import FileList from '../../component/fileList';
import PageHeader from '../../component/pageHeader';
import UriBar from '../../component/uriBar';
import channelPageStyle from '../../styles/channelPage';
class ChannelPage extends React.PureComponent {
state = {
page: 1
};
componentDidMount() {
const { uri, page, claimsInChannel, fetchClaims, fetchClaimCount } = this.props;
if (!claimsInChannel || !claimsInChannel.length) {
fetchClaims(uri, page || this.state.page);
fetchClaims(uri, page || 1);
fetchClaimCount(uri);
}
}
handlePreviousPage = () => {
const { uri, fetchClaims } = this.props;
if (this.state.page > 1) {
this.setState({ page: this.state.page - 1 }, () => {
fetchClaims(uri, this.state.page);
});
}
}
handleNextPage = () => {
const { uri, fetchClaims, totalPages } = this.props;
if (this.state.page < totalPages) {
this.setState({ page: this.state.page + 1 }, () => {
fetchClaims(uri, this.state.page);
});
}
}
render() {
const {
fetching,
claimsInChannel,
claim,
navigation,
totalPages,
uri,
drawerStack,
popDrawerStack
} = this.props;
const { fetching, claimsInChannel, claim, navigation, uri } = this.props;
const { name, permanent_url: permanentUrl } = claim;
let contentList;
@@ -77,25 +44,11 @@ class ChannelPage extends React.PureComponent {
);
}
return (
<View style={channelPageStyle.container}>
<PageHeader title={name} onBackPressed={() => navigateBack(navigation, drawerStack, popDrawerStack)} />
<PageHeader title={name} onBackPressed={() => navigation.goBack(navigation.state.key)} />
{contentList}
{(totalPages > 1) &&
<View style={channelPageStyle.pageButtons}>
<View>
{(this.state.page > 1) && <Button
style={channelPageStyle.button}
text={"Previous"}
disabled={!!fetching}
onPress={this.handlePreviousPage} />}
</View>
{(this.state.page < totalPages) && <Button
style={[channelPageStyle.button, channelPageStyle.nextButton]}
text={"Next"}
disabled={!!fetching}
onPress={this.handleNextPage} />}
</View>}
<UriBar value={uri} navigation={navigation} />
</View>
)
+2 -14
View File
@@ -3,32 +3,20 @@ import {
doFetchFeaturedUris,
selectBalance,
selectFeaturedUris,
selectFetchingFeaturedUris,
selectFetchingFeaturedUris
} from 'lbry-redux';
import {
doFetchRewardedContent,
doFetchMySubscriptions,
doRemoveUnreadSubscriptions,
selectEnabledChannelNotifications,
selectSubscriptionClaims,
selectUnreadSubscriptions,
} from 'lbryinc';
import { doFetchRewardedContent } from 'lbryinc';
import DiscoverPage from './view';
const select = state => ({
allSubscriptions: selectSubscriptionClaims(state),
balance: selectBalance(state),
enabledChannelNotifications: selectEnabledChannelNotifications(state),
featuredUris: selectFeaturedUris(state),
fetchingFeaturedUris: selectFetchingFeaturedUris(state),
unreadSubscriptions: selectUnreadSubscriptions(state),
});
const perform = dispatch => ({
fetchFeaturedUris: () => dispatch(doFetchFeaturedUris()),
fetchRewardedContent: () => dispatch(doFetchRewardedContent()),
fetchSubscriptions: () => dispatch(doFetchMySubscriptions()),
removeUnreadSubscriptions: () => dispatch(doRemoveUnreadSubscriptions()),
});
export default connect(select, perform)(DiscoverPage);
+2 -59
View File
@@ -8,7 +8,7 @@ import {
Text,
View
} from 'react-native';
import { normalizeURI, parseURI } from 'lbry-redux';
import { normalizeURI } from 'lbry-redux';
import moment from 'moment';
import Colors from '../../styles/colors';
import discoverStyle from '../../styles/discover';
@@ -41,66 +41,9 @@ class DiscoverPage extends React.PureComponent {
}
});
const {
fetchFeaturedUris,
fetchRewardedContent,
fetchSubscriptions
} = this.props;
const { fetchFeaturedUris, fetchRewardedContent } = this.props;
fetchFeaturedUris();
fetchRewardedContent();
fetchSubscriptions();
}
subscriptionForUri = (uri, channelName) => {
const { allSubscriptions } = this.props;
const { claimId, claimName } = parseURI(uri);
if (allSubscriptions) {
for (let i = 0; i < allSubscriptions.length; i++) {
const sub = allSubscriptions[i];
if (sub.claim_id === claimId && sub.name === claimName && sub.channel_name === channelName) {
return sub;
}
}
}
return null;
}
componentDidUpdate(prevProps, prevState) {
const { allSubscriptions, unreadSubscriptions, enabledChannelNotifications } = this.props;
const utility = NativeModules.UtilityModule;
if (utility) {
const hasUnread = prevProps.unreadSubscriptions &&
prevProps.unreadSubscriptions.length !== unreadSubscriptions.length &&
unreadSubscriptions.length > 0;
if (hasUnread) {
unreadSubscriptions.map(({ channel, uris }) => {
const { claimName: channelName } = parseURI(channel);
// check if notifications are enabled for the channel
if (enabledChannelNotifications.indexOf(channelName) > -1) {
uris.forEach(uri => {
const sub = this.subscriptionForUri(uri, channelName);
if (sub && sub.value && sub.value.stream) {
let isPlayable = false;
const source = sub.value.stream.source;
const metadata = sub.value.stream.metadata;
if (source) {
isPlayable = source.contentType && ['audio', 'video'].indexOf(source.contentType.substring(0, 5)) > -1;
}
if (metadata) {
utility.showNotificationForContent(uri, metadata.title, channelName, metadata.thumbnail, isPlayable);
}
}
});
}
});
}
}
}
render() {
-3
View File
@@ -5,8 +5,6 @@ import {
selectMyClaimsWithoutChannels,
selectIsFetchingFileList,
} from 'lbry-redux';
import { doPushDrawerStack } from 'redux/actions/drawer';
import Constants from 'constants';
import DownloadsPage from './view';
const select = (state) => ({
@@ -17,7 +15,6 @@ const select = (state) => ({
const perform = dispatch => ({
fileList: () => dispatch(doFileList()),
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_MY_LBRY))
});
export default connect(select, perform)(DownloadsPage);
+13 -7
View File
@@ -9,7 +9,7 @@ import {
View,
ScrollView
} from 'react-native';
import { navigateToUri, uriFromFileInfo } from '../../utils/helper';
import { navigateToUri } from '../../utils/helper';
import Colors from '../../styles/colors';
import PageHeader from '../../component/pageHeader';
import FileListItem from '../../component/fileListItem';
@@ -25,9 +25,15 @@ class DownloadsPage extends React.PureComponent {
};
componentDidMount() {
const { fileList, pushDrawerStack } = this.props;
pushDrawerStack();
fileList();
this.props.fileList();
}
uriFromFileInfo(fileInfo) {
const { name: claimName, claim_name: claimNameDownloaded, claim_id: claimId } = fileInfo;
const uriParams = {};
uriParams.contentName = claimName || claimNameDownloaded;
uriParams.claimId = claimId;
return buildURI(uriParams);
}
render() {
@@ -53,9 +59,9 @@ class DownloadsPage extends React.PureComponent {
renderItem={ ({item}) => (
<FileListItem
style={fileListStyle.item}
uri={uriFromFileInfo(item)}
uri={this.uriFromFileInfo(item)}
navigation={navigation}
onPress={() => navigateToUri(navigation, uriFromFileInfo(item), { autoplay: true })} />
onPress={() => navigateToUri(navigation, this.uriFromFileInfo(item), { autoplay: true })} />
)
}
data={fileInfos.sort((a, b) => {
@@ -65,7 +71,7 @@ class DownloadsPage extends React.PureComponent {
if (a.metadata.title === b.metadata.title) return 0;
return (a.metadata.title < b.metadata.title) ? -1 : 1;
})}
keyExtractor={(item, index) => item.download_path}
keyExtractor={(item, index) => item.outpoint}
/>
</View>}
<FloatingWalletBalance navigation={navigation} />
+3 -10
View File
@@ -3,26 +3,22 @@ import {
doFetchFileInfo,
doFetchCostInfoForUri,
doResolveUri,
doSendTip,
doToast,
doNotify,
makeSelectIsUriResolving,
makeSelectCostInfoForUri,
makeSelectFileInfoForUri,
makeSelectChannelForClaimUri,
makeSelectClaimForUri,
makeSelectContentTypeForUri,
makeSelectMetadataForUri,
selectBalance,
selectBlackListedOutpoints,
} from 'lbry-redux';
import { selectRewardContentClaimIds } from 'lbryinc';
import { doDeleteFile, doPurchaseUri, doStopDownloadingFile } from 'redux/actions/file';
import { doDeleteFile, doStopDownloadingFile } from '../../redux/actions/file';
import FilePage from './view';
const select = (state, props) => {
const selectProps = { uri: props.navigation.state.params.uri };
return {
balance: selectBalance(state),
blackListedOutpoints: selectBlackListedOutpoints(state),
claim: makeSelectClaimForUri(selectProps.uri)(state),
isResolvingUri: makeSelectIsUriResolving(selectProps.uri)(state),
@@ -33,7 +29,6 @@ const select = (state, props) => {
//tab: makeSelectCurrentParam('tab')(state),
fileInfo: makeSelectFileInfoForUri(selectProps.uri)(state),
rewardedContentClaimIds: selectRewardContentClaimIds(state, selectProps),
channelUri: makeSelectChannelForClaimUri(selectProps.uri, true)(state),
};
};
@@ -43,10 +38,8 @@ const perform = dispatch => ({
},
fetchFileInfo: uri => dispatch(doFetchFileInfo(uri)),
fetchCostInfo: uri => dispatch(doFetchCostInfoForUri(uri)),
notify: data => dispatch(doToast(data)),
purchaseUri: (uri, failureCallback) => dispatch(doPurchaseUri(uri, null, failureCallback)),
notify: data => dispatch(doNotify(data)),
resolveUri: uri => dispatch(doResolveUri(uri)),
sendTip: (amount, claimId, uri, successCallback, errorCallback) => dispatch(doSendTip(amount, claimId, uri, successCallback, errorCallback)),
stopDownload: (uri, fileInfo) => dispatch(doStopDownloadingFile(uri, fileInfo)),
});
+58 -172
View File
@@ -15,44 +15,36 @@ import {
View,
WebView
} from 'react-native';
import { navigateToUri } from 'utils/helper';
import { navigateToUri } from '../../utils/helper';
import ImageViewer from 'react-native-image-zoom-viewer';
import Button from 'component/button';
import Colors from 'styles/colors';
import ChannelPage from 'page/channel';
import DateTime from 'component/dateTime';
import FileDownloadButton from 'component/fileDownloadButton';
import FileItemMedia from 'component/fileItemMedia';
import FilePrice from 'component/filePrice';
import FloatingWalletBalance from 'component/floatingWalletBalance';
import Link from 'component/link';
import MediaPlayer from 'component/mediaPlayer';
import RelatedContent from 'component/relatedContent';
import SubscribeButton from 'component/subscribeButton';
import SubscribeNotificationButton from 'component/subscribeNotificationButton';
import UriBar from 'component/uriBar';
import Button from '../../component/button';
import Colors from '../../styles/colors';
import ChannelPage from '../channel';
import FileDownloadButton from '../../component/fileDownloadButton';
import FileItemMedia from '../../component/fileItemMedia';
import FilePrice from '../../component/filePrice';
import FloatingWalletBalance from '../../component/floatingWalletBalance';
import Link from '../../component/link';
import MediaPlayer from '../../component/mediaPlayer';
import RelatedContent from '../../component/relatedContent';
import UriBar from '../../component/uriBar';
import Video from 'react-native-video';
import filePageStyle from 'styles/filePage';
import uriBarStyle from 'styles/uriBar';
import filePageStyle from '../../styles/filePage';
import uriBarStyle from '../../styles/uriBar';
class FilePage extends React.PureComponent {
static navigationOptions = {
title: ''
};
tipAmountInput = null;
playerBackground = null;
scrollView = null;
startTime = null;
constructor(props) {
super(props);
this.state = {
autoPlayMedia: false,
autoDownloadStarted: false,
downloadButtonShown: false,
downloadPressed: false,
fileViewLogged: false,
@@ -61,15 +53,11 @@ class FilePage extends React.PureComponent {
isLandscape: false,
mediaLoaded: false,
pageSuspended: false,
relatedContentY: 0,
showImageViewer: false,
showWebView: false,
showTipView: false,
playerBgHeight: 0,
playerHeight: 0,
tipAmount: null,
uri: null,
uriVars: null,
stopDownloadConfirmed: false
};
}
@@ -78,8 +66,8 @@ class FilePage extends React.PureComponent {
StatusBar.setHidden(false);
const { isResolvingUri, resolveUri, navigation } = this.props;
const { uri, uriVars } = navigation.state.params;
this.setState({ uri, uriVars });
const { uri } = navigation.state.params;
this.setState({ uri });
if (!isResolvingUri) resolveUri(uri);
@@ -201,6 +189,7 @@ class FilePage extends React.PureComponent {
// after the file_set_status and file_delete operations, so let the user know
notify({
message: 'The download will stop momentarily. You do not need to wait to discover something else.',
displayType: ['toast']
});
}}
],
@@ -307,18 +296,6 @@ class FilePage extends React.PureComponent {
NativeModules.Mixpanel.track('Play', payload);
}
onPlaybackFinished = () => {
if (this.scrollView && this.state.relatedContentY) {
this.scrollView.scrollTo({ x: 0, y: this.state.relatedContentY, animated: true});
}
}
setRelatedContentPosition = (evt) => {
if (!this.state.relatedContentY) {
this.setState({ relatedContentY: evt.nativeEvent.layout.y });
}
}
logFileView = (uri, fileInfo, timeToStart) => {
const { outpoint, claim_id: claimId } = fileInfo;
const params = {
@@ -334,32 +311,9 @@ class FilePage extends React.PureComponent {
this.setState({ fileViewLogged: true });
}
handleSendTip = () => {
const { claim, balance, navigation, notify, sendTip } = this.props;
const { uri } = navigation.state.params;
const { tipAmount } = this.state;
if (tipAmount > balance) {
notify({
message: 'Insufficient credits',
});
return;
}
sendTip(tipAmount, claim.claim_id, uri, () => { this.setState({ tipAmount: 0, showTipView: false }) });
}
startDownloadFailed = () => {
this.startTime = null;
setTimeout(() => {
this.setState({ downloadPressed: false, fileViewLogged: false, mediaLoaded: false });
}, 500);
}
render() {
const {
claim,
channelUri,
fileInfo,
metadata,
contentType,
@@ -367,8 +321,7 @@ class FilePage extends React.PureComponent {
rewardedContentClaimIds,
isResolvingUri,
blackListedOutpoints,
navigation,
purchaseUri
navigation
} = this.props;
const { uri, autoplay } = navigation.state.params;
@@ -426,11 +379,12 @@ class FilePage extends React.PureComponent {
const mediaType = Lbry.getMediaType(contentType);
const isPlayable = mediaType === 'video' || mediaType === 'audio';
const { height, channel_name: channelName, value } = claim;
const showActions = !this.state.fullscreenMode && !this.state.showImageViewer && !this.state.showWebView;
const showFileActions = (completed || (fileInfo && !fileInfo.stopped && fileInfo.written_bytes < fileInfo.total_bytes));
const showActions = !this.state.fullscreenMode &&
!this.state.showImageViewer &&
!this.state.showWebView &&
(completed || (fileInfo && !fileInfo.stopped && fileInfo.written_bytes < fileInfo.total_bytes));
const channelClaimId =
value && value.publisherSignature && value.publisherSignature.certificateId;
const canSendTip = this.state.tipAmount > 0;
const playerStyle = [filePageStyle.player,
this.state.isLandscape ? filePageStyle.containedPlayerLandscape :
@@ -440,44 +394,28 @@ class FilePage extends React.PureComponent {
// at least 2MB (or the full download) before media can be loaded
const canLoadMedia = fileInfo &&
(fileInfo.written_bytes >= 2097152 || fileInfo.written_bytes == fileInfo.total_bytes); // 2MB = 1024*1024*2
const isViewable = (mediaType === 'image' || mediaType === 'text');
const canOpen = (mediaType === 'image' || mediaType === 'text') && completed;
const isWebViewable = mediaType === 'text';
const canOpen = isViewable && completed;
const localFileUri = this.localUriForFileInfo(fileInfo);
const openFile = () => {
if (mediaType === 'image') {
// use image viewer
if (!this.state.showImageViewer) {
this.setState({
imageUrls: [{
url: localFileUri
}],
showImageViewer: true
});
}
this.setState({
imageUrls: [{
url: localFileUri
}],
showImageViewer: true
});
}
if (isWebViewable) {
// show webview
if (!this.state.showWebView) {
this.setState({
showWebView: true
});
}
this.setState({
showWebView: true
});
}
}
if (fileInfo && !this.state.autoDownloadStarted && this.state.uriVars && 'true' === this.state.uriVars.download) {
this.setState({ autoDownloadStarted: true }, () => {
purchaseUri(uri, this.startDownloadFailed);
});
}
if (this.state.downloadPressed && canOpen) {
// automatically open a web viewable or image file after the download button is pressed
openFile();
}
innerContent = (
<View style={filePageStyle.pageContainer}>
{this.state.showWebView && isWebViewable && <WebView source={{ uri: localFileUri }}
@@ -500,14 +438,17 @@ class FilePage extends React.PureComponent {
style={filePageStyle.downloadButton}
openFile={openFile}
isPlayable={isPlayable}
isViewable={isViewable}
onPlay={() => {
this.startTime = Date.now();
this.setState({ downloadPressed: true, autoPlayMedia: true, stopDownloadConfirmed: false });
}}
onView={() => this.setState({ downloadPressed: true })}
onButtonLayout={() => this.setState({ downloadButtonShown: true })}
onStartDownloadFailed={this.startDownloadFailed} />}
onStartDownloadFailed={() => {
this.startTime = null;
setTimeout(() => {
this.setState({ downloadPressed: false, fileViewLogged: false, mediaLoaded: false });
}, 500);
}} />}
{!fileInfo && <FilePrice uri={uri} style={filePageStyle.filePriceContainer} textStyle={filePageStyle.filePriceText} />}
</View>
{canLoadMedia && fileInfo && <View style={playerBgStyle}
@@ -531,97 +472,42 @@ class FilePage extends React.PureComponent {
}}
onMediaLoaded={() => this.onMediaLoaded(channelName, title, uri)}
onPlaybackStarted={this.onPlaybackStarted}
onPlaybackFinished={this.onPlaybackFinished}
thumbnail={metadata.thumbnail}
/>}
{showActions &&
{fileInfo && showActions &&
<View style={filePageStyle.actions}>
<View style={filePageStyle.socialActions}>
{completed && <Button style={filePageStyle.actionButton}
theme={"light"}
icon={"trash"}
text={"Delete"}
onPress={this.onDeletePressed} />}
{!completed && fileInfo && !fileInfo.stopped &&
fileInfo.written_bytes < fileInfo.total_bytes &&
!this.state.stopDownloadConfirmed &&
<Button style={filePageStyle.actionButton}
theme={"light"}
icon={"gift"}
text={"Send a tip"}
onPress={() => this.setState({ showTipView: true })} />
</View>
{showFileActions &&
<View style={filePageStyle.fileActions}>
{completed && <Button style={filePageStyle.actionButton}
theme={"light"}
icon={"trash"}
text={"Delete"}
onPress={this.onDeletePressed} />}
{!completed && fileInfo && !fileInfo.stopped &&
fileInfo.written_bytes < fileInfo.total_bytes &&
!this.state.stopDownloadConfirmed &&
<Button style={filePageStyle.actionButton}
theme={"light"}
text={"Stop Download"}
onPress={this.onStopDownloadPressed} />
}
</View>}
text={"Stop Download"}
onPress={this.onStopDownloadPressed} />
}
</View>}
<ScrollView
style={showActions ? filePageStyle.scrollContainerActions : filePageStyle.scrollContainer}
contentContainerstyle={showActions ? null : filePageStyle.scrollContent}
ref={(ref) => { this.scrollView = ref; }}>
contentContainerstyle={showActions ? null : filePageStyle.scrollContent}>
<Text style={filePageStyle.title} selectable={true}>{title}</Text>
{channelName &&
<View style={filePageStyle.channelRow}>
<View style={filePageStyle.publishInfo}>
<Link style={filePageStyle.channelName}
selectable={true}
text={channelName}
numberOfLines={1}
ellipsizeMode={"tail"}
onPress={() => {
const channelUri = normalizeURI(channelName);
navigateToUri(navigation, channelUri);
}} />
<DateTime
style={filePageStyle.publishDate}
textStyle={filePageStyle.publishDateText}
block={height}
formatOptions={{ day: 'numeric', month: 'long', year: 'numeric' }}
show={DateTime.SHOW_DATE} />
</View>
<View style={filePageStyle.subscriptionRow}>
<SubscribeButton
style={filePageStyle.actionButton}
uri={channelUri}
name={channelName} />
<SubscribeNotificationButton
style={[filePageStyle.actionButton, filePageStyle.bellButton]}
uri={channelUri}
name={channelName} />
</View>
</View>
}
{channelName && <Link style={filePageStyle.channelName}
selectable={true}
text={channelName}
onPress={() => {
const channelUri = normalizeURI(channelName);
navigateToUri(navigation, channelUri);
}} />}
{description && description.length > 0 && <View style={filePageStyle.divider} />}
{description && <Text style={filePageStyle.description} selectable={true}>{this.linkify(description)}</Text>}
<View onLayout={this.setRelatedContentPosition} />
<RelatedContent navigation={navigation} uri={uri} />
</ScrollView>
{this.state.showTipView && <View style={filePageStyle.tipCard}>
<View style={filePageStyle.row}>
<View style={filePageStyle.amountRow}>
<TextInput ref={ref => this.tipAmountInput = ref}
onChangeText={value => this.setState({tipAmount: value})}
keyboardType={'numeric'}
value={this.state.tipAmount}
style={[filePageStyle.input, filePageStyle.tipAmountInput]} />
<Text style={[filePageStyle.text, filePageStyle.currency]}>LBC</Text>
</View>
<Link style={[filePageStyle.link, filePageStyle.cancelTipLink]} text={'Cancel'} onPress={() => this.setState({ showTipView: false })} />
<Button text={'Send tip'}
style={[filePageStyle.button, filePageStyle.sendButton]}
disabled={!canSendTip}
onPress={this.handleSendTip} />
</View>
</View>}
</View>
)}
{!this.state.fullscreenMode && <FloatingWalletBalance navigation={navigation} />}
+3 -3
View File
@@ -1,5 +1,5 @@
import { connect } from 'react-redux';
import { doToast } from 'lbry-redux';
import { doNotify } from 'lbry-redux';
import {
doGenerateAuthToken,
doUserEmailNew,
@@ -22,7 +22,7 @@ const select = (state) => ({
const perform = dispatch => ({
addUserEmail: email => dispatch(doUserEmailNew(email)),
generateAuthToken: installationId => dispatch(doGenerateAuthToken(installationId)),
notify: data => dispatch(doToast(data))
notify: data => dispatch(doNotify(data))
});
export default connect(select, perform)(FirstRun);
export default connect(select, perform)(FirstRun);
@@ -13,7 +13,7 @@ import Constants from '../../../constants';
import firstRunStyle from '../../../styles/firstRun';
class EmailCollectPage extends React.PureComponent {
static MAX_STATUS_TRIES = 30;
static MAX_STATUS_TRIES = 15;
state = {
email: null,
@@ -57,7 +57,7 @@ class EmailCollectPage extends React.PureComponent {
setTimeout(() => {
this.startAuthenticating();
this.setState({ statusTries: this.state.statusTries + 1 });
}, 1000); // Retry every second for a maximum of MAX_STATUS_TRIES tries (30 seconds)
}, 1000); // Retry every second for a maximum of MAX_STATUS_TRIES tries (15 seconds)
}
});
}
+3 -9
View File
@@ -61,7 +61,7 @@ class FirstRunScreen extends React.PureComponent {
if (this.state.emailSubmitted && !emailNewPending) {
this.setState({ emailSubmitted: false });
if (emailNewErrorMessage) {
notify ({ message: String(emailNewErrorMessage), isError: true });
notify ({ message: String(emailNewErrorMessage), displayType: ['toast']});
} else {
// Request successful. Navigate to discover.
this.closeFinalPage();
@@ -115,6 +115,7 @@ class FirstRunScreen extends React.PureComponent {
if (email.indexOf('@') === -1) {
return notify({
message: 'Please provide a valid email address to continue.',
displayType: ['toast'],
});
}
@@ -151,13 +152,6 @@ class FirstRunScreen extends React.PureComponent {
}
}
onEmailViewLayout = () => {
this.setState({ showBottomContainer: true });
AsyncStorage.getItem('firstRunEmail').then(email => {
this.setState({ showSkip: !email || email.trim().length === 0 });
});
}
render() {
const {
authenticating,
@@ -177,7 +171,7 @@ class FirstRunScreen extends React.PureComponent {
authToken={authToken}
generateAuthToken={generateAuthToken}
onEmailChanged={this.onEmailChanged}
onEmailViewLayout={this.onEmailViewLayout} />);
onEmailViewLayout={() => this.setState({ showBottomContainer: true, showSkip: true })} />);
}
return (
+3 -6
View File
@@ -8,9 +8,7 @@ import {
selectClaimedRewards,
selectUser,
} from 'lbryinc';
import { doToast } from 'lbry-redux';
import { doPushDrawerStack } from 'redux/actions/drawer';
import Constants from 'constants';
import { doNotify } from 'lbry-redux';
import RewardsPage from './view';
const select = state => ({
@@ -24,8 +22,7 @@ const select = state => ({
const perform = dispatch => ({
fetchRewards: () => dispatch(doRewardList()),
notify: data => dispatch(doToast(data)),
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_REWARDS))
notify: data => dispatch(doNotify(data)),
});
export default connect(select, perform)(RewardsPage);
export default connect(select, perform)(RewardsPage);
+18 -17
View File
@@ -9,7 +9,6 @@ import {
} from 'react-native';
import Colors from '../../styles/colors';
import Link from '../../component/link';
import CustomRewardCard from '../../component/customRewardCard';
import PhoneNumberRewardSubcard from '../../component/phoneNumberRewardSubcard';
import EmailRewardSubcard from '../../component/emailRewardSubcard';
import PageHeader from '../../component/pageHeader';
@@ -25,11 +24,9 @@ class RewardsPage extends React.PureComponent {
};
componentDidMount() {
const { fetchRewards, pushDrawerStack, navigation, user } = this.props;
pushDrawerStack();
fetchRewards();
this.props.fetchRewards();
const { user } = this.props;
this.setState({
isEmailVerified: (user && user.primary_email && user.has_verified_email),
isIdentityVerified: (user && user.is_identity_verified),
@@ -92,7 +89,6 @@ class RewardsPage extends React.PureComponent {
renderUnclaimedRewards() {
const { claimed, fetching, rewards, user } = this.props;
const unclaimedRewards = (rewards && rewards.length) ? rewards : [];
if (fetching) {
return (
@@ -107,16 +103,25 @@ class RewardsPage extends React.PureComponent {
<Text style={rewardStyle.infoText}>This app is unable to earn rewards due to an authentication failure.</Text>
</View>
);
} else if (!rewards || rewards.length <= 0) {
return (
<View style={rewardStyle.busyContainer}>
<Text style={rewardStyle.infoText}>
{(claimed && claimed.length) ?
"You have claimed all available rewards! We're regularly adding more so be sure to check back later." :
"There are no rewards available at this time, please check back later."}
</Text>
</View>
);
}
const isNotEligible = !user || !user.primary_email || !user.has_verified_email || !user.is_reward_approved;
return (
<View>
{unclaimedRewards.map(reward => <RewardCard key={reward.reward_type}
canClaim={!isNotEligible}
reward={reward}
reward_type={reward.reward_type} />)}
<CustomRewardCard canClaim={!isNotEligible} />
{rewards.map(reward => <RewardCard key={reward.reward_type}
canClaim={!isNotEligible}
reward={reward}
reward_type={reward.reward_type} />)}
</View>
);
}
@@ -124,10 +129,9 @@ class RewardsPage extends React.PureComponent {
renderClaimedRewards() {
const { claimed } = this.props;
if (claimed && claimed.length) {
const reversed = claimed.reverse();
return (
<View>
{reversed.map(reward => <RewardCard key={reward.transaction_id} reward={reward} />)}
{claimed.map(reward => <RewardCard key={reward.reward_type} reward={reward} />)}
</View>
);
}
@@ -138,10 +142,7 @@ class RewardsPage extends React.PureComponent {
return (
<View style={rewardStyle.container}>
<ScrollView
keyboardShouldPersistTaps={'handled'}
style={rewardStyle.scrollContainer}
contentContainerStyle={rewardStyle.scrollContentContainer}>
<ScrollView style={rewardStyle.scrollContainer} contentContainerStyle={rewardStyle.scrollContentContainer}>
{this.renderVerification()}
{this.renderUnclaimedRewards()}
{this.renderClaimedRewards()}
+2 -8
View File
@@ -1,22 +1,16 @@
import { connect } from 'react-redux';
import { SETTINGS } from 'lbry-redux';
import { doPushDrawerStack, doPopDrawerStack } from 'redux/actions/drawer';
import { doSetClientSetting } from 'redux/actions/settings';
import { selectDrawerStack } from 'redux/selectors/drawer';
import { makeSelectClientSetting } from 'redux/selectors/settings';
import Constants from 'constants';
import { doSetClientSetting } from '../../redux/actions/settings';
import { makeSelectClientSetting } from '../../redux/selectors/settings';
import SettingsPage from './view';
const select = state => ({
backgroundPlayEnabled: makeSelectClientSetting(SETTINGS.BACKGROUND_PLAY_ENABLED)(state),
drawerStack: selectDrawerStack(state),
keepDaemonRunning: makeSelectClientSetting(SETTINGS.KEEP_DAEMON_RUNNING)(state),
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_NSFW)(state),
});
const perform = dispatch => ({
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_SETTINGS)),
popDrawerStack: () => dispatch(doPopDrawerStack()),
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
});
+3 -10
View File
@@ -1,26 +1,19 @@
import React from 'react';
import { SETTINGS } from 'lbry-redux';
import { Text, View, ScrollView, Switch, NativeModules } from 'react-native';
import { navigateBack } from 'utils/helper';
import PageHeader from 'component/pageHeader';
import settingsStyle from 'styles/settings';
import PageHeader from '../../component/pageHeader';
import settingsStyle from '../../styles/settings';
class SettingsPage extends React.PureComponent {
static navigationOptions = {
title: 'Settings'
}
componentDidMount() {
this.props.pushDrawerStack();
}
render() {
const {
backgroundPlayEnabled,
drawerStack,
keepDaemonRunning,
navigation,
popDrawerStack,
showNsfw,
setClientSetting
} = this.props;
@@ -31,7 +24,7 @@ class SettingsPage extends React.PureComponent {
return (
<View>
<PageHeader title={"Settings"}
onBackPressed={() => navigateBack(navigation, drawerStack, popDrawerStack)} />
onBackPressed={() => navigation.goBack(navigation.state.key)} />
<ScrollView style={settingsStyle.scrollContainer}>
<View style={settingsStyle.row}>
<View style={settingsStyle.switchText}>
+4 -9
View File
@@ -1,9 +1,7 @@
import { connect } from 'react-redux';
import { doBalanceSubscribe, doBlackListedOutpointsSubscribe, doUpdateBlockHeight, doToast } from 'lbry-redux';
import { doBalanceSubscribe, doBlackListedOutpointsSubscribe, doNotify } from 'lbry-redux';
import {
doAuthenticate,
doCheckSubscriptionsInit,
doFetchMySubscriptions,
doFetchRewardedContent,
doUserEmailToVerify,
doUserEmailVerify,
@@ -11,7 +9,7 @@ import {
selectUser,
selectEmailToVerify
} from 'lbryinc';
import { doDeleteCompleteBlobs } from 'redux/actions/file';
import { doDeleteCompleteBlobs } from '../../redux/actions/file';
import SplashScreen from './view';
const select = state => ({
@@ -23,15 +21,12 @@ const perform = dispatch => ({
authenticate: (appVersion, os) => dispatch(doAuthenticate(appVersion, os)),
balanceSubscribe: () => dispatch(doBalanceSubscribe()),
blacklistedOutpointsSubscribe: () => dispatch(doBlackListedOutpointsSubscribe()),
checkSubscriptionsInit: () => dispatch(doCheckSubscriptionsInit()),
deleteCompleteBlobs: () => dispatch(doDeleteCompleteBlobs()),
fetchRewardedContent: () => dispatch(doFetchRewardedContent()),
fetchSubscriptions: (callback) => dispatch(doFetchMySubscriptions(callback)),
notify: data => dispatch(doToast(data)),
notify: data => dispatch(doNotify(data)),
setEmailToVerify: email => dispatch(doUserEmailToVerify(email)),
updateBlockHeight: () => dispatch(doUpdateBlockHeight()),
verifyUserEmail: (token, recaptcha) => dispatch(doUserEmailVerify(token, recaptcha)),
verifyUserEmailFailure: error => dispatch(doUserEmailVerifyFailure(error))
verifyUserEmailFailure: error => dispatch(doUserEmailVerifyFailure(error)),
});
export default connect(select, perform)(SplashScreen);
+4 -12
View File
@@ -18,8 +18,6 @@ import Colors from '../../styles/colors';
import Constants from '../../constants';
import splashStyle from '../../styles/splash';
const BLOCK_HEIGHT_INTERVAL = 1000 * 60 * 2.5; // every 2.5 minutes
class SplashScreen extends React.PureComponent {
static navigationOptions = {
title: 'Splash'
@@ -35,8 +33,7 @@ class SplashScreen extends React.PureComponent {
launchUrl: null,
isDownloadingHeaders: false,
headersDownloadProgress: 0,
shouldAuthenticate: false,
subscriptionsFetched: false
shouldAuthenticate: false
});
if (NativeModules.DaemonServiceControl) {
@@ -105,11 +102,12 @@ class SplashScreen extends React.PureComponent {
} catch (error) {
const message = 'Invalid Verification Token';
verifyUserEmailFailure(message);
notify({ message });
notify({ message, displayType: ['toast'] });
}
} else {
notify({
message: 'Invalid Verification URI',
displayType: ['toast'],
});
}
} else {
@@ -122,7 +120,7 @@ class SplashScreen extends React.PureComponent {
}
_updateStatusCallback(status) {
const { deleteCompleteBlobs, fetchSubscriptions } = this.props;
const { deleteCompleteBlobs } = this.props;
const startupStatus = status.startup_status;
// At the minimum, wallet should be started and blocks_behind equal to 0 before calling resolve
const hasStarted = startupStatus.file_manager && startupStatus.wallet && status.wallet.blocks_behind <= 0;
@@ -141,24 +139,18 @@ class SplashScreen extends React.PureComponent {
isRunning: true,
});
// fetch subscriptions, so that we can check for new content after resolve
Lbry.resolve({ uri: 'lbry://one' }).then(() => {
// Leave the splash screen
const {
authenticate,
balanceSubscribe,
blacklistedOutpointsSubscribe,
checkSubscriptionsInit,
updateBlockHeight,
navigation,
notify
} = this.props;
balanceSubscribe();
blacklistedOutpointsSubscribe();
checkSubscriptionsInit();
updateBlockHeight();
setInterval(() => { updateBlockHeight(); }, BLOCK_HEIGHT_INTERVAL);
NativeModules.VersionInfo.getAppVersion().then(appVersion => {
this.setState({ shouldAuthenticate: true });
authenticate(appVersion, Platform.OS);
-42
View File
@@ -1,42 +0,0 @@
import { connect } from 'react-redux';
import {
doFetchMySubscriptions,
doSetViewMode,
doFetchRecommendedSubscriptions,
doCompleteFirstRun,
doShowSuggestedSubs,
selectSubscriptionClaims,
selectSubscriptions,
selectSubscriptionsBeingFetched,
selectIsFetchingSubscriptions,
selectUnreadSubscriptions,
selectViewMode,
selectFirstRunCompleted,
selectShowSuggestedSubs
} from 'lbryinc';
import { doPushDrawerStack } from 'redux/actions/drawer';
import Constants from 'constants';
import SubscriptionsPage from './view';
const select = state => ({
loading:
selectIsFetchingSubscriptions(state) ||
Boolean(Object.keys(selectSubscriptionsBeingFetched(state)).length),
subscribedChannels: selectSubscriptions(state),
allSubscriptions: selectSubscriptionClaims(state),
unreadSubscriptions: selectUnreadSubscriptions(state),
viewMode: selectViewMode(state),
firstRunCompleted: selectFirstRunCompleted(state),
showSuggestedSubs: selectShowSuggestedSubs(state),
});
const perform = dispatch => ({
doFetchMySubscriptions,
doSetViewMode,
doFetchRecommendedSubscriptions,
doCompleteFirstRun,
doShowSuggestedSubs,
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_SUBSCRIPTIONS))
});
export default connect(select, perform)(SubscriptionsPage);
-93
View File
@@ -1,93 +0,0 @@
import React from 'react';
import NavigationActions from 'react-navigation';
import {
ActivityIndicator,
AsyncStorage,
FlatList,
NativeModules,
SectionList,
Text,
View
} from 'react-native';
import { buildURI } from 'lbry-redux';
import { uriFromFileInfo } from 'utils/helper';
import moment from 'moment';
import Colors from 'styles/colors';
import discoverStyle from 'styles/discover';
import subscriptionsStyle from 'styles/subscriptions';
import FloatingWalletBalance from 'component/floatingWalletBalance';
import FileItem from 'component/fileItem';
import UriBar from 'component/uriBar';
class SubscriptionsPage extends React.PureComponent {
componentDidMount() {
const {
doFetchMySubscriptions,
doFetchRecommendedSubscriptions,
pushDrawerStack,
} = this.props;
pushDrawerStack();
doFetchMySubscriptions();
//doFetchRecommendedSubscriptions();
}
render() {
const {
subscribedChannels,
allSubscriptions,
loading,
viewMode,
doSetViewMode,
loadingSuggested,
firstRunCompleted,
doCompleteFirstRun,
doShowSuggestedSubs,
showSuggestedSubs,
unreadSubscriptions,
navigation
} = this.props;
const numberOfSubscriptions = subscribedChannels ? subscribedChannels.length : 0;
const hasSubscriptions = numberOfSubscriptions > 0;
return (
<View style={subscriptionsStyle.container}>
{hasSubscriptions && !loading &&
<FlatList
style={subscriptionsStyle.scrollContainer}
contentContainerStyle={subscriptionsStyle.scrollPadding}
renderItem={ ({item}) => (
<FileItem
style={subscriptionsStyle.fileItem}
mediaStyle={discoverStyle.fileItemMedia}
key={item}
uri={uriFromFileInfo(item)}
navigation={navigation} />
)
}
data={allSubscriptions.sort((a, b) => {
return b.height - a.height;
})}
keyExtractor={(item, index) => uriFromFileInfo(item)} />}
{hasSubscriptions && loading &&
<View style={subscriptionsStyle.busyContainer}>
<ActivityIndicator size="large" color={Colors.LbryGreen} style={subscriptionsStyle.loading} />
</View>
}
{!hasSubscriptions &&
<View style={subscriptionsStyle.busyContainer}>
<Text style={subscriptionsStyle.infoText}>
You are not subscribed to any channels. Feel free to discover new channels that you can subscribe to.
</Text>
</View>}
<FloatingWalletBalance navigation={navigation} />
<UriBar navigation={navigation} />
</View>
)
}
}
export default SubscriptionsPage;
-3
View File
@@ -1,7 +1,5 @@
import { connect } from 'react-redux';
import { doFetchTrendingUris, selectTrendingUris, selectFetchingTrendingUris } from 'lbry-redux';
import { doPushDrawerStack } from 'redux/actions/drawer';
import Constants from 'constants';
import TrendingPage from './view';
const select = state => ({
@@ -11,7 +9,6 @@ const select = state => ({
const perform = dispatch => ({
fetchTrendingUris: () => dispatch(doFetchTrendingUris()),
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_TRENDING))
});
export default connect(select, perform)(TrendingPage);
+1 -3
View File
@@ -18,9 +18,7 @@ import UriBar from '../../component/uriBar';
class TrendingPage extends React.PureComponent {
componentDidMount() {
const { fetchTrendingUris, pushDrawerStack } = this.props;
pushDrawerStack();
fetchTrendingUris();
this.props.fetchTrendingUris();
}
render() {
+3 -5
View File
@@ -1,8 +1,7 @@
import { connect } from 'react-redux';
import { doSetClientSetting } from 'redux/actions/settings';
import { makeSelectClientSetting } from 'redux/selectors/settings';
import { doPushDrawerStack } from 'redux/actions/drawer';
import Constants from 'constants';
import { doSetClientSetting } from '../../redux/actions/settings';
import { makeSelectClientSetting } from '../../redux/selectors/settings';
import Constants from '../../constants';
import WalletPage from './view';
const select = state => ({
@@ -11,7 +10,6 @@ const select = state => ({
const perform = dispatch => ({
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_WALLET))
});
export default connect(select, perform)(WalletPage);
+8 -19
View File
@@ -1,19 +1,14 @@
import React from 'react';
import { ScrollView, Text, View } from 'react-native';
import TransactionListRecent from 'component/transactionListRecent';
import WalletAddress from 'component/walletAddress';
import WalletBalance from 'component/walletBalance';
import WalletSend from 'component/walletSend';
import Button from 'component/button';
import Link from 'component/link'
import Constants from 'constants';
import walletStyle from 'styles/wallet';
import TransactionListRecent from '../../component/transactionListRecent';
import WalletAddress from '../../component/walletAddress';
import WalletBalance from '../../component/walletBalance';
import WalletSend from '../../component/walletSend';
import Button from '../../component/button';
import Constants from '../../constants';
import walletStyle from '../../styles/wallet';
class WalletPage extends React.PureComponent {
componentDidMount() {
this.props.pushDrawerStack();
}
render() {
const { understandsRisks, setClientSetting } = this.props;
@@ -32,13 +27,7 @@ class WalletPage extends React.PureComponent {
}
return (
<ScrollView keyboardShouldPersistTaps={'handled'}>
<View style={walletStyle.warningCard}>
<Text style={walletStyle.warningText}>
Please backup your wallet file using the instructions at <Link style={walletStyle.warningText} text="https://lbry.io/faq/how-to-backup-wallet#android" href="https://lbry.io/faq/how-to-backup-wallet#android" />.
</Text>
</View>
<ScrollView>
<WalletBalance />
<WalletAddress />
<WalletSend />
-10
View File
@@ -1,10 +0,0 @@
import Constants from 'constants';
export const doPushDrawerStack = (routeName) => (dispatch) => dispatch({
type: Constants.ACTION_PUSH_DRAWER_STACK,
data: routeName
});
export const doPopDrawerStack = () => (dispatch) => dispatch({
type: Constants.ACTION_POP_DRAWER_STACK
});
+8 -11
View File
@@ -1,7 +1,7 @@
import {
ACTIONS,
Lbry,
doToast,
doNotify,
formatCredits,
selectBalance,
makeSelectCostInfoForUri,
@@ -25,17 +25,11 @@ const deleteBlobsForSdHash = (sdHash) => {
export function doUpdateLoadStatus(uri, outpoint) {
return (dispatch, getState) => {
const state = getState();
Lbry.file_list({
outpoint,
full_status: true,
}).then(([fileInfo]) => {
if (!fileInfo || fileInfo.written_bytes === 0) {
// if the outpoint isn't in the state, then it was probably canceled, so stop checking the load status
const { downloadingByOutpoint = {} } = state.fileInfo;
if (!downloadingByOutpoint[outpoint]) return;
// download hasn't started yet
setTimeout(() => {
dispatch(doUpdateLoadStatus(uri, outpoint));
@@ -139,7 +133,7 @@ export function doStopDownloadingFile(uri, fileInfo) {
Lbry.file_set_status(params).then(() => {
dispatch({
type: ACTIONS.DOWNLOADING_CANCELED,
data: { uri, outpoint: fileInfo.outpoint }
data: {}
});
// Should also delete the file after the user stops downloading
@@ -190,8 +184,9 @@ export function doLoadVideo(uri, failureCallback) {
data: { uri },
});
dispatch(doToast({
dispatch(doNotify({
message: `File timeout for uri ${uri}`,
displayType: ['toast']
}));
if (failureCallback) {
@@ -208,8 +203,9 @@ export function doLoadVideo(uri, failureCallback) {
data: { uri },
});
dispatch(doToast({
dispatch(doNotify({
message: `Failed to download ${uri}, please try again. If this problem persists, visit https://lbry.io/faq/support for support.`,
displayType: ['toast']
}));
if (failureCallback) {
@@ -268,8 +264,9 @@ export function doPurchaseUri(uri, specificCostInfo, failureCallback) {
if (cost > balance) {
dispatch(doSetPlayingUri(null));
dispatch(doToast({
dispatch(doNotify({
message: 'Insufficient credits',
displayType: ['toast']
}));
if (failureCallback) {
failureCallback();
-36
View File
@@ -1,36 +0,0 @@
import Constants from 'constants';
const reducers = {};
const defaultState = {
stack: [ Constants.DRAWER_ROUTE_DISCOVER ] // Discover is always the first drawer route
};
reducers[Constants.ACTION_PUSH_DRAWER_STACK] = (state, action) => {
const routeName = action.data;
const newStack = state.stack.slice();
if (routeName !== newStack[newStack.length -1]) {
newStack.push(routeName);
}
return {
...state,
stack: newStack
};
};
reducers[Constants.ACTION_POP_DRAWER_STACK] = (state, action) => {
// We don't want to pop the Discover route, since it's always expected to be the first
const newStack = (state.stack.length === 1) ? state.stack.slice() : state.stack.slice(0, state.stack.length - 1);
return {
...state,
stack: newStack
}
};
export default function reducer(state = defaultState, action) {
const handler = reducers[action.type];
if (handler) return handler(state, action);
return state;
}
-13
View File
@@ -1,13 +0,0 @@
import { createSelector } from 'reselect';
export const selectState = state => state.drawer || {};
export const selectDrawerStack = createSelector(selectState, (state) => state.stack);
export const selectLastDrawerRoute = createSelector(selectState, (state) => {
if (state.stack.length) {
return state.stack[state.stack.length - 1];
}
return null;
});
+8 -26
View File
@@ -16,29 +16,17 @@ const aboutStyle = StyleSheet.create({
flexDirection: 'row',
justifyContent: 'space-between'
},
innerRow: {
marginBottom: 4,
flex: 1,
flexDirection: 'row',
justifyContent: 'space-between'
},
verticalRow: {
marginBottom: 1,
backgroundColor: '#f9f9f9',
padding: 16,
flex: 1
},
title: {
color: Colors.LbryGreen,
fontSize: 24,
fontFamily: 'Inter-UI-SemiBold',
fontFamily: 'Metropolis-SemiBold',
marginTop: 16,
marginLeft: 12,
marginRight: 12,
marginBottom: 8
},
paragraph: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 16,
lineHeight: 24,
marginLeft: 12,
@@ -52,44 +40,38 @@ const aboutStyle = StyleSheet.create({
},
link: {
color: Colors.LbryGreen,
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 16,
marginBottom: 24
},
listLink: {
color: Colors.LbryGreen,
fontFamily: 'Inter-UI-Regular',
fontSize: 15,
alignSelf: 'flex-end'
},
col: {
alignSelf: 'stretch'
},
socialTitle: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
marginLeft: 12,
marginRight: 12,
marginBottom: 8,
fontSize: 20
},
releaseInfoTitle: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
marginLeft: 12,
marginRight: 12,
marginBottom: 12,
fontSize: 20
},
text: {
fontFamily: 'Inter-UI-SemiBold',
fontFamily: 'Metropolis-SemiBold',
fontSize: 15
},
valueText: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
textAlign: 'right',
fontSize: 15
},
lineValueText: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 15
}
});
+1 -1
View File
@@ -29,7 +29,7 @@ const buttonStyle = StyleSheet.create({
color: Colors.DarkGrey
},
text: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 14
},
textWithIcon: {
+3 -18
View File
@@ -12,11 +12,11 @@ const channelPageStyle = StyleSheet.create({
fileList: {
paddingTop: 30,
flex: 1,
marginBottom: 16
marginBottom: 60
},
title: {
color: Colors.LbryGreen,
fontFamily: 'Inter-UI-SemiBold',
fontFamily: 'Metropolis-SemiBold',
fontSize: 30,
margin: 16
},
@@ -27,25 +27,10 @@ const channelPageStyle = StyleSheet.create({
flexDirection: 'row'
},
infoText: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 20,
textAlign: 'center',
marginLeft: 10
},
pageButtons: {
flexDirection: 'row',
justifyContent: 'space-between',
paddingLeft: 16,
paddingRight: 16,
marginBottom: 76
},
button: {
backgroundColor: Colors.LbryGreen,
paddingLeft: 16,
paddingRight: 16
},
nextButton: {
alignSelf: 'flex-end'
}
});
+1 -1
View File
@@ -3,7 +3,7 @@ const Colors = {
ChannelGrey: '#9b9b9b',
DarkGrey: '#555555',
DescriptionGrey: '#999999',
LbryGreen: '#2f9176',
LbryGreen: '#40b89a',
BrighterLbryGreen: '#40b887',
LightGrey: '#cccccc',
LighterGrey: '#e5e5e5',
+7 -26
View File
@@ -33,13 +33,13 @@ const discoverStyle = StyleSheet.create({
flexDirection: 'row'
},
title: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 20,
textAlign: 'center',
marginLeft: 10
},
categoryName: {
fontFamily: 'Inter-UI-SemiBold',
fontFamily: 'Metropolis-SemiBold',
fontSize: 20,
marginLeft: 24,
marginTop: 16,
@@ -58,12 +58,12 @@ const discoverStyle = StyleSheet.create({
justifyContent: 'center'
},
fileItemName: {
fontFamily: 'Inter-UI-Bold',
fontFamily: 'Metropolis-Bold',
marginTop: 8,
fontSize: 18
},
channelName: {
fontFamily: 'Inter-UI-SemiBold',
fontFamily: 'Metropolis-SemiBold',
fontSize: 16,
marginTop: 4,
color: Colors.LbryGreen
@@ -79,7 +79,7 @@ const discoverStyle = StyleSheet.create({
borderRadius: 4
},
filePriceText: {
fontFamily: 'Inter-UI-Bold',
fontFamily: 'Metropolis-Bold',
fontSize: 12,
textAlign: 'center',
color: '#0c604b'
@@ -112,7 +112,7 @@ const discoverStyle = StyleSheet.create({
color: Colors.White,
fontSize: 14,
textAlign: 'center',
fontFamily: 'Inter-UI-Regular'
fontFamily: 'Metropolis-Regular'
},
rewardTitleContainer: {
alignItems: 'center',
@@ -120,32 +120,13 @@ const discoverStyle = StyleSheet.create({
justifyContent: 'space-between'
},
rewardIcon: {
color: Colors.Red,
color: Colors.LbryGreen,
flex: 0.1,
textAlign: 'right',
marginTop: 6
},
rewardTitle: {
flex: 0.9
},
menuText: {
fontFamily: 'Inter-UI-Regular',
fontSize: 16
},
titleText: {
fontFamily: 'Inter-UI-Regular'
},
detailsRow: {
flexDirection: 'row',
justifyContent: 'space-between'
},
dateTime: {
marginTop: 2
},
dateTimeText: {
fontFamily: 'Inter-UI-Regular',
fontSize: 14,
color: Colors.DescriptionGrey
}
});
+2 -2
View File
@@ -29,8 +29,8 @@ const downloadsStyle = StyleSheet.create({
},
noDownloadsText: {
textAlign: 'center',
fontFamily: 'Inter-UI-Regular',
fontSize: 16,
fontFamily: 'Metropolis-Regular',
fontSize: 14,
position: 'absolute'
},
loading: {
+1 -1
View File
@@ -10,7 +10,7 @@ const fileDownloadButtonStyle = StyleSheet.create({
backgroundColor: '#40c0a9',
},
text: {
fontFamily: 'Inter-UI-Medium',
fontFamily: 'Metropolis-Medium',
color: '#ffffff',
fontSize: 14,
textAlign: 'center'
+2 -2
View File
@@ -10,7 +10,7 @@ const fileItemMediaStyle = StyleSheet.create({
alignItems: 'center'
},
autothumbText: {
fontFamily: 'Inter-UI-SemiBold',
fontFamily: 'Metropolis-SemiBold',
textAlign: 'center',
color: Colors.White,
fontSize: 40
@@ -55,7 +55,7 @@ const fileItemMediaStyle = StyleSheet.create({
},
text: {
color: '#ffffff',
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 16,
marginTop: 8
},
+8 -13
View File
@@ -28,16 +28,16 @@ const fileListStyle = StyleSheet.create({
justifyContent: 'center',
},
title: {
fontFamily: 'Inter-UI-SemiBold',
fontFamily: 'Metropolis-SemiBold',
fontSize: (screenWidthPixels <= 720) ? 12 : 16
},
uri: {
fontFamily: 'Inter-UI-SemiBold',
fontFamily: 'Metropolis-SemiBold',
fontSize: (screenWidthPixels <= 720) ? 12 : 14,
marginBottom: 8
},
publisher: {
fontFamily: 'Inter-UI-SemiBold',
fontFamily: 'Metropolis-SemiBold',
fontSize: (screenWidthPixels <= 720) ? 12 : 14,
marginTop: (screenWidthPixels <= 720) ? 1 : 3,
color: Colors.LbryGreen
@@ -45,19 +45,14 @@ const fileListStyle = StyleSheet.create({
loading: {
position: 'absolute'
},
info: {
marginTop: (screenWidthPixels <= 720) ? 1 : 2,
flexDirection: 'row',
justifyContent: 'space-between'
downloadInfo: {
marginTop: (screenWidthPixels <= 720) ? 4 : 8
},
infoText: {
fontFamily: 'Inter-UI-Regular',
downloadStorage: {
fontFamily: 'Metropolis-Regular',
fontSize: (screenWidthPixels <= 720) ? 12 : 14,
color: Colors.ChannelGrey
},
downloadInfo: {
marginTop: 2
},
progress: {
marginTop: (screenWidthPixels <= 720) ? 2 : 4,
height: 3,
@@ -70,7 +65,7 @@ const fileListStyle = StyleSheet.create({
progressRemaining: {
backgroundColor: Colors.LbryGreen,
opacity: 0.2
},
}
});
export default fileListStyle;
+15 -94
View File
@@ -35,7 +35,7 @@ const filePageStyle = StyleSheet.create({
height: containedMediaHeightWithControls
},
emptyClaimText: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
textAlign: 'center',
fontSize: 20,
marginLeft: 16,
@@ -52,44 +52,24 @@ const filePageStyle = StyleSheet.create({
flex: 1
},
title: {
fontFamily: 'Inter-UI-Bold',
fontFamily: 'Metropolis-Bold',
fontSize: 24,
marginTop: 12,
marginLeft: 20,
marginRight: 20,
marginBottom: 8
},
channelRow: {
flexDirection: 'row',
justifyContent: 'space-between',
marginLeft: 20,
marginRight: 20,
marginBottom: 16,
},
subscriptionRow: {
flexDirection: 'row',
marginTop: 8
},
publishInfo: {
width: '50%',
marginTop: 6,
marginBottom: 12
},
channelName: {
fontFamily: 'Inter-UI-SemiBold',
fontFamily: 'Metropolis-SemiBold',
fontSize: 20,
marginLeft: 20,
marginRight: 20,
marginBottom: 20,
color: Colors.LbryGreen
},
publishDateText: {
fontFamily: 'Inter-UI-SemiBold',
fontSize: 12,
color: Colors.DescriptionGrey
},
publishDate: {
marginTop: 4
},
description: {
color: Colors.DescriptionGrey,
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 16,
lineHeight: 20,
marginLeft: 20,
@@ -156,14 +136,12 @@ const filePageStyle = StyleSheet.create({
borderRadius: 4
},
filePriceText: {
fontFamily: 'Inter-UI-Bold',
fontFamily: 'Metropolis-Bold',
fontSize: 12,
textAlign: 'center',
color: '#0c604b'
},
actions: {
flexDirection: 'row',
justifyContent: 'space-between',
paddingLeft: 16,
paddingRight: 16,
paddingTop: 16,
@@ -171,21 +149,11 @@ const filePageStyle = StyleSheet.create({
marginTop: -14,
width: '100%',
},
fileActions: {
alignSelf: 'flex-end'
},
socialActions: {
alignSelf: 'flex-start',
flexDirection: 'row'
},
actionButton: {
alignSelf: 'flex-start',
backgroundColor: Colors.White,
paddingLeft: 16,
paddingRight: 16
},
bellButton: {
marginLeft: 8
paddingLeft: 24,
paddingRight: 24
},
loading: {
position: 'absolute',
@@ -205,19 +173,19 @@ const filePageStyle = StyleSheet.create({
paddingRight: 24
},
dmcaText: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 18,
lineHeight: 24
},
dmcaLink: {
color: Colors.LbryGreen,
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 18,
lineHeight: 24,
marginTop: 24
},
infoText: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 20,
textAlign: 'center',
marginLeft: 10
@@ -232,57 +200,10 @@ const filePageStyle = StyleSheet.create({
zIndex: 100
},
link: {
color: Colors.Grey
color: Colors.LbryGreen
},
linkTapped: {
color: "rgba(64, 184, 154, .2)"
},
tipCard: {
backgroundColor: Colors.White,
position: 'absolute',
top: containedMediaHeightWithControls - 16,
width: '100%',
paddingTop: 8,
paddingBottom: 8,
paddingLeft: 16,
paddingRight: 16
},
row: {
flexDirection: 'row',
flex: 1,
justifyContent: 'space-between'
},
amountRow: {
flexDirection: 'row',
flex: 0.75
},
button: {
backgroundColor: Colors.LbryGreen,
alignSelf: 'flex-end',
marginBottom: 6
},
cancelTipLink: {
alignSelf: 'flex-end',
marginBottom: 14
},
input: {
fontFamily: 'Inter-UI-Regular',
fontSize: 14
},
tipAmountInput: {
alignSelf: 'flex-start',
width: 80,
fontSize: 16,
letterSpacing: 1
},
currency: {
alignSelf: 'flex-start',
marginTop: 17
},
text: {
fontFamily: 'Inter-UI-Regular',
fontSize: 16,
lineHeight: 24
}
});
+8 -9
View File
@@ -12,7 +12,7 @@ const firstRunStyle = StyleSheet.create({
backgroundColor: Colors.LbryGreen
},
title: {
fontFamily: 'Inter-UI-SemiBold',
fontFamily: 'Metropolis-SemiBold',
fontSize: 40,
marginLeft: 32,
marginRight: 32,
@@ -20,7 +20,7 @@ const firstRunStyle = StyleSheet.create({
color: Colors.White
},
paragraph: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 18,
lineHeight: 24,
marginLeft: 32,
@@ -29,7 +29,7 @@ const firstRunStyle = StyleSheet.create({
color: Colors.White
},
infoParagraph: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 14,
lineHeight: 20,
marginLeft: 32,
@@ -38,7 +38,7 @@ const firstRunStyle = StyleSheet.create({
color: Colors.White
},
emailInput: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 24,
lineHeight: 24,
marginLeft: 32,
@@ -58,19 +58,18 @@ const firstRunStyle = StyleSheet.create({
actionButton: {
backgroundColor: Colors.White,
alignSelf: 'center',
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 12,
paddingLeft: 16,
paddingRight: 16
},
button: {
alignSelf: 'flex-end',
padding: 20,
paddingLeft: 32,
paddingRight: 32
marginLeft: 32,
marginRight: 32
},
buttonText: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 24,
color: Colors.White
},
+1 -1
View File
@@ -22,7 +22,7 @@ const floatingButtonStyle = StyleSheet.create({
},
text: {
color: Colors.White,
fontFamily: 'Inter-UI-Bold',
fontFamily: 'Metropolis-Bold',
fontSize: 18,
},
bottomRight: {
+4 -11
View File
@@ -7,13 +7,6 @@ const mediaPlayerStyle = StyleSheet.create({
width: '100%',
height: '100%'
},
playerThumbnail: {
position: 'absolute',
left: 0,
top: 0,
width: '100%',
height: '100%',
},
container: {
flex: 1,
paddingBottom: 16
@@ -78,7 +71,7 @@ const mediaPlayerStyle = StyleSheet.create({
bottom: 14,
},
elapsedDuration: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
position: 'absolute',
left: 8,
bottom: 24,
@@ -86,7 +79,7 @@ const mediaPlayerStyle = StyleSheet.create({
color: '#ffffff'
},
totalDuration: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
position: 'absolute',
right: 40,
bottom: 24,
@@ -100,7 +93,7 @@ const mediaPlayerStyle = StyleSheet.create({
left: 15,
height: 12,
width: 12,
backgroundColor: Colors.LbryGreen
backgroundColor: '#40c0a9'
},
seekerHandle: {
backgroundColor: 'transparent',
@@ -135,7 +128,7 @@ const mediaPlayerStyle = StyleSheet.create({
left: 15,
height: 24,
width: 24,
backgroundColor: Colors.LbryGreen
backgroundColor: '#40c0a9'
}
});
-1
View File
@@ -42,7 +42,6 @@ const pageHeaderStyle = StyleSheet.create({
flexDirection: 'row',
},
titleText: {
fontFamily: 'Inter-UI-Regular',
fontSize: Platform.OS === 'ios' ? 17 : 20,
fontWeight: Platform.OS === 'ios' ? '700' : '500',
color: 'rgba(0, 0, 0, .9)',
+1 -1
View File
@@ -12,7 +12,7 @@ const relatedContentStyle = StyleSheet.create({
borderTopWidth: 1
},
title: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 18,
},
itemList: {
+15 -29
View File
@@ -48,36 +48,36 @@ const rewardStyle = StyleSheet.create({
paddingBottom: 16
},
text: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 16,
lineHeight: 24
},
infoText: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 18,
marginLeft: 12
},
title: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 22,
marginBottom: 6,
color: Colors.LbryGreen
},
subtitle: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 18,
marginBottom: 6,
color: Colors.LbryGreen
},
subcardText: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 15,
lineHeight: 20,
marginLeft: 2,
marginRight: 2
},
subcardTextInput: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 16,
marginTop: 2,
marginBottom: 2
@@ -99,7 +99,7 @@ const rewardStyle = StyleSheet.create({
},
link: {
color: Colors.LbryGreen,
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 14,
},
textLink: {
@@ -118,21 +118,21 @@ const rewardStyle = StyleSheet.create({
alignItems: 'center'
},
rewardAmount: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 26,
textAlign: 'center'
},
rewardCurrency: {
fontFamily: 'Inter-UI-Regular'
fontFamily: 'Metropolis-Regular'
},
rewardTitle: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 16,
color: Colors.LbryGreen,
marginBottom: 4,
},
rewardDescription: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 14,
lineHeight: 18,
marginBottom: 4
@@ -162,7 +162,7 @@ const rewardStyle = StyleSheet.create({
},
summaryText: {
color: Colors.White,
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 14,
lineHeight: 20,
flex: 0.7
@@ -175,18 +175,18 @@ const rewardStyle = StyleSheet.create({
marginLeft: 8
},
phoneInputText: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 16,
letterSpacing: 1.3
},
verifyingText: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 14,
marginLeft: 12,
alignSelf: 'flex-start'
},
verificationCodeInput: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 24,
letterSpacing: 12
},
@@ -202,20 +202,6 @@ const rewardStyle = StyleSheet.create({
paddingLeft: 4,
paddingRight: 4,
flex: 0.2
},
customCodeInput: {
fontFamily: 'Inter-UI-Regular',
fontSize: 16,
letterSpacing: 1.3,
marginTop: -8,
marginBottom: 4
},
redeemButton: {
alignSelf: 'flex-end',
backgroundColor: Colors.LbryGreen
},
failureFootnote: {
marginTop: 12
}
});
+2 -2
View File
@@ -26,12 +26,12 @@ const searchStyle = StyleSheet.create({
searchInput: {
width: '100%',
height: '100%',
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 16
},
noResultsText: {
textAlign: 'center',
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 14,
position: 'absolute'
},
+2 -2
View File
@@ -25,13 +25,13 @@ const settingsStyle = StyleSheet.create({
},
label: {
fontSize: 14,
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
lineHeight: 18
},
description: {
color: '#aaaaaa',
fontSize: 12,
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
lineHeight: 18
}
});
+3 -3
View File
@@ -8,7 +8,7 @@ const splashStyle = StyleSheet.create({
backgroundColor: Colors.LbryGreen
},
title: {
fontFamily: 'Inter-UI-Bold',
fontFamily: 'Metropolis-Bold',
fontSize: 64,
textAlign: 'center',
marginBottom: 48,
@@ -23,7 +23,7 @@ const splashStyle = StyleSheet.create({
width: '50%'
},
details: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 14,
marginLeft: 16,
marginRight: 16,
@@ -31,7 +31,7 @@ const splashStyle = StyleSheet.create({
textAlign: 'center'
},
message: {
fontFamily: 'Inter-UI-Bold',
fontFamily: 'Metropolis-Bold',
fontSize: 18,
color: Colors.White,
marginLeft: 16,
+5 -5
View File
@@ -16,16 +16,16 @@ const storageStatsStyle = StyleSheet.create({
padding: 16
},
totalSize: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 36
},
annotation: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 14,
marginTop: -4
},
statsText: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 14
},
distributionBar: {
@@ -57,12 +57,12 @@ const storageStatsStyle = StyleSheet.create({
height: 16,
},
legendText: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 14,
flex: 0.3
},
legendSize: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 14,
flex: 0.6,
textAlign: 'right'
-33
View File
@@ -1,33 +0,0 @@
import { StyleSheet } from 'react-native';
const subscriptionsStyle = StyleSheet.create({
container: {
flex: 1,
},
busyContainer: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
flexDirection: 'row',
padding: 16
},
scrollContainer: {
flex: 1,
marginBottom: 60
},
scrollPadding: {
paddingTop: 24
},
infoText: {
textAlign: 'center',
fontFamily: 'Inter-UI-Regular',
fontSize: 16,
},
fileItem: {
marginLeft: 24,
marginRight: 24,
marginBottom: 24
}
});
export default subscriptionsStyle;
+5 -5
View File
@@ -21,29 +21,29 @@ const transactionListStyle = StyleSheet.create({
alignSelf: 'stretch'
},
text: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 14
},
link: {
color: Colors.LbryGreen,
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 14
},
amount: {
textAlign: 'right'
},
smallText: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 12,
color: '#aaaaaa'
},
smallLink: {
color: Colors.LbryGreen,
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 12
},
noTransactions: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
textAlign: 'center',
padding: 16,
color: '#aaaaaa'
+2 -2
View File
@@ -22,7 +22,7 @@ const uriBarStyle = StyleSheet.create({
borderColor: Colors.LightGrey,
padding: 8,
borderRadius: 4,
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 16,
width: '100%'
},
@@ -47,7 +47,7 @@ const uriBarStyle = StyleSheet.create({
padding: 12
},
itemText: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 16,
marginLeft: 12,
marginRight: 12
+12 -19
View File
@@ -11,7 +11,7 @@ const walletStyle = StyleSheet.create({
flexDirection: 'row'
},
address: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
borderWidth: 1,
borderStyle: 'dashed',
borderColor: '#cccccc',
@@ -33,24 +33,17 @@ const walletStyle = StyleSheet.create({
marginRight: 16,
padding: 16
},
warningCard: {
backgroundColor: Colors.Orange,
padding: 16,
marginLeft: 16,
marginTop: 16,
marginRight: 16
},
transactionsCard: {
backgroundColor: '#ffffff',
margin: 16
},
title: {
fontFamily: 'Inter-UI-Bold',
fontFamily: 'Metropolis-Bold',
fontSize: 20,
marginBottom: 24
},
transactionsTitle: {
fontFamily: 'Inter-UI-Bold',
fontFamily: 'Metropolis-Bold',
fontSize: 20
},
transactionsHeader: {
@@ -62,16 +55,16 @@ const walletStyle = StyleSheet.create({
borderBottomColor: '#eeeeee'
},
text: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 14
},
link: {
color: Colors.LbryGreen,
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 14
},
smallText: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 12
},
balanceCard: {
@@ -87,14 +80,14 @@ const walletStyle = StyleSheet.create({
},
balanceTitle: {
color: '#ffffff',
fontFamily: 'Inter-UI-Bold',
fontFamily: 'Metropolis-Bold',
fontSize: 18,
marginLeft: 16,
marginTop: 16
},
balanceCaption: {
color: '#caedB9',
fontFamily: 'Inter-UI-Medium',
fontFamily: 'Metropolis-Medium',
fontSize: 14,
marginLeft: 16,
marginTop: 8,
@@ -102,20 +95,20 @@ const walletStyle = StyleSheet.create({
},
balance: {
color: '#ffffff',
fontFamily: 'Inter-UI-Bold',
fontFamily: 'Metropolis-Bold',
fontSize: 36,
marginLeft: 16,
marginBottom: 16
},
infoText: {
color: '#aaaaaa',
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 14,
padding: 16,
textAlign: 'center'
},
input: {
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 14
},
amountInput: {
@@ -136,7 +129,7 @@ const walletStyle = StyleSheet.create({
},
warningText: {
color: Colors.White,
fontFamily: 'Inter-UI-Regular',
fontFamily: 'Metropolis-Regular',
fontSize: 16,
lineHeight: 24
},
+2 -104
View File
@@ -1,37 +1,7 @@
import { NavigationActions, StackActions } from 'react-navigation';
import { buildURI } from 'lbry-redux';
import { DrawerRoutes } from 'constants';
import Constants from 'constants';
function getRouteForSpecialUri(uri) {
let targetRoute;
const page = uri.substring(8).trim(); // 'lbry://?'.length == 8
switch (page) {
case Constants.PAGE_REWARDS: targetRoute = 'Rewards'; break;
case Constants.PAGE_SETTINGS: targetRoute = 'Settings'; break;
case Constants.PAGE_TRENDING: targetRoute = 'TrendingStack'; break;
case Constants.PAGE_WALLET: targetRoute = 'WalletStack'; break;
default: targetRoute = 'DiscoverStack'; break;
}
return targetRoute;
}
export function dispatchNavigateToUri(dispatch, nav, uri) {
if (uri.startsWith('lbry://?')) {
dispatch(NavigationActions.navigate({ routeName: getRouteForSpecialUri(uri) }));
return;
}
let uriVars = {};
if (uri.indexOf('?') > -1) {
uriVarsStr = uri.substring(uri.indexOf('?') + 1);
uri = uri.substring(0, uri.indexOf('?'));
uriVars = parseUriVars(uriVarsStr);
}
const params = { uri, uriVars };
const params = { uri };
if (nav && nav.routes && nav.routes.length > 0 && 'Main' === nav.routes[0].routeName) {
const mainRoute = nav.routes[0];
const discoverRoute = mainRoute.routes[0];
@@ -69,23 +39,6 @@ export function formatBytes(bytes, decimalPoints = 0) {
return `${value} GB`;
}
function parseUriVars(vars) {
const uriVars = {};
const parts = vars.split('&');
for (let i = 0; i < parts.length; i++) {
const str = parts[i];
if (str.indexOf('=') > -1) {
const key = str.substring(0, str.indexOf('='));
const value = str.substring(str.indexOf('=') + 1);
uriVars[key] = value;
} else {
uriVars[str] = null;
}
}
return uriVars;
}
export function navigateToUri(navigation, uri, additionalParams) {
if (!navigation) {
return;
@@ -95,19 +48,7 @@ export function navigateToUri(navigation, uri, additionalParams) {
return;
}
if (uri.startsWith('lbry://?')) {
navigation.navigate({ routeName: getRouteForSpecialUri(uri) });
return;
}
let uriVars = {};
if (uri.indexOf('?') > -1) {
uriVarsStr = uri.substring(uri.indexOf('?') + 1);
uri = uri.substring(0, uri.indexOf('?'));
uriVars = parseUriVars(uriVarsStr);
}
const params = Object.assign({ uri, uriVars }, additionalParams);
const params = Object.assign({ uri }, additionalParams);
if ('File' === navigation.state.routeName) {
const stackAction = StackActions.replace({ routeName: 'File', newKey: uri, params });
navigation.dispatch(stackAction);
@@ -116,46 +57,3 @@ export function navigateToUri(navigation, uri, additionalParams) {
navigation.navigate({ routeName: 'File', key: uri, params });
}
export function navigateBack(navigation, drawerStack, popDrawerStack) {
const shouldPopStack = DrawerRoutes.indexOf(navigation.state.routeName) > -1;
if (shouldPopStack) {
navigation.goBack();
if (popDrawerStack) {
popDrawerStack();
}
navigation.navigate({ routeName: drawerStack[drawerStack.length > 1 ? drawerStack.length - 2 : 0] });
return;
}
navigation.goBack(navigation.state.key);
}
export function dispatchNavigateBack(dispatch, nav, drawerStack, popDrawerStack) {
const drawerRouteIndex = nav.routes[0].index;
const shouldPopStack = (
(drawerRouteIndex > 0 && drawerRouteIndex !== 3) || // not the discover nor wallet stack
(drawerRouteIndex === 3 && nav.routes[0].routes[drawerRouteIndex].index === 0) // wallet stack, and tx history page not active
);
if (shouldPopStack) {
dispatch(NavigationActions.back());
if (popDrawerStack) {
dispatch(popDrawerStack());
}
const navigateAction = NavigationActions.navigate({ routeName: drawerStack[drawerStack.length > 1 ? drawerStack.length - 2 : 0] });
dispatch(navigateAction);
return;
}
dispatch(NavigationActions.back());
}
export function uriFromFileInfo(fileInfo) {
const { name: claimName, claim_name: claimNameDownloaded, claim_id: claimId } = fileInfo;
const uriParams = {};
uriParams.contentName = claimName || claimNameDownloaded;
uriParams.claimId = claimId;
return buildURI(uriParams);
}
+6 -6
View File
@@ -36,7 +36,7 @@ version.filename = %(source.dir)s/main.py
# (list) Application requirements
# comma seperated e.g. requirements = sqlite3,kivy
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro, pyjnius, certifi==2018.4.16, constantly, incremental, miniupnpc==1.9, gmpy, appdirs==1.4.3, argparse==1.2.1, docopt, base58==1.0.0, colorama==0.3.7, dnspython==1.12.0, ecdsa==0.13, envparse, jsonrpclib==0.1.7, jsonschema==2.5.1, pbkdf2, pyyaml, qrcode==5.2.2, requests, seccure==0.3.1.3, attrs==18.1.0, pyasn1, pyasn1-modules, service_identity==16.0.0, six==1.9.0, txJSON-RPC, zope.interface==4.3.3, protobuf==3.6.1, keyring==10.4.0, txupnp, git+https://github.com/lbryio/lbryschema.git#egg=lbryschema, git+https://github.com/lbryio/lbry.git@v0.30.4#egg=lbrynet, git+https://github.com/lbryio/aioupnp.git#egg=aioupnp, asn1crypto, treq==17.8.0, funcsigs, mock, pbr, pyopenssl, twisted, idna, Automat, hyperlink, PyHamcrest, netifaces, cryptography, aiohttp==3.4.4, multidict==4.5.2, idna_ssl==1.1.0, typing_extensions==3.6.5, yarl, chardet==3.0.4, async_timeout==3.0.1, aiorpcX==0.9.0, git+https://github.com/lbryio/torba#egg=torba, coincurve
requirements = openssl, sqlite3, hostpython2, android, distro, pyjnius, certifi==2018.4.16, constantly, incremental, functools32, miniupnpc==1.9, gmpy==1.17, twisted==16.6.0, appdirs==1.4.3, argparse==1.2.1, docopt==0.6.2, base58==0.2.2, colorama==0.3.7, dnspython==1.12.0, ecdsa==0.13, envparse==0.2.0, jsonrpc==1.2, jsonrpclib==0.1.7, jsonschema==2.5.1, pbkdf2==1.3, pyyaml==3.12, qrcode==5.2.2, requests==2.9.1, seccure==0.3.1.3, attrs==18.1.0, pyasn1, pyasn1-modules, service_identity==16.0.0, six==1.9.0, slowaes==0.1a1, txJSON-RPC==0.5, wsgiref==0.1.2, zope.interface==4.3.3, protobuf==3.2.0, keyring==10.4.0, netifaces, txupnp==0.0.1a10, git+https://github.com/lbryio/lbryschema.git@v0.0.16#egg=lbryschema, git+https://github.com/lbryio/lbryum.git#egg=lbryum, git+https://github.com/lbryio/lbry.git@v0.21.2#egg=lbrynet, asn1crypto, cryptography==2.2.2, pyopenssl==17.4.0, treq==17.8.0, funcsigs, mock, pbr, unqlite
# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
@@ -86,7 +86,7 @@ fullscreen = 0
#android.presplash_color = #FFFFFF
# (list) Permissions
android.permissions = ACCESS_NETWORK_STATE,BLUETOOTH,INTERNET,READ_EXTERNAL_STORAGE,WRITE_EXTERNAL_STORAGE
android.permissions = ACCESS_NETWORK_STATE,BLUETOOTH,INTERNET,READ_EXTERNAL_STORAGE,RECEIVE_SMS,WRITE_EXTERNAL_STORAGE
# (int) Android API to use
android.api = 27
@@ -98,16 +98,16 @@ android.minapi = 21
android.sdk = 23
# (str) Android NDK version to use
#android.ndk = 13b
android.ndk = 13b
# (bool) Use --private data storage (True) or --dir public storage (False)
#android.private_storage = True
# (str) Android NDK directory (if empty, it will be automatically downloaded.)
android.ndk_path = ~/.buildozer/android/crystax-ndk-10.3.2
#android.ndk_path = ~/Dev/SDKs/android-ndk-r13b
# (str) Android SDK directory (if empty, it will be automatically downloaded.)
#android.sdk_path = ~/.buildozer/android
#android.sdk_path = ~/Dev/SDKs/android
# (str) ANT directory (if empty, it will be automatically downloaded.)
#android.ant_path =
@@ -148,7 +148,7 @@ android.react_src = ./app
# (list) Gradle dependencies to add (currently works only with sdl2_gradle
# bootstrap)
android.gradle_dependencies = com.android.support:support-v4:27.1.1, com.android.support:support-media-compat:27.1.1, com.android.support:appcompat-v7:27.1.1, com.facebook.react:react-native:0.55.3, com.mixpanel.android:mixpanel-android:5+, com.google.android.gms:play-services-gcm:11.0.4+, com.facebook.fresco:fresco:1.9.0, com.facebook.fresco:animated-gif:1.9.0, com.squareup.picasso:picasso:2.71828
android.gradle_dependencies = com.android.support:support-v4:27.1.1, com.android.support:support-media-compat:27.1.1, com.android.support:appcompat-v7:27.1.1, com.facebook.react:react-native:0.55.3, com.mixpanel.android:mixpanel-android:5+, com.google.android.gms:play-services-gcm:11.0.4+, com.facebook.fresco:fresco:1.9.0, com.facebook.fresco:animated-gif:1.9.0
# (str) python-for-android branch to use, defaults to master
#p4a.branch = stable
+6 -6
View File
@@ -36,7 +36,7 @@ version.filename = %(source.dir)s/main.py
# (list) Application requirements
# comma seperated e.g. requirements = sqlite3,kivy
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro, pyjnius, certifi==2018.4.16, constantly, incremental, miniupnpc==1.9, gmpy, appdirs==1.4.3, argparse==1.2.1, docopt, base58==1.0.0, colorama==0.3.7, dnspython==1.12.0, ecdsa==0.13, envparse, jsonrpclib==0.1.7, jsonschema==2.5.1, pbkdf2, pyyaml, qrcode==5.2.2, requests, seccure==0.3.1.3, attrs==18.1.0, pyasn1, pyasn1-modules, service_identity==16.0.0, six==1.9.0, txJSON-RPC, zope.interface==4.3.3, protobuf==3.6.1, keyring==10.4.0, txupnp, git+https://github.com/lbryio/lbryschema.git#egg=lbryschema, git+https://github.com/lbryio/lbry.git@v0.30.4#egg=lbrynet, git+https://github.com/lbryio/aioupnp.git#egg=aioupnp, asn1crypto, treq==17.8.0, funcsigs, mock, pbr, pyopenssl, twisted, idna, Automat, hyperlink, PyHamcrest, netifaces, cryptography, aiohttp==3.4.4, multidict==4.5.2, idna_ssl==1.1.0, typing_extensions==3.6.5, yarl, chardet==3.0.4, async_timeout==3.0.1, aiorpcX==0.9.0, git+https://github.com/lbryio/torba#egg=torba, coincurve
requirements = openssl, sqlite3, hostpython2, android, distro, pyjnius, certifi==2018.4.16, constantly, incremental, functools32, miniupnpc==1.9, gmpy==1.17, twisted==16.6.0, appdirs==1.4.3, argparse==1.2.1, docopt==0.6.2, base58==0.2.2, colorama==0.3.7, dnspython==1.12.0, ecdsa==0.13, envparse==0.2.0, jsonrpc==1.2, jsonrpclib==0.1.7, jsonschema==2.5.1, pbkdf2==1.3, pyyaml==3.12, qrcode==5.2.2, requests==2.9.1, seccure==0.3.1.3, attrs==18.1.0, pyasn1, pyasn1-modules, service_identity==16.0.0, six==1.9.0, slowaes==0.1a1, txJSON-RPC==0.5, wsgiref==0.1.2, zope.interface==4.3.3, protobuf==3.2.0, keyring==10.4.0, netifaces, txupnp==0.0.1a10, git+https://github.com/lbryio/lbryschema.git@v0.0.16#egg=lbryschema, git+https://github.com/lbryio/lbryum.git#egg=lbryum, git+https://github.com/lbryio/lbry.git@v0.21.2#egg=lbrynet, asn1crypto, cryptography==2.2.2, pyopenssl==17.4.0, treq==17.8.0, funcsigs, mock, pbr, unqlite
# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
@@ -86,7 +86,7 @@ fullscreen = 0
#android.presplash_color = #FFFFFF
# (list) Permissions
android.permissions = ACCESS_NETWORK_STATE,BLUETOOTH,INTERNET,READ_EXTERNAL_STORAGE,WRITE_EXTERNAL_STORAGE
android.permissions = ACCESS_NETWORK_STATE,BLUETOOTH,INTERNET,READ_EXTERNAL_STORAGE,RECEIVE_SMS,WRITE_EXTERNAL_STORAGE
# (int) Android API to use
android.api = 27
@@ -98,16 +98,16 @@ android.minapi = 21
android.sdk = 23
# (str) Android NDK version to use
#android.ndk = 13b
android.ndk = 13b
# (bool) Use --private data storage (True) or --dir public storage (False)
#android.private_storage = True
# (str) Android NDK directory (if empty, it will be automatically downloaded.)
android.ndk_path = ~/.buildozer/android/crystax-ndk-10.3.2
#android.ndk_path = ~/Dev/SDKs/android-ndk-r13b
# (str) Android SDK directory (if empty, it will be automatically downloaded.)
#android.sdk_path = ~/.buildozer/android
#android.sdk_path = ~/Dev/SDKs/android
# (str) ANT directory (if empty, it will be automatically downloaded.)
#android.ant_path =
@@ -148,7 +148,7 @@ android.react_src = ./app
# (list) Gradle dependencies to add (currently works only with sdl2_gradle
# bootstrap)
android.gradle_dependencies = com.android.support:support-v4:27.1.1, com.android.support:support-media-compat:27.1.1, com.android.support:appcompat-v7:27.1.1, com.facebook.react:react-native:0.55.3, com.mixpanel.android:mixpanel-android:5+, com.google.android.gms:play-services-gcm:11.0.4+, com.facebook.fresco:fresco:1.9.0, com.facebook.fresco:animated-gif:1.9.0, com.squareup.picasso:picasso:2.71828
android.gradle_dependencies = com.android.support:support-v4:27.1.1, com.android.support:support-media-compat:27.1.1, com.android.support:appcompat-v7:27.1.1, com.facebook.react:react-native:0.55.3, com.mixpanel.android:mixpanel-android:5+, com.google.android.gms:play-services-gcm:11.0.4+, com.facebook.fresco:fresco:1.9.0, com.facebook.fresco:animated-gif:1.9.0
# (str) python-for-android branch to use, defaults to master
#p4a.branch = stable
+6 -6
View File
@@ -36,7 +36,7 @@ version.filename = %(source.dir)s/main.py
# (list) Application requirements
# comma seperated e.g. requirements = sqlite3,kivy
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro, pyjnius, certifi==2018.4.16, constantly, incremental, miniupnpc==1.9, gmpy, appdirs==1.4.3, argparse==1.2.1, docopt, base58==1.0.0, colorama==0.3.7, dnspython==1.12.0, ecdsa==0.13, envparse, jsonrpclib==0.1.7, jsonschema==2.5.1, pbkdf2, pyyaml, qrcode==5.2.2, requests, seccure==0.3.1.3, attrs==18.1.0, pyasn1, pyasn1-modules, service_identity==16.0.0, six==1.9.0, txJSON-RPC, zope.interface==4.3.3, protobuf==3.6.1, keyring==10.4.0, txupnp, git+https://github.com/lbryio/lbryschema.git#egg=lbryschema, git+https://github.com/lbryio/lbry.git@v0.30.4#egg=lbrynet, git+https://github.com/lbryio/aioupnp.git#egg=aioupnp, asn1crypto, treq==17.8.0, funcsigs, mock, pbr, pyopenssl, twisted, idna, Automat, hyperlink, PyHamcrest, netifaces, cryptography, aiohttp==3.4.4, multidict==4.5.2, idna_ssl==1.1.0, typing_extensions==3.6.5, yarl, chardet==3.0.4, async_timeout==3.0.1, aiorpcX==0.9.0, git+https://github.com/lbryio/torba#egg=torba, coincurve
requirements = openssl, sqlite3, hostpython2, android, distro, pyjnius, certifi==2018.4.16, constantly, incremental, functools32, miniupnpc==1.9, gmpy==1.17, twisted==16.6.0, appdirs==1.4.3, argparse==1.2.1, docopt==0.6.2, base58==0.2.2, colorama==0.3.7, dnspython==1.12.0, ecdsa==0.13, envparse==0.2.0, jsonrpc==1.2, jsonrpclib==0.1.7, jsonschema==2.5.1, pbkdf2==1.3, pyyaml==3.12, qrcode==5.2.2, requests==2.9.1, seccure==0.3.1.3, attrs==18.1.0, pyasn1, pyasn1-modules, service_identity==16.0.0, six==1.9.0, slowaes==0.1a1, txJSON-RPC==0.5, wsgiref==0.1.2, zope.interface==4.3.3, protobuf==3.2.0, keyring==10.4.0, netifaces, txupnp==0.0.1a10, git+https://github.com/lbryio/lbryschema.git@v0.0.16#egg=lbryschema, git+https://github.com/lbryio/lbryum.git#egg=lbryum, git+https://github.com/lbryio/lbry.git@v0.21.2#egg=lbrynet, asn1crypto, cryptography==2.2.2, pyopenssl==17.4.0, treq==17.8.0, funcsigs, mock, pbr, unqlite
# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
@@ -86,7 +86,7 @@ fullscreen = 0
#android.presplash_color = #FFFFFF
# (list) Permissions
android.permissions = ACCESS_NETWORK_STATE,BLUETOOTH,INTERNET,READ_EXTERNAL_STORAGE,WRITE_EXTERNAL_STORAGE
android.permissions = ACCESS_NETWORK_STATE,BLUETOOTH,INTERNET,READ_EXTERNAL_STORAGE,RECEIVE_SMS,WRITE_EXTERNAL_STORAGE
# (int) Android API to use
android.api = 27
@@ -98,16 +98,16 @@ android.minapi = 21
android.sdk = 23
# (str) Android NDK version to use
#android.ndk = 13b
android.ndk = 13b
# (bool) Use --private data storage (True) or --dir public storage (False)
#android.private_storage = True
# (str) Android NDK directory (if empty, it will be automatically downloaded.)
android.ndk_path = ~/.buildozer/android/crystax-ndk-10.3.2
#android.ndk_path = ~/Dev/SDKs/android-ndk-r13b
# (str) Android SDK directory (if empty, it will be automatically downloaded.)
#android.sdk_path = ~/.buildozer/android
#android.sdk_path = ~/Dev/SDKs/android
# (str) ANT directory (if empty, it will be automatically downloaded.)
#android.ant_path =
@@ -148,7 +148,7 @@ android.react_src = ./app
# (list) Gradle dependencies to add (currently works only with sdl2_gradle
# bootstrap)
android.gradle_dependencies = com.android.support:support-v4:27.1.1, com.android.support:support-media-compat:27.1.1, com.android.support:appcompat-v7:27.1.1, com.facebook.react:react-native:0.55.3, com.mixpanel.android:mixpanel-android:5+, com.google.android.gms:play-services-gcm:11.0.4+, com.facebook.fresco:fresco:1.9.0, com.facebook.fresco:animated-gif:1.9.0, com.squareup.picasso:picasso:2.71828
android.gradle_dependencies = com.android.support:support-v4:27.1.1, com.android.support:support-media-compat:27.1.1, com.android.support:appcompat-v7:27.1.1, com.facebook.react:react-native:0.55.3, com.mixpanel.android:mixpanel-android:5+, com.google.android.gms:play-services-gcm:11.0.4+, com.facebook.fresco:fresco:1.9.0, com.facebook.fresco:animated-gif:1.9.0
# (str) python-for-android branch to use, defaults to master
#p4a.branch = stable
Loaded 100 of 523 files, more files were not shown because too many files have changed in this diff. Show more