Compare commits
104
Commits
reactotron
...
dht
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79a8862573 | ||
|
|
1a638e88e4 | ||
|
|
08c6cf1b7f | ||
|
|
195d155c70 | ||
|
|
9bad912cc9 | ||
|
|
30f66d23de | ||
|
|
3c5dfc9899 | ||
|
|
6392dbe975 | ||
|
|
485e62725c | ||
|
|
8a2b0b9bc1 | ||
|
|
e372f1ead4 | ||
|
|
9582b7ad7d | ||
|
|
f8de4cbc1a | ||
|
|
82508559b9 | ||
|
|
e1f4994990 | ||
|
|
19d3d8cd94 | ||
|
|
bcfb65ed54 | ||
|
|
0536f0e4bf | ||
|
|
0db2c7e628 | ||
|
|
f05d357fa7 | ||
|
|
1f649b9d38 | ||
|
|
55b292ab0e | ||
|
|
736de8e5d9 | ||
|
|
f06252d397 | ||
|
|
fa25789855 | ||
|
|
514e077fbb | ||
|
|
3d44bfa88b | ||
|
|
f81e2d7441 | ||
|
|
81bdd37576 | ||
|
|
76938d3349 | ||
|
|
21749453df | ||
|
|
456c787683 | ||
|
|
3a5edc461a | ||
|
|
3a8af2d7a0 | ||
|
|
601c589f69 | ||
|
|
f5ae1f34f7 | ||
|
|
4656be64a7 | ||
|
|
8e377d0e74 | ||
|
|
bf7f836465 | ||
|
|
017787ef25 | ||
|
|
d9ada93ff3 | ||
|
|
95a33b411b | ||
|
|
9bc5a2ecac | ||
|
|
4e6267d5a9 | ||
|
|
dc0b06ce55 | ||
|
|
82d15f0c7f | ||
|
|
9f32363a09 | ||
|
|
467272d5c8 | ||
|
|
3594b70113 | ||
|
|
5f008b3ac9 | ||
|
|
3f21c4e08c | ||
|
|
3717a8072b | ||
|
|
46bfbd242a | ||
|
|
0361b10575 | ||
|
|
b9dec86cae | ||
|
|
2465b5514f | ||
|
|
df3a9587c0 | ||
|
|
5df8b8c4aa | ||
|
|
156e310368 | ||
|
|
683b1f4805 | ||
|
|
e263ad7569 | ||
|
|
24d580ea13 | ||
|
|
bfc3b11035 | ||
|
|
6bf2f9460d | ||
|
|
504baeefaf | ||
|
|
6c55633751 | ||
|
|
3395fa7aa2 | ||
|
|
7a3def7ea1 | ||
|
|
f1aafd6e34 | ||
|
|
1ce5fad8c0 | ||
|
|
4690451bfe | ||
|
|
b149c0039a | ||
|
|
e97bf7ce79 | ||
|
|
8c79115ce0 | ||
|
|
24fa80d92a | ||
|
|
624d95ab42 | ||
|
|
8519b561b3 | ||
|
|
00dfc205a5 | ||
|
|
b6ab92a700 | ||
|
|
561aa0db9c | ||
|
|
ad9056f91a | ||
|
|
bc62580aae | ||
|
|
f5cb8e44d1 | ||
|
|
c47c7cd925 | ||
|
|
b25f913921 | ||
|
|
673d6dc0f5 | ||
|
|
91eb18ec9b | ||
|
|
4ed3809ffd | ||
|
|
3f0ed7988a | ||
|
|
b3e20e78cb | ||
|
|
331f3d58ee | ||
|
|
3b0ea191fe | ||
|
|
20a984f259 | ||
|
|
2d91c83628 | ||
|
|
d7635dc7ee | ||
|
|
13136e606d | ||
|
|
5ae5144eda | ||
|
|
3e81d4ef8d | ||
|
|
8365fa3fa0 | ||
|
|
5681630e4c | ||
|
|
1eecae469d | ||
|
|
f7c8bf3949 | ||
|
|
d538838921 | ||
|
|
b5abddb69a |
No files matched your search
@@ -10,6 +10,7 @@
|
|||||||
"__": true
|
"__": true
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"no-console": 2,
|
||||||
"no-multi-spaces": 0,
|
"no-multi-spaces": 0,
|
||||||
"new-cap": 0,
|
"new-cap": 0,
|
||||||
"prefer-promise-reject-errors": 0,
|
"prefer-promise-reject-errors": 0,
|
||||||
|
|||||||
+63
-1
@@ -1,4 +1,66 @@
|
|||||||
|
# OSX
|
||||||
|
#
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# Xcode
|
||||||
|
#
|
||||||
|
build/
|
||||||
|
*.pbxuser
|
||||||
|
!default.pbxuser
|
||||||
|
*.mode1v3
|
||||||
|
!default.mode1v3
|
||||||
|
*.mode2v3
|
||||||
|
!default.mode2v3
|
||||||
|
*.perspectivev3
|
||||||
|
!default.perspectivev3
|
||||||
|
xcuserdata
|
||||||
|
*.xccheckout
|
||||||
|
*.moved-aside
|
||||||
|
DerivedData
|
||||||
|
*.hmap
|
||||||
|
*.ipa
|
||||||
|
*.xcuserstate
|
||||||
|
|
||||||
|
# Android/IntelliJ
|
||||||
|
#
|
||||||
|
build/
|
||||||
|
.idea
|
||||||
|
.gradle
|
||||||
|
local.properties
|
||||||
|
*.iml
|
||||||
|
|
||||||
|
# node.js
|
||||||
|
#
|
||||||
node_modules/
|
node_modules/
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
|
||||||
|
# BUCK
|
||||||
|
buck-out/
|
||||||
|
\.buckd/
|
||||||
|
*.keystore
|
||||||
|
!debug.keystore
|
||||||
|
|
||||||
|
# fastlane
|
||||||
|
#
|
||||||
|
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
|
||||||
|
# screenshots whenever they are needed.
|
||||||
|
# For more information about the recommended setup visit:
|
||||||
|
# https://docs.fastlane.tools/best-practices/source-control/
|
||||||
|
|
||||||
|
*/fastlane/report.xml
|
||||||
|
*/fastlane/Preview.html
|
||||||
|
*/fastlane/screenshots
|
||||||
|
|
||||||
|
# Bundle artifact
|
||||||
|
*.jsbundle
|
||||||
|
|
||||||
|
# CocoaPods
|
||||||
|
/ios/Pods/
|
||||||
|
|
||||||
|
# Other Files
|
||||||
|
android/app/google-services.json
|
||||||
*.log
|
*.log
|
||||||
.vagrant
|
.vagrant
|
||||||
|
android/app/build/*
|
||||||
|
android/bin
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
[submodule "android"]
|
||||||
|
path = android
|
||||||
|
url = https://github.com/lbryio/lbry-android
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2017-2019 LBRY Inc
|
Copyright (c) 2017-2020 LBRY Inc
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# LBRY Android
|
# LBRY React Native
|
||||||
[](https://ci.lbry.tech/lbry/lbry-android/commits/master)
|
[](https://ci.lbry.tech/lbry/lbry-android/commits/master)
|
||||||
|
|
||||||
An Android browser and wallet for the [LBRY](https://lbry.com) network. This app bundles [lbrynet-daemon](https://github.com/lbryio/lbry) as a background service with a UI layer built with React Native. The APK is built using buildozer and the Gradle build tool.
|
A mobile browser and wallet for the [LBRY](https://lbry.com) network. This app bundles [LBRY SDK](https://github.com/lbryio/lbry) as a background service with a UI layer built with React Native.
|
||||||
|
|
||||||
<img src="https://spee.ch/8/lbry-android.png" alt="LBRY Android Screenshot" width="384px" />
|
<img src="https://spee.ch/8/lbry-android.png" alt="LBRY Android Screenshot" width="384px" />
|
||||||
|
|
||||||
@@ -12,10 +12,41 @@ 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.
|
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
|
## 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** from the device's app drawer or via the shortcut on the home screen if that was created upon installation.
|
||||||
|
|
||||||
## Running from Source
|
## 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.
|
### Software Requirements
|
||||||
|
* Android Studio
|
||||||
|
* WebStorm (or other IDE for editing React Native / JavaScript code)
|
||||||
|
* npm
|
||||||
|
* yarn
|
||||||
|
|
||||||
|
### Android Steps
|
||||||
|
* Clone the repository using `git clone https://github.com/lbryio/lbry-react-native`
|
||||||
|
* Initialise the submodules.
|
||||||
|
```
|
||||||
|
cd lbry-react-native
|
||||||
|
git submodule update --init --recursive
|
||||||
|
```
|
||||||
|
* Install `react-native-cli` globally using `npm install -g react-native-cli`.
|
||||||
|
* Install the required package modules by running `yarn` in the cloned repository folder.
|
||||||
|
* Download a `google-services.json` from the Firebase console (https://console.firebase.google.com/) and place it in the `android/app` folder. Alternatively, use the included sample JSON file.
|
||||||
|
```
|
||||||
|
cp android/app/google-services.sample.json android/app/google-services.json
|
||||||
|
```
|
||||||
|
* Open Android Studio and click File > Open...
|
||||||
|
* Navigate to the cloned repository on your local filesystem and select the `android` subfolder.
|
||||||
|
* Connect your Android device in USB debugging mode, or create an ARM emulator (slower) to run the app.
|
||||||
|
* Click Run > Run... and select the corresponding app configuration. Note that it may take a while for the project files to sync before you can run the app
|
||||||
|
* In order to edit the React Native / JavaScript files, open the cloned repository folder using WebStorm (or your favourite IDE).
|
||||||
|
|
||||||
|
### React Native Fast Refresh
|
||||||
|
In order to enable fast refresh when updating React Native code
|
||||||
|
* Connect your Android device in USB debugging mode, or create an ARM emulator
|
||||||
|
* Run `adb reverse tcp:8081 tcp:8081` (`adb` can be found in the `platform-tools` folder of your Android SDK installation)
|
||||||
|
* Run `yarn start`
|
||||||
|
* Press `r` to reload the app.
|
||||||
|
* Anytime you make an update to the React Native code, the app should automatically refresh.
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
Contributions to this project are welcome, encouraged, and compensated. For more details, see https://lbry.io/faq/contributing
|
Contributions to this project are welcome, encouraged, and compensated. For more details, see https://lbry.io/faq/contributing
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
/**
|
||||||
|
* @format
|
||||||
|
*/
|
||||||
|
|
||||||
|
import 'react-native';
|
||||||
|
import React from 'react';
|
||||||
|
import App from '../App';
|
||||||
|
|
||||||
|
// Note: test renderer must be required after react-native.
|
||||||
|
import renderer from 'react-test-renderer';
|
||||||
|
|
||||||
|
it('renders correctly', () => {
|
||||||
|
renderer.create(<App />);
|
||||||
|
});
|
||||||
Submodule
+1
Submodule android added at ea8ac783a8.
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
react-native bundle --platform android --dev false --entry-file src/index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
if (__DEV__) {
|
if (__DEV__) {
|
||||||
import('./reactotron').then(() => console.log('Reactotron Configured'));
|
import('./reactotron').then(() => console.log('Reactotron Configured'));
|
||||||
}
|
}
|
||||||
|
|
||||||
import LBRYApp from './src/index';
|
import LBRYApp from './src/index';
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>en</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>$(PRODUCT_NAME)</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1</string>
|
||||||
|
<key>LSRequiresIPhoneOS</key>
|
||||||
|
<true/>
|
||||||
|
<key>NSAppTransportSecurity</key>
|
||||||
|
<dict>
|
||||||
|
<key>NSExceptionDomains</key>
|
||||||
|
<dict>
|
||||||
|
<key>localhost</key>
|
||||||
|
<dict>
|
||||||
|
<key>NSExceptionAllowsInsecureHTTPLoads</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>NSLocationWhenInUseUsageDescription</key>
|
||||||
|
<string></string>
|
||||||
|
<key>UILaunchStoryboardName</key>
|
||||||
|
<string>LaunchScreen</string>
|
||||||
|
<key>UIRequiredDeviceCapabilities</key>
|
||||||
|
<array>
|
||||||
|
<string>armv7</string>
|
||||||
|
</array>
|
||||||
|
<key>UISupportedInterfaceOrientations</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>en</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>$(PRODUCT_NAME)</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>BNDL</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1,782 @@
|
|||||||
|
// !$*UTF8*$!
|
||||||
|
{
|
||||||
|
archiveVersion = 1;
|
||||||
|
classes = {
|
||||||
|
};
|
||||||
|
objectVersion = 46;
|
||||||
|
objects = {
|
||||||
|
|
||||||
|
/* Begin PBXBuildFile section */
|
||||||
|
00E356F31AD99517003FC87E /* LbryAppTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* LbryAppTests.m */; };
|
||||||
|
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
|
||||||
|
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
|
||||||
|
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
|
||||||
|
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
|
||||||
|
2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
|
||||||
|
2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
|
||||||
|
2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
|
||||||
|
2DCD954D1E0B4F2C00145EB5 /* LbryAppTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* LbryAppTests.m */; };
|
||||||
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
|
/* Begin PBXContainerItemProxy section */
|
||||||
|
00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {
|
||||||
|
isa = PBXContainerItemProxy;
|
||||||
|
containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
|
||||||
|
proxyType = 1;
|
||||||
|
remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
|
||||||
|
remoteInfo = LbryApp;
|
||||||
|
};
|
||||||
|
2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */ = {
|
||||||
|
isa = PBXContainerItemProxy;
|
||||||
|
containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
|
||||||
|
proxyType = 1;
|
||||||
|
remoteGlobalIDString = 2D02E47A1E0B4A5D006451C7;
|
||||||
|
remoteInfo = "LbryApp-tvOS";
|
||||||
|
};
|
||||||
|
/* End PBXContainerItemProxy section */
|
||||||
|
|
||||||
|
/* Begin PBXFileReference section */
|
||||||
|
008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = "<group>"; };
|
||||||
|
00E356EE1AD99517003FC87E /* LbryAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LbryAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
|
00E356F21AD99517003FC87E /* LbryAppTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LbryAppTests.m; sourceTree = "<group>"; };
|
||||||
|
13B07F961A680F5B00A75B9A /* LbryApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LbryApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = LbryApp/AppDelegate.h; sourceTree = "<group>"; };
|
||||||
|
13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = LbryApp/AppDelegate.m; sourceTree = "<group>"; };
|
||||||
|
13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
|
||||||
|
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = LbryApp/Images.xcassets; sourceTree = "<group>"; };
|
||||||
|
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = LbryApp/Info.plist; sourceTree = "<group>"; };
|
||||||
|
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = LbryApp/main.m; sourceTree = "<group>"; };
|
||||||
|
2D02E47B1E0B4A5D006451C7 /* LbryApp-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "LbryApp-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
2D02E4901E0B4A5D006451C7 /* LbryApp-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "LbryApp-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
|
||||||
|
ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; };
|
||||||
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
00E356EB1AD99517003FC87E /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
2D02E4781E0B4A5D006451C7 /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
2D02E48D1E0B4A5D006451C7 /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXGroup section */
|
||||||
|
00E356EF1AD99517003FC87E /* LbryAppTests */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
00E356F21AD99517003FC87E /* LbryAppTests.m */,
|
||||||
|
00E356F01AD99517003FC87E /* Supporting Files */,
|
||||||
|
);
|
||||||
|
path = LbryAppTests;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
00E356F01AD99517003FC87E /* Supporting Files */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
00E356F11AD99517003FC87E /* Info.plist */,
|
||||||
|
);
|
||||||
|
name = "Supporting Files";
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
13B07FAE1A68108700A75B9A /* LbryApp */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
008F07F21AC5B25A0029DE68 /* main.jsbundle */,
|
||||||
|
13B07FAF1A68108700A75B9A /* AppDelegate.h */,
|
||||||
|
13B07FB01A68108700A75B9A /* AppDelegate.m */,
|
||||||
|
13B07FB51A68108700A75B9A /* Images.xcassets */,
|
||||||
|
13B07FB61A68108700A75B9A /* Info.plist */,
|
||||||
|
13B07FB11A68108700A75B9A /* LaunchScreen.xib */,
|
||||||
|
13B07FB71A68108700A75B9A /* main.m */,
|
||||||
|
);
|
||||||
|
name = LbryApp;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
|
||||||
|
ED2971642150620600B7C4FE /* JavaScriptCore.framework */,
|
||||||
|
);
|
||||||
|
name = Frameworks;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
);
|
||||||
|
name = Libraries;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
83CBB9F61A601CBA00E9B192 = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
13B07FAE1A68108700A75B9A /* LbryApp */,
|
||||||
|
832341AE1AAA6A7D00B99B32 /* Libraries */,
|
||||||
|
00E356EF1AD99517003FC87E /* LbryAppTests */,
|
||||||
|
83CBBA001A601CBA00E9B192 /* Products */,
|
||||||
|
2D16E6871FA4F8E400B85C8A /* Frameworks */,
|
||||||
|
);
|
||||||
|
indentWidth = 2;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
tabWidth = 2;
|
||||||
|
usesTabs = 0;
|
||||||
|
};
|
||||||
|
83CBBA001A601CBA00E9B192 /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
13B07F961A680F5B00A75B9A /* LbryApp.app */,
|
||||||
|
00E356EE1AD99517003FC87E /* LbryAppTests.xctest */,
|
||||||
|
2D02E47B1E0B4A5D006451C7 /* LbryApp-tvOS.app */,
|
||||||
|
2D02E4901E0B4A5D006451C7 /* LbryApp-tvOSTests.xctest */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXGroup section */
|
||||||
|
|
||||||
|
/* Begin PBXNativeTarget section */
|
||||||
|
00E356ED1AD99517003FC87E /* LbryAppTests */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "LbryAppTests" */;
|
||||||
|
buildPhases = (
|
||||||
|
00E356EA1AD99517003FC87E /* Sources */,
|
||||||
|
00E356EB1AD99517003FC87E /* Frameworks */,
|
||||||
|
00E356EC1AD99517003FC87E /* Resources */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
00E356F51AD99517003FC87E /* PBXTargetDependency */,
|
||||||
|
);
|
||||||
|
name = LbryAppTests;
|
||||||
|
productName = LbryAppTests;
|
||||||
|
productReference = 00E356EE1AD99517003FC87E /* LbryAppTests.xctest */;
|
||||||
|
productType = "com.apple.product-type.bundle.unit-test";
|
||||||
|
};
|
||||||
|
13B07F861A680F5B00A75B9A /* LbryApp */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "LbryApp" */;
|
||||||
|
buildPhases = (
|
||||||
|
FD10A7F022414F080027D42C /* Start Packager */,
|
||||||
|
13B07F871A680F5B00A75B9A /* Sources */,
|
||||||
|
13B07F8C1A680F5B00A75B9A /* Frameworks */,
|
||||||
|
13B07F8E1A680F5B00A75B9A /* Resources */,
|
||||||
|
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
);
|
||||||
|
name = LbryApp;
|
||||||
|
productName = "LbryApp";
|
||||||
|
productReference = 13B07F961A680F5B00A75B9A /* LbryApp.app */;
|
||||||
|
productType = "com.apple.product-type.application";
|
||||||
|
};
|
||||||
|
2D02E47A1E0B4A5D006451C7 /* LbryApp-tvOS */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "LbryApp-tvOS" */;
|
||||||
|
buildPhases = (
|
||||||
|
FD10A7F122414F3F0027D42C /* Start Packager */,
|
||||||
|
2D02E4771E0B4A5D006451C7 /* Sources */,
|
||||||
|
2D02E4781E0B4A5D006451C7 /* Frameworks */,
|
||||||
|
2D02E4791E0B4A5D006451C7 /* Resources */,
|
||||||
|
2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
);
|
||||||
|
name = "LbryApp-tvOS";
|
||||||
|
productName = "LbryApp-tvOS";
|
||||||
|
productReference = 2D02E47B1E0B4A5D006451C7 /* LbryApp-tvOS.app */;
|
||||||
|
productType = "com.apple.product-type.application";
|
||||||
|
};
|
||||||
|
2D02E48F1E0B4A5D006451C7 /* LbryApp-tvOSTests */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "LbryApp-tvOSTests" */;
|
||||||
|
buildPhases = (
|
||||||
|
2D02E48C1E0B4A5D006451C7 /* Sources */,
|
||||||
|
2D02E48D1E0B4A5D006451C7 /* Frameworks */,
|
||||||
|
2D02E48E1E0B4A5D006451C7 /* Resources */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */,
|
||||||
|
);
|
||||||
|
name = "LbryApp-tvOSTests";
|
||||||
|
productName = "LbryApp-tvOSTests";
|
||||||
|
productReference = 2D02E4901E0B4A5D006451C7 /* LbryApp-tvOSTests.xctest */;
|
||||||
|
productType = "com.apple.product-type.bundle.unit-test";
|
||||||
|
};
|
||||||
|
/* End PBXNativeTarget section */
|
||||||
|
|
||||||
|
/* Begin PBXProject section */
|
||||||
|
83CBB9F71A601CBA00E9B192 /* Project object */ = {
|
||||||
|
isa = PBXProject;
|
||||||
|
attributes = {
|
||||||
|
LastUpgradeCheck = 0940;
|
||||||
|
ORGANIZATIONNAME = Facebook;
|
||||||
|
TargetAttributes = {
|
||||||
|
00E356ED1AD99517003FC87E = {
|
||||||
|
CreatedOnToolsVersion = 6.2;
|
||||||
|
TestTargetID = 13B07F861A680F5B00A75B9A;
|
||||||
|
};
|
||||||
|
2D02E47A1E0B4A5D006451C7 = {
|
||||||
|
CreatedOnToolsVersion = 8.2.1;
|
||||||
|
ProvisioningStyle = Automatic;
|
||||||
|
};
|
||||||
|
2D02E48F1E0B4A5D006451C7 = {
|
||||||
|
CreatedOnToolsVersion = 8.2.1;
|
||||||
|
ProvisioningStyle = Automatic;
|
||||||
|
TestTargetID = 2D02E47A1E0B4A5D006451C7;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "LbryApp" */;
|
||||||
|
compatibilityVersion = "Xcode 3.2";
|
||||||
|
developmentRegion = English;
|
||||||
|
hasScannedForEncodings = 0;
|
||||||
|
knownRegions = (
|
||||||
|
en,
|
||||||
|
Base,
|
||||||
|
);
|
||||||
|
mainGroup = 83CBB9F61A601CBA00E9B192;
|
||||||
|
productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
|
||||||
|
projectDirPath = "";
|
||||||
|
projectRoot = "";
|
||||||
|
targets = (
|
||||||
|
13B07F861A680F5B00A75B9A /* LbryApp */,
|
||||||
|
00E356ED1AD99517003FC87E /* LbryAppTests */,
|
||||||
|
2D02E47A1E0B4A5D006451C7 /* LbryApp-tvOS */,
|
||||||
|
2D02E48F1E0B4A5D006451C7 /* LbryApp-tvOSTests */,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
/* End PBXProject section */
|
||||||
|
|
||||||
|
/* Begin PBXResourcesBuildPhase section */
|
||||||
|
00E356EC1AD99517003FC87E /* Resources */ = {
|
||||||
|
isa = PBXResourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
13B07F8E1A680F5B00A75B9A /* Resources */ = {
|
||||||
|
isa = PBXResourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
|
||||||
|
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
2D02E4791E0B4A5D006451C7 /* Resources */ = {
|
||||||
|
isa = PBXResourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
2D02E48E1E0B4A5D006451C7 /* Resources */ = {
|
||||||
|
isa = PBXResourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXResourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXShellScriptBuildPhase section */
|
||||||
|
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
name = "Bundle React Native code and images";
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
|
||||||
|
};
|
||||||
|
2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
name = "Bundle React Native Code And Images";
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
|
||||||
|
};
|
||||||
|
FD10A7F022414F080027D42C /* Start Packager */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputFileListPaths = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
name = "Start Packager";
|
||||||
|
outputFileListPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
|
||||||
|
showEnvVarsInLog = 0;
|
||||||
|
};
|
||||||
|
FD10A7F122414F3F0027D42C /* Start Packager */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputFileListPaths = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
name = "Start Packager";
|
||||||
|
outputFileListPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
|
||||||
|
showEnvVarsInLog = 0;
|
||||||
|
};
|
||||||
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
00E356EA1AD99517003FC87E /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
00E356F31AD99517003FC87E /* LbryAppTests.m in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
13B07F871A680F5B00A75B9A /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
|
||||||
|
13B07FC11A68108700A75B9A /* main.m in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
2D02E4771E0B4A5D006451C7 /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */,
|
||||||
|
2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
2D02E48C1E0B4A5D006451C7 /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
2DCD954D1E0B4F2C00145EB5 /* LbryAppTests.m in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXSourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXTargetDependency section */
|
||||||
|
00E356F51AD99517003FC87E /* PBXTargetDependency */ = {
|
||||||
|
isa = PBXTargetDependency;
|
||||||
|
target = 13B07F861A680F5B00A75B9A /* LbryApp */;
|
||||||
|
targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;
|
||||||
|
};
|
||||||
|
2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */ = {
|
||||||
|
isa = PBXTargetDependency;
|
||||||
|
target = 2D02E47A1E0B4A5D006451C7 /* LbryApp-tvOS */;
|
||||||
|
targetProxy = 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */;
|
||||||
|
};
|
||||||
|
/* End PBXTargetDependency section */
|
||||||
|
|
||||||
|
/* Begin PBXVariantGroup section */
|
||||||
|
13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = {
|
||||||
|
isa = PBXVariantGroup;
|
||||||
|
children = (
|
||||||
|
13B07FB21A68108700A75B9A /* Base */,
|
||||||
|
);
|
||||||
|
name = LaunchScreen.xib;
|
||||||
|
path = LbryApp;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXVariantGroup section */
|
||||||
|
|
||||||
|
/* Begin XCBuildConfiguration section */
|
||||||
|
00E356F61AD99517003FC87E /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
|
"DEBUG=1",
|
||||||
|
"$(inherited)",
|
||||||
|
);
|
||||||
|
INFOPLIST_FILE = LbryAppTests/Info.plist;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||||
|
OTHER_LDFLAGS = (
|
||||||
|
"-ObjC",
|
||||||
|
"-lc++",
|
||||||
|
"$(inherited)",
|
||||||
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LbryApp.app/LbryApp";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
00E356F71AD99517003FC87E /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
INFOPLIST_FILE = LbryAppTests/Info.plist;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||||
|
OTHER_LDFLAGS = (
|
||||||
|
"-ObjC",
|
||||||
|
"-lc++",
|
||||||
|
"$(inherited)",
|
||||||
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LbryApp.app/LbryApp";
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
13B07F941A680F5B00A75B9A /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
DEAD_CODE_STRIPPING = NO;
|
||||||
|
INFOPLIST_FILE = LbryApp/Info.plist;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||||
|
OTHER_LDFLAGS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"-ObjC",
|
||||||
|
"-lc++",
|
||||||
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
|
||||||
|
PRODUCT_NAME = LbryApp;
|
||||||
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
13B07F951A680F5B00A75B9A /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
INFOPLIST_FILE = LbryApp/Info.plist;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||||
|
OTHER_LDFLAGS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"-ObjC",
|
||||||
|
"-lc++",
|
||||||
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
|
||||||
|
PRODUCT_NAME = LbryApp;
|
||||||
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
2D02E4971E0B4A5E006451C7 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
|
||||||
|
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||||
|
ENABLE_TESTABILITY = YES;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
INFOPLIST_FILE = "LbryApp-tvOS/Info.plist";
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||||
|
OTHER_LDFLAGS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"-ObjC",
|
||||||
|
"-lc++",
|
||||||
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.LbryApp-tvOS";
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SDKROOT = appletvos;
|
||||||
|
TARGETED_DEVICE_FAMILY = 3;
|
||||||
|
TVOS_DEPLOYMENT_TARGET = 9.2;
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
2D02E4981E0B4A5E006451C7 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
|
||||||
|
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
INFOPLIST_FILE = "LbryApp-tvOS/Info.plist";
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||||
|
OTHER_LDFLAGS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"-ObjC",
|
||||||
|
"-lc++",
|
||||||
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.LbryApp-tvOS";
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SDKROOT = appletvos;
|
||||||
|
TARGETED_DEVICE_FAMILY = 3;
|
||||||
|
TVOS_DEPLOYMENT_TARGET = 9.2;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
2D02E4991E0B4A5E006451C7 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||||
|
ENABLE_TESTABILITY = YES;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
INFOPLIST_FILE = "LbryApp-tvOSTests/Info.plist";
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||||
|
OTHER_LDFLAGS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"-ObjC",
|
||||||
|
"-lc++",
|
||||||
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.LbryApp-tvOSTests";
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SDKROOT = appletvos;
|
||||||
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LbryApp-tvOS.app/LbryApp-tvOS";
|
||||||
|
TVOS_DEPLOYMENT_TARGET = 10.1;
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
2D02E49A1E0B4A5E006451C7 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
INFOPLIST_FILE = "LbryApp-tvOSTests/Info.plist";
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||||
|
OTHER_LDFLAGS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"-ObjC",
|
||||||
|
"-lc++",
|
||||||
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.LbryApp-tvOSTests";
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SDKROOT = appletvos;
|
||||||
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LbryApp-tvOS.app/LbryApp-tvOS";
|
||||||
|
TVOS_DEPLOYMENT_TARGET = 10.1;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
83CBBA201A601CBA00E9B192 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
ENABLE_TESTABILITY = YES;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
|
"DEBUG=1",
|
||||||
|
"$(inherited)",
|
||||||
|
);
|
||||||
|
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = YES;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
83CBBA211A601CBA00E9B192 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
|
COPY_PHASE_STRIP = YES;
|
||||||
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
VALIDATE_PRODUCT = YES;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
|
/* Begin XCConfigurationList section */
|
||||||
|
00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "LbryAppTests" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
00E356F61AD99517003FC87E /* Debug */,
|
||||||
|
00E356F71AD99517003FC87E /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "LbryApp" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
13B07F941A680F5B00A75B9A /* Debug */,
|
||||||
|
13B07F951A680F5B00A75B9A /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "LbryApp-tvOS" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
2D02E4971E0B4A5E006451C7 /* Debug */,
|
||||||
|
2D02E4981E0B4A5E006451C7 /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "LbryApp-tvOSTests" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
2D02E4991E0B4A5E006451C7 /* Debug */,
|
||||||
|
2D02E49A1E0B4A5E006451C7 /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "LbryApp" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
83CBBA201A601CBA00E9B192 /* Debug */,
|
||||||
|
83CBBA211A601CBA00E9B192 /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
/* End XCConfigurationList section */
|
||||||
|
};
|
||||||
|
rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
|
||||||
|
}
|
||||||
@@ -0,0 +1,129 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Scheme
|
||||||
|
LastUpgradeVersion = "0940"
|
||||||
|
version = "1.3">
|
||||||
|
<BuildAction
|
||||||
|
parallelizeBuildables = "NO"
|
||||||
|
buildImplicitDependencies = "YES">
|
||||||
|
<BuildActionEntries>
|
||||||
|
<BuildActionEntry
|
||||||
|
buildForTesting = "YES"
|
||||||
|
buildForRunning = "YES"
|
||||||
|
buildForProfiling = "YES"
|
||||||
|
buildForArchiving = "YES"
|
||||||
|
buildForAnalyzing = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "2D2A28121D9B038B00D4039D"
|
||||||
|
BuildableName = "libReact.a"
|
||||||
|
BlueprintName = "React-tvOS"
|
||||||
|
ReferencedContainer = "container:../node_modules/react-native/React/React.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildActionEntry>
|
||||||
|
<BuildActionEntry
|
||||||
|
buildForTesting = "YES"
|
||||||
|
buildForRunning = "YES"
|
||||||
|
buildForProfiling = "YES"
|
||||||
|
buildForArchiving = "YES"
|
||||||
|
buildForAnalyzing = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
|
||||||
|
BuildableName = "LbryApp-tvOS.app"
|
||||||
|
BlueprintName = "LbryApp-tvOS"
|
||||||
|
ReferencedContainer = "container:LbryApp.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildActionEntry>
|
||||||
|
<BuildActionEntry
|
||||||
|
buildForTesting = "YES"
|
||||||
|
buildForRunning = "YES"
|
||||||
|
buildForProfiling = "NO"
|
||||||
|
buildForArchiving = "NO"
|
||||||
|
buildForAnalyzing = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7"
|
||||||
|
BuildableName = "LbryApp-tvOSTests.xctest"
|
||||||
|
BlueprintName = "LbryApp-tvOSTests"
|
||||||
|
ReferencedContainer = "container:LbryApp.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildActionEntry>
|
||||||
|
</BuildActionEntries>
|
||||||
|
</BuildAction>
|
||||||
|
<TestAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||||
|
<Testables>
|
||||||
|
<TestableReference
|
||||||
|
skipped = "NO">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7"
|
||||||
|
BuildableName = "LbryApp-tvOSTests.xctest"
|
||||||
|
BlueprintName = "LbryApp-tvOSTests"
|
||||||
|
ReferencedContainer = "container:LbryApp.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</TestableReference>
|
||||||
|
</Testables>
|
||||||
|
<MacroExpansion>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
|
||||||
|
BuildableName = "LbryApp-tvOS.app"
|
||||||
|
BlueprintName = "LbryApp-tvOS"
|
||||||
|
ReferencedContainer = "container:LbryApp.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</MacroExpansion>
|
||||||
|
<AdditionalOptions>
|
||||||
|
</AdditionalOptions>
|
||||||
|
</TestAction>
|
||||||
|
<LaunchAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
launchStyle = "0"
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
|
debugDocumentVersioning = "YES"
|
||||||
|
debugServiceExtension = "internal"
|
||||||
|
allowLocationSimulation = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
|
||||||
|
BuildableName = "LbryApp-tvOS.app"
|
||||||
|
BlueprintName = "LbryApp-tvOS"
|
||||||
|
ReferencedContainer = "container:LbryApp.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
<AdditionalOptions>
|
||||||
|
</AdditionalOptions>
|
||||||
|
</LaunchAction>
|
||||||
|
<ProfileAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
|
savedToolIdentifier = ""
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
debugDocumentVersioning = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
|
||||||
|
BuildableName = "LbryApp-tvOS.app"
|
||||||
|
BlueprintName = "LbryApp-tvOS"
|
||||||
|
ReferencedContainer = "container:LbryApp.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
</ProfileAction>
|
||||||
|
<AnalyzeAction
|
||||||
|
buildConfiguration = "Debug">
|
||||||
|
</AnalyzeAction>
|
||||||
|
<ArchiveAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
revealArchiveInOrganizer = "YES">
|
||||||
|
</ArchiveAction>
|
||||||
|
</Scheme>
|
||||||
@@ -0,0 +1,129 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Scheme
|
||||||
|
LastUpgradeVersion = "0940"
|
||||||
|
version = "1.3">
|
||||||
|
<BuildAction
|
||||||
|
parallelizeBuildables = "NO"
|
||||||
|
buildImplicitDependencies = "YES">
|
||||||
|
<BuildActionEntries>
|
||||||
|
<BuildActionEntry
|
||||||
|
buildForTesting = "YES"
|
||||||
|
buildForRunning = "YES"
|
||||||
|
buildForProfiling = "YES"
|
||||||
|
buildForArchiving = "YES"
|
||||||
|
buildForAnalyzing = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "83CBBA2D1A601D0E00E9B192"
|
||||||
|
BuildableName = "libReact.a"
|
||||||
|
BlueprintName = "React"
|
||||||
|
ReferencedContainer = "container:../node_modules/react-native/React/React.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildActionEntry>
|
||||||
|
<BuildActionEntry
|
||||||
|
buildForTesting = "YES"
|
||||||
|
buildForRunning = "YES"
|
||||||
|
buildForProfiling = "YES"
|
||||||
|
buildForArchiving = "YES"
|
||||||
|
buildForAnalyzing = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
||||||
|
BuildableName = "LbryApp.app"
|
||||||
|
BlueprintName = "LbryApp"
|
||||||
|
ReferencedContainer = "container:LbryApp.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildActionEntry>
|
||||||
|
<BuildActionEntry
|
||||||
|
buildForTesting = "YES"
|
||||||
|
buildForRunning = "YES"
|
||||||
|
buildForProfiling = "NO"
|
||||||
|
buildForArchiving = "NO"
|
||||||
|
buildForAnalyzing = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
|
||||||
|
BuildableName = "LbryAppTests.xctest"
|
||||||
|
BlueprintName = "LbryAppTests"
|
||||||
|
ReferencedContainer = "container:LbryApp.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildActionEntry>
|
||||||
|
</BuildActionEntries>
|
||||||
|
</BuildAction>
|
||||||
|
<TestAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||||
|
<Testables>
|
||||||
|
<TestableReference
|
||||||
|
skipped = "NO">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
|
||||||
|
BuildableName = "LbryAppTests.xctest"
|
||||||
|
BlueprintName = "LbryAppTests"
|
||||||
|
ReferencedContainer = "container:LbryApp.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</TestableReference>
|
||||||
|
</Testables>
|
||||||
|
<MacroExpansion>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
||||||
|
BuildableName = "LbryApp.app"
|
||||||
|
BlueprintName = "LbryApp"
|
||||||
|
ReferencedContainer = "container:LbryApp.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</MacroExpansion>
|
||||||
|
<AdditionalOptions>
|
||||||
|
</AdditionalOptions>
|
||||||
|
</TestAction>
|
||||||
|
<LaunchAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
launchStyle = "0"
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
|
debugDocumentVersioning = "YES"
|
||||||
|
debugServiceExtension = "internal"
|
||||||
|
allowLocationSimulation = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
||||||
|
BuildableName = "LbryApp.app"
|
||||||
|
BlueprintName = "LbryApp"
|
||||||
|
ReferencedContainer = "container:LbryApp.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
<AdditionalOptions>
|
||||||
|
</AdditionalOptions>
|
||||||
|
</LaunchAction>
|
||||||
|
<ProfileAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
|
savedToolIdentifier = ""
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
debugDocumentVersioning = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
||||||
|
BuildableName = "LbryApp.app"
|
||||||
|
BlueprintName = "LbryApp"
|
||||||
|
ReferencedContainer = "container:LbryApp.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
</ProfileAction>
|
||||||
|
<AnalyzeAction
|
||||||
|
buildConfiguration = "Debug">
|
||||||
|
</AnalyzeAction>
|
||||||
|
<ArchiveAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
revealArchiveInOrganizer = "YES">
|
||||||
|
</ArchiveAction>
|
||||||
|
</Scheme>
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <React/RCTBridgeDelegate.h>
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>
|
||||||
|
|
||||||
|
@property (nonatomic, strong) UIWindow *window;
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "AppDelegate.h"
|
||||||
|
|
||||||
|
#import <React/RCTBridge.h>
|
||||||
|
#import <React/RCTBundleURLProvider.h>
|
||||||
|
#import <React/RCTRootView.h>
|
||||||
|
|
||||||
|
@implementation AppDelegate
|
||||||
|
|
||||||
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||||
|
{
|
||||||
|
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
|
||||||
|
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
|
||||||
|
moduleName:@"LbryApp"
|
||||||
|
initialProperties:nil];
|
||||||
|
|
||||||
|
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
|
||||||
|
|
||||||
|
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
||||||
|
UIViewController *rootViewController = [UIViewController new];
|
||||||
|
rootViewController.view = rootView;
|
||||||
|
self.window.rootViewController = rootViewController;
|
||||||
|
[self.window makeKeyAndVisible];
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
||||||
|
{
|
||||||
|
#if DEBUG
|
||||||
|
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
|
||||||
|
#else
|
||||||
|
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7702" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
|
||||||
|
<dependencies>
|
||||||
|
<deployment identifier="iOS"/>
|
||||||
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
|
||||||
|
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
|
||||||
|
</dependencies>
|
||||||
|
<objects>
|
||||||
|
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||||
|
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||||
|
<view contentMode="scaleToFill" id="iN0-l3-epB">
|
||||||
|
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
|
<subviews>
|
||||||
|
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Powered by React Native" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
|
||||||
|
<rect key="frame" x="20" y="439" width="441" height="21"/>
|
||||||
|
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||||
|
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||||
|
<nil key="highlightedColor"/>
|
||||||
|
</label>
|
||||||
|
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="LbryApp" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
|
||||||
|
<rect key="frame" x="20" y="140" width="441" height="43"/>
|
||||||
|
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
|
||||||
|
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||||
|
<nil key="highlightedColor"/>
|
||||||
|
</label>
|
||||||
|
</subviews>
|
||||||
|
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||||
|
<constraints>
|
||||||
|
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
|
||||||
|
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
|
||||||
|
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
|
||||||
|
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
|
||||||
|
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
|
||||||
|
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
|
||||||
|
</constraints>
|
||||||
|
<nil key="simulatedStatusBarMetrics"/>
|
||||||
|
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||||
|
<point key="canvasLocation" x="548" y="455"/>
|
||||||
|
</view>
|
||||||
|
</objects>
|
||||||
|
</document>
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"size" : "29x29",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"size" : "29x29",
|
||||||
|
"scale" : "3x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"size" : "40x40",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"size" : "40x40",
|
||||||
|
"scale" : "3x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"size" : "60x60",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"size" : "60x60",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>en</string>
|
||||||
|
<key>CFBundleDisplayName</key>
|
||||||
|
<string>LbryApp</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>$(PRODUCT_NAME)</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1</string>
|
||||||
|
<key>LSRequiresIPhoneOS</key>
|
||||||
|
<true/>
|
||||||
|
<key>NSAppTransportSecurity</key>
|
||||||
|
<dict>
|
||||||
|
<key>NSAllowsArbitraryLoads</key>
|
||||||
|
<true/>
|
||||||
|
<key>NSExceptionDomains</key>
|
||||||
|
<dict>
|
||||||
|
<key>localhost</key>
|
||||||
|
<dict>
|
||||||
|
<key>NSExceptionAllowsInsecureHTTPLoads</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>NSLocationWhenInUseUsageDescription</key>
|
||||||
|
<string></string>
|
||||||
|
<key>UILaunchStoryboardName</key>
|
||||||
|
<string>LaunchScreen</string>
|
||||||
|
<key>UIRequiredDeviceCapabilities</key>
|
||||||
|
<array>
|
||||||
|
<string>armv7</string>
|
||||||
|
</array>
|
||||||
|
<key>UISupportedInterfaceOrientations</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
#import "AppDelegate.h"
|
||||||
|
|
||||||
|
int main(int argc, char * argv[]) {
|
||||||
|
@autoreleasepool {
|
||||||
|
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>en</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>$(PRODUCT_NAME)</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>BNDL</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
#import <XCTest/XCTest.h>
|
||||||
|
|
||||||
|
#import <React/RCTLog.h>
|
||||||
|
#import <React/RCTRootView.h>
|
||||||
|
|
||||||
|
#define TIMEOUT_SECONDS 600
|
||||||
|
#define TEXT_TO_LOOK_FOR @"Welcome to React"
|
||||||
|
|
||||||
|
@interface LbryAppTests : XCTestCase
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation LbryAppTests
|
||||||
|
|
||||||
|
- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
|
||||||
|
{
|
||||||
|
if (test(view)) {
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
for (UIView *subview in [view subviews]) {
|
||||||
|
if ([self findSubviewInView:subview matching:test]) {
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)testRendersWelcomeScreen
|
||||||
|
{
|
||||||
|
UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
|
||||||
|
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
|
||||||
|
BOOL foundElement = NO;
|
||||||
|
|
||||||
|
__block NSString *redboxError = nil;
|
||||||
|
#ifdef DEBUG
|
||||||
|
RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
|
||||||
|
if (level >= RCTLogLevelError) {
|
||||||
|
redboxError = message;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
#endif
|
||||||
|
|
||||||
|
while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
|
||||||
|
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
||||||
|
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
||||||
|
|
||||||
|
foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
|
||||||
|
if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
return NO;
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
RCTSetLogFunction(RCTDefaultLogFunction);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
|
||||||
|
XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
+53
@@ -0,0 +1,53 @@
|
|||||||
|
platform :ios, '9.0'
|
||||||
|
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
|
||||||
|
|
||||||
|
target 'LbryApp' do
|
||||||
|
# Pods for LbryAndroid
|
||||||
|
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
|
||||||
|
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
|
||||||
|
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
|
||||||
|
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
|
||||||
|
pod 'React', :path => '../node_modules/react-native/'
|
||||||
|
pod 'React-Core', :path => '../node_modules/react-native/'
|
||||||
|
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
|
||||||
|
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
|
||||||
|
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
|
||||||
|
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
|
||||||
|
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
|
||||||
|
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
|
||||||
|
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
|
||||||
|
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
|
||||||
|
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
|
||||||
|
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
|
||||||
|
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
|
||||||
|
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
|
||||||
|
|
||||||
|
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
|
||||||
|
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
|
||||||
|
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
|
||||||
|
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
|
||||||
|
pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
|
||||||
|
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
|
||||||
|
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
|
||||||
|
|
||||||
|
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
|
||||||
|
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
|
||||||
|
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
|
||||||
|
|
||||||
|
target 'LbryAndroidTests' do
|
||||||
|
inherit! :search_paths
|
||||||
|
# Pods for testing
|
||||||
|
end
|
||||||
|
|
||||||
|
use_native_modules!
|
||||||
|
end
|
||||||
|
|
||||||
|
target 'LbryAndroid-tvOS' do
|
||||||
|
# Pods for LbryAndroid-tvOS
|
||||||
|
|
||||||
|
target 'LbryAndroid-tvOSTests' do
|
||||||
|
inherit! :search_paths
|
||||||
|
# Pods for testing
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
+62
-1
@@ -243,5 +243,66 @@
|
|||||||
"Are you a supermodel or rockstar that received a custom reward code? Claim it here.": "Are you a supermodel or rockstar that received a custom reward code? Claim it here.",
|
"Are you a supermodel or rockstar that received a custom reward code? Claim it here.": "Are you a supermodel or rockstar that received a custom reward code? Claim it here.",
|
||||||
"Redeem": "Redeem",
|
"Redeem": "Redeem",
|
||||||
"Please confirm that you want to use LBRY without creating an account.": "Please confirm that you want to use LBRY without creating an account.",
|
"Please confirm that you want to use LBRY without creating an account.": "Please confirm that you want to use LBRY without creating an account.",
|
||||||
"You sent %amount% LBC as a tip, Mahalo!": "You sent %amount% LBC as a tip, Mahalo!"
|
"You sent %amount% LBC as a tip, Mahalo!": "You sent %amount% LBC as a tip, Mahalo!",
|
||||||
|
"%follower% follower": "%follower% follower",
|
||||||
|
"Authenticating": "Authenticating",
|
||||||
|
"Waiting for authentication": "Waiting for authentication",
|
||||||
|
"Delete file": "Delete file",
|
||||||
|
"Are you sure you want to remove this file from your device?": "Are you sure you want to remove this file from your device?",
|
||||||
|
"Following": "Following",
|
||||||
|
"Update mailing preferences": "Update mailing preferences",
|
||||||
|
"Please confirm you want to tip %amount% credits": "Please confirm you want to tip %amount% credits",
|
||||||
|
"Send Tip": "Send Tip",
|
||||||
|
"You do not have any\ndownloaded content on this device.": "You do not have any\ndownloaded content on this device.",
|
||||||
|
"%view% view": "%view% view",
|
||||||
|
"No channel name after @.": "No channel name after @.",
|
||||||
|
"Loading transactions...": "Loading transactions...",
|
||||||
|
"Pending": "Pending",
|
||||||
|
"Phone Number": "Phone Number",
|
||||||
|
"Please provide a phone number to prevent fraud.": "Please provide a phone number to prevent fraud.",
|
||||||
|
"Send verification text": "Send verification text",
|
||||||
|
"Open": "Open",
|
||||||
|
"for": "for",
|
||||||
|
"Everyone": "Everyone",
|
||||||
|
"Suggested channels": "Suggested channels",
|
||||||
|
"You might also like": "You might also like",
|
||||||
|
"Publish something new": "Publish something new",
|
||||||
|
"Filter for": "Filter for",
|
||||||
|
"Tags you follow": "Tags you follow",
|
||||||
|
"Sort content by": "Sort content by",
|
||||||
|
"Trending content": "Trending content",
|
||||||
|
"New content": "New content",
|
||||||
|
"Top content": "Top content",
|
||||||
|
"Top": "Top",
|
||||||
|
"Past week": "Past week",
|
||||||
|
"It looks like you have not\npublished any content to LBRY yet.": "It looks like you have not\npublished any content to LBRY yet.",
|
||||||
|
"Stop": "Stop",
|
||||||
|
"Unsupported Content": "Unsupported Content",
|
||||||
|
"all tags you follow": "all tags you follow",
|
||||||
|
"Send LBC": "Send LBC",
|
||||||
|
"from": "from",
|
||||||
|
"This file cannot be displayed in the LBRY app.": "This file cannot be displayed in the LBRY app.",
|
||||||
|
"Please press the Play button.": "Please press the Play button.",
|
||||||
|
"Stop download": "Stop download",
|
||||||
|
"Are you sure you want to stop downloading this file?": "Are you sure you want to stop downloading this file?",
|
||||||
|
"The download will stop momentarily. You do not need to wait to discover something else.": "The download will stop momentarily. You do not need to wait to discover something else.",
|
||||||
|
"Connection Failure": "Connection Failure",
|
||||||
|
"We could not establish a connection to the SDK. Your data connection may be preventing LBRY from connecting. Contact hello@lbry.com if you think this is a software bug.": "We could not establish a connection to the SDK. Your data connection may be preventing LBRY from connecting. Contact hello@lbry.com if you think this is a software bug.",
|
||||||
|
"%num% block behind": "%num% block behind",
|
||||||
|
"Delete files": "Delete files",
|
||||||
|
"Are you sure you want to delete the selected content?": "Are you sure you want to delete the selected content?",
|
||||||
|
"We could not find any videos on your device. Take a photo or record a video to get started.": "We could not find any videos on your device. Take a photo or record a video to get started.",
|
||||||
|
"You have already published to the specified content address. Please enter a new address.": "You have already published to the specified content address. Please enter a new address.",
|
||||||
|
"Camera": "Camera",
|
||||||
|
"Please grant access to make use of your camera": "Please grant access to make use of your camera",
|
||||||
|
"OK": "OK",
|
||||||
|
"Audio": "Audio",
|
||||||
|
"Please grant access to record audio": "Please grant access to record audio",
|
||||||
|
"Camera not authorized": "Camera not authorized",
|
||||||
|
"There's nothing at this location.": "There's nothing at this location.",
|
||||||
|
"Publish something here": "Publish something here",
|
||||||
|
"This content cannot be viewed at this time. Please try again in a bit.": "This content cannot be viewed at this time. Please try again in a bit.",
|
||||||
|
"Download file": "Download file",
|
||||||
|
"Save %title% (%size%) to your device": "Save %title% (%size%) to your device",
|
||||||
|
"Save \"%title%\" (%size%) to your device": "Save \"%title%\" (%size%) to your device"
|
||||||
}
|
}
|
||||||
Generated
+244
-53
@@ -2073,6 +2073,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@react-native-community/masked-view": {
|
||||||
|
"version": "0.1.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@react-native-community/masked-view/-/masked-view-0.1.5.tgz",
|
||||||
|
"integrity": "sha512-Lj1DzfCmW0f4HnmHtEuX8Yy2f7cnUA8r5KGGUuDDGtQt1so6QJkKeUmsnLo2zYDtsF8due6hvIL06Vdo5xxuLQ=="
|
||||||
|
},
|
||||||
"@react-navigation/core": {
|
"@react-navigation/core": {
|
||||||
"version": "3.5.1",
|
"version": "3.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/@react-navigation/core/-/core-3.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/@react-navigation/core/-/core-3.5.1.tgz",
|
||||||
@@ -2111,6 +2116,21 @@
|
|||||||
"requires": {
|
"requires": {
|
||||||
"react-is": "^16.7.0"
|
"react-is": "^16.7.0"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"react-native-safe-area-view": {
|
||||||
|
"version": "0.14.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/react-native-safe-area-view/-/react-native-safe-area-view-0.14.8.tgz",
|
||||||
|
"integrity": "sha512-MtRSIcZNstxv87Jet+UsPhEd1tpGe8cVskDXlP657x6rHpSrbrc+y13ZNXrwAgGNNhqQNX7UJT68ZIq//ZRmvw==",
|
||||||
|
"requires": {
|
||||||
|
"hoist-non-react-statics": "^2.3.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"hoist-non-react-statics": {
|
||||||
|
"version": "2.5.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz",
|
||||||
|
"integrity": "sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw=="
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -7047,8 +7067,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lbry-redux": {
|
"lbry-redux": {
|
||||||
"version": "github:lbryio/lbry-redux#2c569a729bb40d45249ca38150b00922162b7ce3",
|
"version": "github:lbryio/lbry-redux#5c874e921769093428966fa7ecdf723719cb9067",
|
||||||
"from": "github:lbryio/lbry-redux#2c569a729bb40d45249ca38150b00922162b7ce3",
|
"from": "github:lbryio/lbry-redux#5c874e921769093428966fa7ecdf723719cb9067",
|
||||||
"requires": {
|
"requires": {
|
||||||
"proxy-polyfill": "0.1.6",
|
"proxy-polyfill": "0.1.6",
|
||||||
"reselect": "^3.0.0",
|
"reselect": "^3.0.0",
|
||||||
@@ -7056,8 +7076,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lbryinc": {
|
"lbryinc": {
|
||||||
"version": "github:lbryio/lbryinc#053ca52f4f7f9bf8eb62a3581b183671a475ad1c",
|
"version": "github:lbryio/lbryinc#0dc8829a319a708f45a855765f70a193ccb72676",
|
||||||
"from": "github:lbryio/lbryinc#053ca52f4f7f9bf8eb62a3581b183671a475ad1c",
|
"from": "github:lbryio/lbryinc#0dc8829a319a708f45a855765f70a193ccb72676",
|
||||||
"requires": {
|
"requires": {
|
||||||
"reselect": "^3.0.0"
|
"reselect": "^3.0.0"
|
||||||
}
|
}
|
||||||
@@ -9825,9 +9845,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"react-native-exception-handler": {
|
"react-native-exception-handler": {
|
||||||
"version": "2.9.0",
|
"version": "2.10.8",
|
||||||
"resolved": "https://registry.npmjs.org/react-native-exception-handler/-/react-native-exception-handler-2.9.0.tgz",
|
"resolved": "https://registry.npmjs.org/react-native-exception-handler/-/react-native-exception-handler-2.10.8.tgz",
|
||||||
"integrity": "sha512-XRHhGH5aM4lSenX4zZBa07JaszJGXeF8cv1KY314Q4qJWOihKWLpkdvwqwsBieZ2iy8DPhdAVioQzw8JLD/Okw=="
|
"integrity": "sha512-ZN+jwpADRkCUNdad/50k0mZdMoICGrGdtaxgvRU+pNcWRRBAXJhuo4+jY0eQaoVpx1ghycGE6tBu9ka8gL2NOQ=="
|
||||||
},
|
},
|
||||||
"react-native-fast-image": {
|
"react-native-fast-image": {
|
||||||
"version": "7.0.2",
|
"version": "7.0.2",
|
||||||
@@ -9885,18 +9905,20 @@
|
|||||||
"prop-types": "^15.5.10"
|
"prop-types": "^15.5.10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"react-native-progress-circle": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/react-native-progress-circle/-/react-native-progress-circle-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-VP0s92bgbTMQy4hQzPU4LlGyFj3z5u7i1HYFG8/yzXXfGkX1cxKS4xOlE+OTaObWC99w7Bodi3h8R7En2nQPYw=="
|
||||||
|
},
|
||||||
"react-native-reanimated": {
|
"react-native-reanimated": {
|
||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-1.4.0.tgz",
|
||||||
"integrity": "sha512-tO7nSNNP+iRLVbkcSS5GXyDBb7tSI02+XuRL3/S39EAr35rnvUy2JfeLUQG+fWSObJjnMVhasUDEUwlENk8IXw=="
|
"integrity": "sha512-tO7nSNNP+iRLVbkcSS5GXyDBb7tSI02+XuRL3/S39EAr35rnvUy2JfeLUQG+fWSObJjnMVhasUDEUwlENk8IXw=="
|
||||||
},
|
},
|
||||||
"react-native-safe-area-view": {
|
"react-native-safe-area-context": {
|
||||||
"version": "0.14.8",
|
"version": "0.6.2",
|
||||||
"resolved": "https://registry.npmjs.org/react-native-safe-area-view/-/react-native-safe-area-view-0.14.8.tgz",
|
"resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-0.6.2.tgz",
|
||||||
"integrity": "sha512-MtRSIcZNstxv87Jet+UsPhEd1tpGe8cVskDXlP657x6rHpSrbrc+y13ZNXrwAgGNNhqQNX7UJT68ZIq//ZRmvw==",
|
"integrity": "sha512-VtBW0JymVCwVt0TGxTv25Co3wtOv3Yb/K5pAUYkjKXNhWFDz5ZwUG/Yho/p0EkWYlFdroJcSqlvVFl2n3AU7SA=="
|
||||||
"requires": {
|
|
||||||
"hoist-non-react-statics": "^2.3.1"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"react-native-screens": {
|
"react-native-screens": {
|
||||||
"version": "1.0.0-alpha.23",
|
"version": "1.0.0-alpha.23",
|
||||||
@@ -9928,12 +9950,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"react-native-tab-view": {
|
"react-native-tab-view": {
|
||||||
"version": "1.4.1",
|
"version": "2.11.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-native-tab-view/-/react-native-tab-view-1.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/react-native-tab-view/-/react-native-tab-view-2.11.0.tgz",
|
||||||
"integrity": "sha512-Bke8KkDcDhvB/z0AS7MnQKMD2p6Kwfc1rSKlMOvg9CC5CnClQ2QEnhPSbwegKDYhUkBI92iH/BYy7hNSm5kbUQ==",
|
"integrity": "sha512-vqetlxGO7A8bnqvXcB50MWpRZAImXFrDGz1WCQKdCqe03Ey3ZzENe7yLuWrtBJYlepGfOLAsmCXv+wW82Yfm1w=="
|
||||||
"requires": {
|
|
||||||
"prop-types": "^15.6.1"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"react-native-vector-icons": {
|
"react-native-vector-icons": {
|
||||||
"version": "6.6.0",
|
"version": "6.6.0",
|
||||||
@@ -10096,36 +10115,31 @@
|
|||||||
"shaka-player": "^2.4.4"
|
"shaka-player": "^2.4.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"react-navigation": {
|
"react-native-webview": {
|
||||||
"version": "3.13.0",
|
"version": "8.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/react-navigation/-/react-navigation-3.13.0.tgz",
|
"resolved": "https://registry.npmjs.org/react-native-webview/-/react-native-webview-8.0.2.tgz",
|
||||||
"integrity": "sha512-r64bTImY2aNye8wtd39ubouVB6ZMJqjVQYKxH4LFmOav4FsI59fQTDN7sZzyJa29owowYw/wVkh+NWGT+tdD1A==",
|
"integrity": "sha512-Higfj0CCPM9N76S3rQsKHKS8Rw5QA7h7UENrREmMarEN/2saZJ+ko0aIVYOlEJ4P9ZhhRLNH/3mWvzmT4spncw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@react-navigation/core": "~3.5.1",
|
"escape-string-regexp": "2.0.0",
|
||||||
"@react-navigation/native": "~3.6.2",
|
"invariant": "2.2.4"
|
||||||
"react-navigation-drawer": "~1.4.0",
|
|
||||||
"react-navigation-stack": "1.5.3",
|
|
||||||
"react-navigation-tabs": "~1.2.0"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"react-navigation-drawer": {
|
"escape-string-regexp": {
|
||||||
"version": "1.4.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-navigation-drawer/-/react-navigation-drawer-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz",
|
||||||
"integrity": "sha512-ZyWBozcjB2aZ7vwCALv90cYA2NpDjM+WALaiYRshvPvue8l7cqynePbHK8GhlMGyJDwZqp4MxQmu8u1XAKp3Bw==",
|
"integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w=="
|
||||||
"requires": {
|
|
||||||
"react-native-tab-view": "^1.2.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"react-navigation-stack": {
|
|
||||||
"version": "1.5.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/react-navigation-stack/-/react-navigation-stack-1.5.3.tgz",
|
|
||||||
"integrity": "sha512-MQcwDVbZUYsTtDJb5cFOSm+K+e7KpUCoROaGoUOR+JHWE3uuaJ3pd/Nu+32a57J98TNBf4qq0+2TPJWl6z6IBg==",
|
|
||||||
"requires": {
|
|
||||||
"prop-types": "^15.7.2"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"react-navigation": {
|
||||||
|
"version": "4.0.10",
|
||||||
|
"resolved": "https://registry.npmjs.org/react-navigation/-/react-navigation-4.0.10.tgz",
|
||||||
|
"integrity": "sha512-7PqvmsdQ7HIyxPUMYbd9Uq//VoMdniEOLAOSvIhb/ExtbAt/1INSjUF+RiMWOMCWLTCNvNPRvTz7xy7qwWureg==",
|
||||||
|
"requires": {
|
||||||
|
"@react-navigation/core": "^3.5.1",
|
||||||
|
"@react-navigation/native": "^3.6.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"react-navigation-drawer": {
|
"react-navigation-drawer": {
|
||||||
"version": "2.3.3",
|
"version": "2.3.3",
|
||||||
"resolved": "https://registry.npmjs.org/react-navigation-drawer/-/react-navigation-drawer-2.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/react-navigation-drawer/-/react-navigation-drawer-2.3.3.tgz",
|
||||||
@@ -10140,21 +10154,47 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"react-navigation-stack": {
|
"react-navigation-stack": {
|
||||||
"version": "1.8.1",
|
"version": "1.10.3",
|
||||||
"resolved": "https://registry.npmjs.org/react-navigation-stack/-/react-navigation-stack-1.8.1.tgz",
|
"resolved": "https://registry.npmjs.org/react-navigation-stack/-/react-navigation-stack-1.10.3.tgz",
|
||||||
"integrity": "sha512-XOkHuYlQjZKnD4jTU0Ml847sKjpwsJpQ6JX4ZfOq8D0e6fPWXbpYNhvUnzHMHMm+tnbhTqkqP1Umu40Hmx748Q==",
|
"integrity": "sha512-1gksFi/g/Lg9sBhgLlD0OiEB5xnatHb4C0eNMA5tli9cTVlhq375XNPIqOiTyftibBmjdApAsZFj5srUCoOu/w==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"prop-types": "^15.7.2"
|
"prop-types": "^15.7.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"react-navigation-tabs": {
|
"react-navigation-tabs": {
|
||||||
"version": "1.2.0",
|
"version": "2.7.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-navigation-tabs/-/react-navigation-tabs-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/react-navigation-tabs/-/react-navigation-tabs-2.7.0.tgz",
|
||||||
"integrity": "sha512-I6vq3XX4ub9KhWQzcrggznls+2Z2C6w2ro46vokDGGvJ02CBpQRar7J0ETV29Ot5AJY67HucNUmZdH3yDFckmQ==",
|
"integrity": "sha512-fQEHjFrIBi+89loLL521HjGS0Z9tl4Y89SSamRkDl8Of6bPS1Ep++an3ctl2j7c3veqBZBrj3H1qa7qjd3apBQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"hoist-non-react-statics": "^2.5.0",
|
"hoist-non-react-statics": "^3.3.0",
|
||||||
"prop-types": "^15.6.1",
|
"react-lifecycles-compat": "^3.0.4",
|
||||||
"react-native-tab-view": "^1.4.1"
|
"react-native-safe-area-view": "^0.14.6",
|
||||||
|
"react-native-tab-view": "^2.11.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"hoist-non-react-statics": {
|
||||||
|
"version": "3.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz",
|
||||||
|
"integrity": "sha512-wbg3bpgA/ZqWrZuMOeJi8+SKMhr7X9TesL/rXMjTzh0p0JUBo3II8DHboYbuIXWRlttrUFxwcu/5kygrCw8fJw==",
|
||||||
|
"requires": {
|
||||||
|
"react-is": "^16.7.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"react-native-safe-area-view": {
|
||||||
|
"version": "0.14.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/react-native-safe-area-view/-/react-native-safe-area-view-0.14.8.tgz",
|
||||||
|
"integrity": "sha512-MtRSIcZNstxv87Jet+UsPhEd1tpGe8cVskDXlP657x6rHpSrbrc+y13ZNXrwAgGNNhqQNX7UJT68ZIq//ZRmvw==",
|
||||||
|
"requires": {
|
||||||
|
"hoist-non-react-statics": "^2.3.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"hoist-non-react-statics": {
|
||||||
|
"version": "2.5.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz",
|
||||||
|
"integrity": "sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"react-redux": {
|
"react-redux": {
|
||||||
@@ -10852,6 +10892,157 @@
|
|||||||
"resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz",
|
||||||
"integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww=="
|
"integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww=="
|
||||||
},
|
},
|
||||||
|
"showdown": {
|
||||||
|
"version": "1.9.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/showdown/-/showdown-1.9.1.tgz",
|
||||||
|
"integrity": "sha512-9cGuS382HcvExtf5AHk7Cb4pAeQQ+h0eTr33V1mu+crYWV4KvWAw6el92bDrqGEk5d46Ai/fhbEUwqJ/mTCNEA==",
|
||||||
|
"requires": {
|
||||||
|
"yargs": "^14.2"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-regex": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
|
||||||
|
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg=="
|
||||||
|
},
|
||||||
|
"ansi-styles": {
|
||||||
|
"version": "3.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
|
||||||
|
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
|
||||||
|
"requires": {
|
||||||
|
"color-convert": "^1.9.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"camelcase": {
|
||||||
|
"version": "5.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
|
||||||
|
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg=="
|
||||||
|
},
|
||||||
|
"cliui": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==",
|
||||||
|
"requires": {
|
||||||
|
"string-width": "^3.1.0",
|
||||||
|
"strip-ansi": "^5.2.0",
|
||||||
|
"wrap-ansi": "^5.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"find-up": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
|
||||||
|
"requires": {
|
||||||
|
"locate-path": "^3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"get-caller-file": {
|
||||||
|
"version": "2.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
|
||||||
|
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="
|
||||||
|
},
|
||||||
|
"is-fullwidth-code-point": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8="
|
||||||
|
},
|
||||||
|
"locate-path": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
|
||||||
|
"requires": {
|
||||||
|
"p-locate": "^3.0.0",
|
||||||
|
"path-exists": "^3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"p-limit": {
|
||||||
|
"version": "2.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz",
|
||||||
|
"integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==",
|
||||||
|
"requires": {
|
||||||
|
"p-try": "^2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"p-locate": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
|
||||||
|
"requires": {
|
||||||
|
"p-limit": "^2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"p-try": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ=="
|
||||||
|
},
|
||||||
|
"require-main-filename": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg=="
|
||||||
|
},
|
||||||
|
"string-width": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
|
||||||
|
"integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
|
||||||
|
"requires": {
|
||||||
|
"emoji-regex": "^7.0.1",
|
||||||
|
"is-fullwidth-code-point": "^2.0.0",
|
||||||
|
"strip-ansi": "^5.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"strip-ansi": {
|
||||||
|
"version": "5.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
|
||||||
|
"integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
|
||||||
|
"requires": {
|
||||||
|
"ansi-regex": "^4.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"wrap-ansi": {
|
||||||
|
"version": "5.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz",
|
||||||
|
"integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==",
|
||||||
|
"requires": {
|
||||||
|
"ansi-styles": "^3.2.0",
|
||||||
|
"string-width": "^3.0.0",
|
||||||
|
"strip-ansi": "^5.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"y18n": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w=="
|
||||||
|
},
|
||||||
|
"yargs": {
|
||||||
|
"version": "14.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.2.tgz",
|
||||||
|
"integrity": "sha512-/4ld+4VV5RnrynMhPZJ/ZpOCGSCeghMykZ3BhdFBDa9Wy/RH6uEGNWDJog+aUlq+9OM1CFTgtYRW5Is1Po9NOA==",
|
||||||
|
"requires": {
|
||||||
|
"cliui": "^5.0.0",
|
||||||
|
"decamelize": "^1.2.0",
|
||||||
|
"find-up": "^3.0.0",
|
||||||
|
"get-caller-file": "^2.0.1",
|
||||||
|
"require-directory": "^2.1.1",
|
||||||
|
"require-main-filename": "^2.0.0",
|
||||||
|
"set-blocking": "^2.0.0",
|
||||||
|
"string-width": "^3.0.0",
|
||||||
|
"which-module": "^2.0.0",
|
||||||
|
"y18n": "^4.0.0",
|
||||||
|
"yargs-parser": "^15.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"yargs-parser": {
|
||||||
|
"version": "15.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.0.tgz",
|
||||||
|
"integrity": "sha512-xLTUnCMc4JhxrPEPUYD5IBR1mWCK/aT6+RJ/K29JY2y1vD+FhtgKK0AXRWvI262q3QSffAQuTouFIKUuHX89wQ==",
|
||||||
|
"requires": {
|
||||||
|
"camelcase": "^5.0.0",
|
||||||
|
"decamelize": "^1.2.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"signal-exit": {
|
"signal-exit": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
|
||||||
|
|||||||
+88
-75
@@ -1,77 +1,90 @@
|
|||||||
{
|
{
|
||||||
"name": "LBRYApp",
|
"name": "LBRYApp",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"private": "true",
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node node_modules/react-native/local-cli/cli.js start",
|
"android": "react-native run-android",
|
||||||
"devtools": "react-devtools",
|
"ios": "react-native run-ios",
|
||||||
"format": "prettier 'src/**/*.{js,json}' --write",
|
"start": "react-native start",
|
||||||
"precommit": "lint-staged"
|
"test": "jest",
|
||||||
},
|
"lint": "eslint .",
|
||||||
"dependencies": {
|
"format": "prettier 'src/**/*.{js,json}' --write",
|
||||||
"base-64": "^0.1.0",
|
"precommit": "lint-staged"
|
||||||
"@expo/vector-icons": "^8.1.0",
|
},
|
||||||
"gfycat-style-urls": "^1.0.3",
|
"dependencies": {
|
||||||
"lbry-redux": "lbryio/lbry-redux#2c569a729bb40d45249ca38150b00922162b7ce3",
|
"base-64": "^0.1.0",
|
||||||
"lbryinc": "lbryio/lbryinc#053ca52f4f7f9bf8eb62a3581b183671a475ad1c",
|
"@expo/vector-icons": "^8.1.0",
|
||||||
"lodash": ">=4.17.11",
|
"gfycat-style-urls": "^1.0.3",
|
||||||
"merge": ">=1.2.1",
|
"lbry-redux": "lbryio/lbry-redux#f6e99498d2bc5b3f07e1e2b6f668a1a48de35047",
|
||||||
"moment": "^2.22.1",
|
"lbryinc": "lbryio/lbryinc#1fc104c2d29d1d3975234c3606e848eaa28e1b6e",
|
||||||
"react": "16.9.0",
|
"lodash": ">=4.17.11",
|
||||||
"react-native": "0.61.5",
|
"merge": ">=1.2.1",
|
||||||
"@react-native-community/async-storage": "^1.5.1",
|
"moment": "^2.22.1",
|
||||||
"react-native-camera": "^3.15.0",
|
"react": "16.9.0",
|
||||||
"react-native-country-picker-modal": "^1.10.0",
|
"react-native": "0.61.5",
|
||||||
"react-native-exception-handler": "2.9.0",
|
"@react-native-community/async-storage": "^1.5.1",
|
||||||
"react-native-fast-image": "^7.0.2",
|
"@react-native-community/masked-view": "^0.1.5",
|
||||||
"react-native-fs": "^2.13.3",
|
"react-native-camera": "^3.15.0",
|
||||||
"react-native-gesture-handler": "1.5.2",
|
"react-native-country-picker-modal": "^1.10.0",
|
||||||
"react-native-image-zoom-viewer": "^2.2.5",
|
"react-native-exception-handler": "2.10.8",
|
||||||
"react-native-password-strength-meter": "^0.0.2",
|
"react-native-fast-image": "^7.0.2",
|
||||||
"react-native-phone-input": "lbryio/react-native-phone-input",
|
"react-native-fs": "^2.16.6",
|
||||||
"react-native-reanimated": "1.4.0",
|
"react-native-gesture-handler": "1.5.2",
|
||||||
"react-native-snackbar": "2.0.4",
|
"react-native-image-zoom-viewer": "^2.2.5",
|
||||||
"react-native-super-grid": "^3.0.4",
|
"react-native-password-strength-meter": "^0.0.2",
|
||||||
"react-native-vector-icons": "^6.6.0",
|
"react-native-phone-input": "lbryio/react-native-phone-input",
|
||||||
"react-native-video": "lbryio/react-native-video#7992ff945872f9bd00a3736d9ff1318f343abf47",
|
"react-native-progress-circle": "2.1.0",
|
||||||
"react-navigation": "^3.13.0",
|
"react-native-reanimated": "1.4.0",
|
||||||
"react-navigation-drawer": "^2.3.3",
|
"react-native-safe-area-context": "^0.6.2",
|
||||||
"react-navigation-redux-helpers": "^3.0.2",
|
"react-native-screens": "^2.0.0",
|
||||||
"react-navigation-stack": "^1.8.1",
|
"react-native-snackbar": "2.0.4",
|
||||||
"react-redux": "^5.0.3",
|
"react-native-super-grid": "^3.0.4",
|
||||||
"redux": "^4.0.4",
|
"react-native-vector-icons": "^6.6.0",
|
||||||
"redux-persist": "^6.0.0",
|
"react-native-video": "lbryio/react-native-video#7992ff945872f9bd00a3736d9ff1318f343abf47",
|
||||||
"redux-persist-filesystem-storage": "^2.1.0",
|
"react-native-webview": "^8.0.2",
|
||||||
"redux-persist-transform-compress": "^4.2.0",
|
"react-navigation": "^4.0.10",
|
||||||
"redux-persist-transform-filter": "0.0.18",
|
"react-navigation-drawer": "2.3.3",
|
||||||
"redux-thunk": "^2.3.0",
|
"react-navigation-redux-helpers": "^3.0.2",
|
||||||
"rn-fetch-blob": "0.12.0",
|
"react-navigation-tabs": "^2.7.0",
|
||||||
"seedrandom": "3.0.3"
|
"react-navigation-stack": "^1.10.3",
|
||||||
},
|
"react-redux": "^5.0.3",
|
||||||
"devDependencies": {
|
"redux": "^4.0.4",
|
||||||
"@babel/core": "^7.6.2",
|
"redux-persist": "^6.0.0",
|
||||||
"babel-eslint": "10.0.2",
|
"redux-persist-filesystem-storage": "^2.1.0",
|
||||||
"@babel/plugin-proposal-object-rest-spread": "^7.5.4",
|
"redux-persist-transform-compress": "^4.2.0",
|
||||||
"babel-preset-env": "^1.6.1",
|
"redux-persist-transform-filter": "0.0.18",
|
||||||
"babel-preset-stage-2": "^6.18.0",
|
"redux-thunk": "^2.3.0",
|
||||||
"babel-plugin-module-resolver": "^3.1.1",
|
"rn-fetch-blob": "0.12.0",
|
||||||
"eslint": "^6.5.1",
|
"seedrandom": "3.0.3",
|
||||||
"eslint-config-standard": "^12.0.0",
|
"showdown": "1.9.1"
|
||||||
"eslint-config-standard-jsx": "^6.0.2",
|
},
|
||||||
"eslint-plugin-flowtype": "^2.46.1",
|
"devDependencies": {
|
||||||
"eslint-plugin-import": "^2.17.2",
|
"@babel/core": "^7.6.2",
|
||||||
"eslint-plugin-node": "^8.0.1",
|
"babel-eslint": "10.0.2",
|
||||||
"eslint-plugin-promise": "^4.1.1",
|
"@babel/plugin-proposal-object-rest-spread": "^7.5.4",
|
||||||
"eslint-plugin-react": "^7.12.4",
|
"babel-preset-env": "^1.6.1",
|
||||||
"eslint-plugin-standard": "^4.0.0",
|
"babel-preset-stage-2": "^6.18.0",
|
||||||
"flow-babel-webpack-plugin": "^1.1.1",
|
"babel-plugin-module-resolver": "^3.1.1",
|
||||||
"husky": "^0.14.3",
|
"eslint": "^6.5.1",
|
||||||
"lint-staged": "^7.0.4",
|
"eslint-config-standard": "^12.0.0",
|
||||||
"metro-react-native-babel-preset": "^0.56.0",
|
"eslint-config-standard-jsx": "^6.0.2",
|
||||||
"prettier": "^1.11.1",
|
"eslint-plugin-flowtype": "^2.46.1",
|
||||||
"@react-native-community/eslint-config": "^0.0.5",
|
"eslint-plugin-import": "^2.17.2",
|
||||||
"react-devtools": "^3.6.3",
|
"eslint-plugin-node": "^8.0.1",
|
||||||
"reactotron-react-native": "4.0.2",
|
"eslint-plugin-promise": "^4.1.1",
|
||||||
"reactotron-redux": "3.1.2"
|
"eslint-plugin-react": "^7.12.4",
|
||||||
}
|
"eslint-plugin-standard": "^4.0.0",
|
||||||
|
"flow-babel-webpack-plugin": "^1.1.1",
|
||||||
|
"husky": "^0.14.3",
|
||||||
|
"lint-staged": "^7.0.4",
|
||||||
|
"metro-react-native-babel-preset": "0.56.3",
|
||||||
|
"prettier": "^1.11.1",
|
||||||
|
"@react-native-community/eslint-config": "^0.0.5",
|
||||||
|
"react-devtools": "^3.6.3",
|
||||||
|
"reactotron-react-native": "4.0.2",
|
||||||
|
"reactotron-redux": "3.1.2"
|
||||||
|
},
|
||||||
|
"jest": {
|
||||||
|
"preset": "react-native"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+7
-3
@@ -1,8 +1,12 @@
|
|||||||
import AsyncStorage from '@react-native-community/async-storage';
|
import AsyncStorage from '@react-native-community/async-storage';
|
||||||
import Reactotron from 'reactotron-react-native'
|
import Reactotron from 'reactotron-react-native';
|
||||||
|
import { reactotronRedux } from 'reactotron-redux';
|
||||||
|
|
||||||
Reactotron
|
const reactotron = Reactotron
|
||||||
.setAsyncStorageHandler(AsyncStorage) // AsyncStorage would either come from `react-native` or `@react-native-community/async-storage` depending on where you get it from
|
.setAsyncStorageHandler(AsyncStorage) // AsyncStorage would either come from `react-native` or `@react-native-community/async-storage` depending on where you get it from
|
||||||
.configure() // controls connection & communication settings
|
.configure() // controls connection & communication settings
|
||||||
.useReactNative() // add all built-in react native plugins
|
.useReactNative() // add all built-in react native plugins
|
||||||
.connect(); // let's connect!
|
.use(reactotronRedux())
|
||||||
|
.connect();
|
||||||
|
|
||||||
|
export default reactotron;
|
||||||
@@ -5,7 +5,9 @@ import DiscoverPage from 'page/discover';
|
|||||||
import DownloadsPage from 'page/downloads';
|
import DownloadsPage from 'page/downloads';
|
||||||
import DrawerContent from 'component/drawerContent';
|
import DrawerContent from 'component/drawerContent';
|
||||||
import FilePage from 'page/file';
|
import FilePage from 'page/file';
|
||||||
|
import LiteFilePage from 'page/liteFile';
|
||||||
import FirstRunScreen from 'page/firstRun';
|
import FirstRunScreen from 'page/firstRun';
|
||||||
|
import InvitesPage from 'page/invites';
|
||||||
import PublishPage from 'page/publish';
|
import PublishPage from 'page/publish';
|
||||||
import PublishesPage from 'page/publishes';
|
import PublishesPage from 'page/publishes';
|
||||||
import RewardsPage from 'page/rewards';
|
import RewardsPage from 'page/rewards';
|
||||||
@@ -18,7 +20,7 @@ import SubscriptionsPage from 'page/subscriptions';
|
|||||||
import TransactionHistoryPage from 'page/transactionHistory';
|
import TransactionHistoryPage from 'page/transactionHistory';
|
||||||
import VerificationScreen from 'page/verification';
|
import VerificationScreen from 'page/verification';
|
||||||
import WalletPage from 'page/wallet';
|
import WalletPage from 'page/wallet';
|
||||||
import { NavigationActions } from 'react-navigation';
|
import { NavigationActions, StackActions } from 'react-navigation';
|
||||||
import { createDrawerNavigator } from 'react-navigation-drawer';
|
import { createDrawerNavigator } from 'react-navigation-drawer';
|
||||||
import { createStackNavigator } from 'react-navigation-stack';
|
import { createStackNavigator } from 'react-navigation-stack';
|
||||||
import {
|
import {
|
||||||
@@ -29,6 +31,7 @@ import {
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import {
|
import {
|
||||||
AppState,
|
AppState,
|
||||||
|
Alert,
|
||||||
BackHandler,
|
BackHandler,
|
||||||
DeviceEventEmitter,
|
DeviceEventEmitter,
|
||||||
Linking,
|
Linking,
|
||||||
@@ -38,7 +41,15 @@ import {
|
|||||||
ToastAndroid,
|
ToastAndroid,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import { selectDrawerStack } from 'redux/selectors/drawer';
|
import { selectDrawerStack } from 'redux/selectors/drawer';
|
||||||
import { SETTINGS, doDismissToast, doPopulateSharedUserState, doPreferenceGet, doToast, selectToast } from 'lbry-redux';
|
import {
|
||||||
|
ACTIONS,
|
||||||
|
SETTINGS,
|
||||||
|
doDismissToast,
|
||||||
|
doPopulateSharedUserState,
|
||||||
|
doPreferenceGet,
|
||||||
|
doToast,
|
||||||
|
selectToast,
|
||||||
|
} from 'lbry-redux';
|
||||||
import {
|
import {
|
||||||
Lbryio,
|
Lbryio,
|
||||||
doGetSync,
|
doGetSync,
|
||||||
@@ -67,24 +78,15 @@ import Snackbar from 'react-native-snackbar';
|
|||||||
|
|
||||||
const SYNC_GET_INTERVAL = 1000 * 60 * 5; // every 5 minutes
|
const SYNC_GET_INTERVAL = 1000 * 60 * 5; // every 5 minutes
|
||||||
|
|
||||||
const menuNavigationButton = navigation => (
|
|
||||||
<NavigationButton
|
|
||||||
name="bars"
|
|
||||||
size={24}
|
|
||||||
style={discoverStyle.drawerMenuButton}
|
|
||||||
iconStyle={discoverStyle.drawerHamburger}
|
|
||||||
onPress={() => navigation.openDrawer()}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
|
|
||||||
const discoverStack = createStackNavigator(
|
const discoverStack = createStackNavigator(
|
||||||
{
|
{
|
||||||
Discover: {
|
Subscriptions: {
|
||||||
screen: DiscoverPage,
|
screen: SubscriptionsPage,
|
||||||
navigationOptions: ({ navigation }) => ({
|
navigationOptions: {
|
||||||
title: 'Explore',
|
title: 'Following',
|
||||||
header: null,
|
header: null,
|
||||||
}),
|
drawerIcon: ({ tintColor }) => <Icon name="heart" solid size={drawerIconSize} style={{ color: tintColor }} />,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
File: {
|
File: {
|
||||||
screen: FilePage,
|
screen: FilePage,
|
||||||
@@ -108,7 +110,7 @@ const discoverStack = createStackNavigator(
|
|||||||
{
|
{
|
||||||
headerMode: 'screen',
|
headerMode: 'screen',
|
||||||
transitionConfig: () => ({ screenInterpolator: () => null }),
|
transitionConfig: () => ({ screenInterpolator: () => null }),
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
discoverStack.navigationOptions = ({ navigation }) => {
|
discoverStack.navigationOptions = ({ navigation }) => {
|
||||||
@@ -142,7 +144,7 @@ const walletStack = createStackNavigator(
|
|||||||
{
|
{
|
||||||
headerMode: 'screen',
|
headerMode: 'screen',
|
||||||
transitionConfig: () => ({ screenInterpolator: () => null }),
|
transitionConfig: () => ({ screenInterpolator: () => null }),
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
const drawerIconSize = 18;
|
const drawerIconSize = 18;
|
||||||
@@ -151,10 +153,17 @@ const drawer = createDrawerNavigator(
|
|||||||
DiscoverStack: {
|
DiscoverStack: {
|
||||||
screen: discoverStack,
|
screen: discoverStack,
|
||||||
navigationOptions: {
|
navigationOptions: {
|
||||||
title: 'Explore',
|
title: 'Following',
|
||||||
drawerIcon: ({ tintColor }) => <Icon name="home" size={drawerIconSize} style={{ color: tintColor }} />,
|
drawerIcon: ({ tintColor }) => <Icon name="home" size={drawerIconSize} style={{ color: tintColor }} />,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Discover: {
|
||||||
|
screen: DiscoverPage,
|
||||||
|
navigationOptions: ({ navigation }) => ({
|
||||||
|
title: 'Your Tags',
|
||||||
|
header: null,
|
||||||
|
}),
|
||||||
|
},
|
||||||
Trending: {
|
Trending: {
|
||||||
screen: TrendingPage,
|
screen: TrendingPage,
|
||||||
navigationOptions: {
|
navigationOptions: {
|
||||||
@@ -162,13 +171,6 @@ const drawer = createDrawerNavigator(
|
|||||||
drawerIcon: ({ tintColor }) => <Icon name="fire" size={drawerIconSize} style={{ color: tintColor }} />,
|
drawerIcon: ({ tintColor }) => <Icon name="fire" size={drawerIconSize} style={{ color: tintColor }} />,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Subscriptions: {
|
|
||||||
screen: SubscriptionsPage,
|
|
||||||
navigationOptions: {
|
|
||||||
title: 'Subscriptions',
|
|
||||||
drawerIcon: ({ tintColor }) => <Icon name="heart" solid size={drawerIconSize} style={{ color: tintColor }} />,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
WalletStack: {
|
WalletStack: {
|
||||||
screen: walletStack,
|
screen: walletStack,
|
||||||
navigationOptions: {
|
navigationOptions: {
|
||||||
@@ -202,6 +204,12 @@ const drawer = createDrawerNavigator(
|
|||||||
drawerIcon: ({ tintColor }) => <Icon name="award" size={drawerIconSize} style={{ color: tintColor }} />,
|
drawerIcon: ({ tintColor }) => <Icon name="award" size={drawerIconSize} style={{ color: tintColor }} />,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Invites: {
|
||||||
|
screen: InvitesPage,
|
||||||
|
navigationOptions: {
|
||||||
|
drawerIcon: ({ tintColor }) => <Icon name="user-friends" size={drawerIconSize} style={{ color: tintColor }} />,
|
||||||
|
},
|
||||||
|
},
|
||||||
Downloads: {
|
Downloads: {
|
||||||
screen: DownloadsPage,
|
screen: DownloadsPage,
|
||||||
navigationOptions: {
|
navigationOptions: {
|
||||||
@@ -225,17 +233,18 @@ const drawer = createDrawerNavigator(
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
drawerWidth: 300,
|
drawerWidth: 299,
|
||||||
drawerBackgroundColor: 'transparent',
|
drawerBackgroundColor: 'transparent',
|
||||||
headerMode: 'none',
|
headerMode: 'none',
|
||||||
backBehavior: 'none',
|
backBehavior: 'none',
|
||||||
unmountInactiveRoutes: true,
|
unmountInactiveRoutes: true,
|
||||||
contentComponent: DrawerContent,
|
contentComponent: DrawerContent,
|
||||||
|
overlayColor: 'rgba(0, 0, 0, 0.7)',
|
||||||
contentOptions: {
|
contentOptions: {
|
||||||
activeTintColor: Colors.LbryGreen,
|
activeTintColor: Colors.LbryGreen,
|
||||||
labelStyle: discoverStyle.menuText,
|
labelStyle: discoverStyle.menuText,
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
const mainStackNavigator = new createStackNavigator(
|
const mainStackNavigator = new createStackNavigator(
|
||||||
@@ -261,10 +270,16 @@ const mainStackNavigator = new createStackNavigator(
|
|||||||
drawerLockMode: 'locked-closed',
|
drawerLockMode: 'locked-closed',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
LiteFile: {
|
||||||
|
screen: LiteFilePage,
|
||||||
|
navigationOptions: {
|
||||||
|
drawerLockMode: 'locked-closed',
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
headerMode: 'none',
|
headerMode: 'none',
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
export const AppNavigator = mainStackNavigator;
|
export const AppNavigator = mainStackNavigator;
|
||||||
@@ -303,7 +318,7 @@ class AppWithNavigationState extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}.bind(this)
|
}.bind(this),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -312,6 +327,7 @@ class AppWithNavigationState extends React.Component {
|
|||||||
this.emailVerifyCheckInterval = setInterval(() => this.checkEmailVerification(), 5000);
|
this.emailVerifyCheckInterval = setInterval(() => this.checkEmailVerification(), 5000);
|
||||||
Linking.addEventListener('url', this._handleUrl);
|
Linking.addEventListener('url', this._handleUrl);
|
||||||
|
|
||||||
|
DeviceEventEmitter.addListener('onDownloadAborted', this.handleDownloadAborted);
|
||||||
DeviceEventEmitter.addListener('onDownloadStarted', this.handleDownloadStarted);
|
DeviceEventEmitter.addListener('onDownloadStarted', this.handleDownloadStarted);
|
||||||
DeviceEventEmitter.addListener('onDownloadUpdated', this.handleDownloadUpdated);
|
DeviceEventEmitter.addListener('onDownloadUpdated', this.handleDownloadUpdated);
|
||||||
DeviceEventEmitter.addListener('onDownloadCompleted', this.handleDownloadCompleted);
|
DeviceEventEmitter.addListener('onDownloadCompleted', this.handleDownloadCompleted);
|
||||||
@@ -346,7 +362,7 @@ class AppWithNavigationState extends React.Component {
|
|||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
/* failed */
|
/* failed */
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -368,7 +384,24 @@ class AppWithNavigationState extends React.Component {
|
|||||||
dispatch(doCompleteDownload(uri, outpoint, fileInfo));
|
dispatch(doCompleteDownload(uri, outpoint, fileInfo));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
handleDownloadAborted = evt => {
|
||||||
|
const { dispatch } = this.props;
|
||||||
|
const { uri, outpoint } = evt;
|
||||||
|
dispatch({
|
||||||
|
type: ACTIONS.DOWNLOADING_CANCELED,
|
||||||
|
data: { uri, outpoint },
|
||||||
|
});
|
||||||
|
|
||||||
|
dispatch({
|
||||||
|
type: ACTIONS.FILE_DELETE,
|
||||||
|
data: {
|
||||||
|
outpoint,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
|
DeviceEventEmitter.removeListener('onDownloadAborted', this.handleDownloadAborted);
|
||||||
DeviceEventEmitter.removeListener('onDownloadStarted', this.handleDownloadStarted);
|
DeviceEventEmitter.removeListener('onDownloadStarted', this.handleDownloadStarted);
|
||||||
DeviceEventEmitter.removeListener('onDownloadUpdated', this.handleDownloadUpdated);
|
DeviceEventEmitter.removeListener('onDownloadUpdated', this.handleDownloadUpdated);
|
||||||
DeviceEventEmitter.removeListener('onDownloadCompleted', this.handleDownloadCompleted);
|
DeviceEventEmitter.removeListener('onDownloadCompleted', this.handleDownloadCompleted);
|
||||||
@@ -503,7 +536,7 @@ class AppWithNavigationState extends React.Component {
|
|||||||
try {
|
try {
|
||||||
verification = JSON.parse(atob(evt.url.substring(15)));
|
verification = JSON.parse(atob(evt.url.substring(15)));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
// console.log(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (verification.token && verification.recaptcha) {
|
if (verification.token && verification.recaptcha) {
|
||||||
@@ -519,7 +552,7 @@ class AppWithNavigationState extends React.Component {
|
|||||||
dispatch(
|
dispatch(
|
||||||
doToast({
|
doToast({
|
||||||
message: 'Invalid Verification URI',
|
message: 'Invalid Verification URI',
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export default class ChannelIconItem extends React.PureComponent {
|
|||||||
<TouchableOpacity style={channelIconStyle.container} onPress={onPress}>
|
<TouchableOpacity style={channelIconStyle.container} onPress={onPress}>
|
||||||
{isResolvingUri && (
|
{isResolvingUri && (
|
||||||
<View style={channelIconStyle.centered}>
|
<View style={channelIconStyle.centered}>
|
||||||
<ActivityIndicator size={'small'} color={Colors.LbryGreen} />
|
<ActivityIndicator size={'small'} color={Colors.NextLbryGreen} />
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
<View
|
<View
|
||||||
|
|||||||
@@ -19,11 +19,11 @@ const select = state => ({
|
|||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
notify: data => dispatch(doToast(data)),
|
notify: data => dispatch(doToast(data)),
|
||||||
createChannel: (name, amount) => dispatch(doCreateChannel(name, amount)),
|
createChannel: (name, amount) => dispatch(doCreateChannel(name, amount)),
|
||||||
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
fetchChannelListMine: () => dispatch(doFetchChannelListMine(1, 99999, true)),
|
||||||
getSync: (password, callback) => dispatch(doGetSync(password, callback)),
|
getSync: (password, callback) => dispatch(doGetSync(password, callback)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
select,
|
select,
|
||||||
perform
|
perform,
|
||||||
)(ChannelSelector);
|
)(ChannelSelector);
|
||||||
@@ -36,10 +36,14 @@ export default class ChannelSelector extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
const { channels: prevChannels = [], channelName } = this.props;
|
const { channels: prevChannels = [], channelName: prevChannelName } = this.props;
|
||||||
const { channels = [] } = nextProps;
|
const { channels = [], channelName } = nextProps;
|
||||||
|
|
||||||
if (channels && channels.length !== prevChannels.length && channelName !== this.state.currentSelectedValue) {
|
if (channels && channels.length !== prevChannels.length && channelName !== this.state.currentSelectedValue) {
|
||||||
|
this.setState({ currentSelectedValue: prevChannelName });
|
||||||
|
}
|
||||||
|
|
||||||
|
if (channelName !== prevChannelName) {
|
||||||
this.setState({ currentSelectedValue: channelName });
|
this.setState({ currentSelectedValue: channelName });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -189,10 +193,11 @@ export default class ChannelSelector extends React.PureComponent {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const channel = this.state.addingChannel ? 'new' : this.props.channel;
|
const channel = this.state.addingChannel ? 'new' : this.props.channel;
|
||||||
const { balance, enabled, fetchingChannels, channels = [] } = this.props;
|
const { balance, enabled, fetchingChannels, channels = [], showAnonymous } = this.props;
|
||||||
const pickerItems = [Constants.ITEM_ANONYMOUS, Constants.ITEM_CREATE_A_CHANNEL].concat(
|
const pickerItems = (showAnonymous
|
||||||
channels ? channels.map(ch => ch.name) : []
|
? [Constants.ITEM_ANONYMOUS, Constants.ITEM_CREATE_A_CHANNEL]
|
||||||
);
|
: [Constants.ITEM_CREATE_A_CHANNEL]
|
||||||
|
).concat(channels ? channels.map(ch => ch.name) : []);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
newChannelName,
|
newChannelName,
|
||||||
@@ -264,7 +269,7 @@ export default class ChannelSelector extends React.PureComponent {
|
|||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
<View style={channelSelectorStyle.buttonContainer}>
|
<View style={channelSelectorStyle.buttonContainer}>
|
||||||
{creatingChannel && <ActivityIndicator size={'small'} color={Colors.LbryGreen} />}
|
{creatingChannel && <ActivityIndicator size={'small'} color={Colors.NextLbryGreen} />}
|
||||||
{!creatingChannel && (
|
{!creatingChannel && (
|
||||||
<View style={channelSelectorStyle.buttons}>
|
<View style={channelSelectorStyle.buttons}>
|
||||||
<Link style={channelSelectorStyle.cancelLink} text={__('Cancel')} onPress={this.handleCreateCancel} />
|
<Link style={channelSelectorStyle.cancelLink} text={__('Cancel')} onPress={this.handleCreateCancel} />
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
|||||||
import ClaimList from './view';
|
import ClaimList from './view';
|
||||||
|
|
||||||
const select = state => ({
|
const select = state => ({
|
||||||
showNsfwContent: selectShowNsfw(state),
|
|
||||||
claimSearchByQuery: selectClaimSearchByQuery(state),
|
claimSearchByQuery: selectClaimSearchByQuery(state),
|
||||||
lastPageReached: selectClaimSearchByQueryLastPageReached(state),
|
lastPageReached: selectClaimSearchByQueryLastPageReached(state),
|
||||||
loadingByQuery: selectFetchingClaimSearchByQuery(state),
|
loadingByQuery: selectFetchingClaimSearchByQuery(state),
|
||||||
loading: selectFetchingClaimSearch(state),
|
loading: selectFetchingClaimSearch(state),
|
||||||
|
showNsfwContent: selectShowNsfw(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
@@ -25,5 +25,5 @@ const perform = dispatch => ({
|
|||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
select,
|
select,
|
||||||
perform
|
perform,
|
||||||
)(ClaimList);
|
)(ClaimList);
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
import { connect } from 'react-redux';
|
||||||
|
import {
|
||||||
|
doResolveUri,
|
||||||
|
makeSelectClaimForUri,
|
||||||
|
makeSelectMetadataForUri,
|
||||||
|
makeSelectFileInfoForUri,
|
||||||
|
makeSelectIsUriResolving,
|
||||||
|
makeSelectClaimIsNsfw,
|
||||||
|
makeSelectShortUrlForUri,
|
||||||
|
makeSelectTitleForUri,
|
||||||
|
makeSelectThumbnailForUri,
|
||||||
|
} from 'lbry-redux';
|
||||||
|
import { doSetPlayerVisible } from 'redux/actions/drawer';
|
||||||
|
import { selectBlackListedOutpoints, selectFilteredOutpoints, selectRewardContentClaimIds } from 'lbryinc';
|
||||||
|
import { selectShowNsfw } from 'redux/selectors/settings';
|
||||||
|
import ClaimResultItem from './view';
|
||||||
|
|
||||||
|
const select = (state, props) => ({
|
||||||
|
blackListedOutpoints: selectBlackListedOutpoints(state),
|
||||||
|
claim: makeSelectClaimForUri(props.uri)(state),
|
||||||
|
fileInfo: makeSelectFileInfoForUri(props.uri)(state),
|
||||||
|
filteredOutpoints: selectFilteredOutpoints(state),
|
||||||
|
isDownloaded: !!makeSelectFileInfoForUri(props.uri)(state),
|
||||||
|
metadata: makeSelectMetadataForUri(props.uri)(state),
|
||||||
|
nsfw: makeSelectClaimIsNsfw(props.uri)(state),
|
||||||
|
isResolvingUri: makeSelectIsUriResolving(props.uri)(state),
|
||||||
|
obscureNsfw: !selectShowNsfw(state),
|
||||||
|
rewardedContentClaimIds: selectRewardContentClaimIds(state),
|
||||||
|
shortUrl: makeSelectShortUrlForUri(props.uri)(state),
|
||||||
|
title: makeSelectTitleForUri(props.uri)(state),
|
||||||
|
thumbnail: makeSelectThumbnailForUri(props.uri)(state),
|
||||||
|
});
|
||||||
|
|
||||||
|
const perform = dispatch => ({
|
||||||
|
resolveUri: uri => dispatch(doResolveUri(uri)),
|
||||||
|
setPlayerVisible: (visible, uri) => dispatch(doSetPlayerVisible(visible, uri)),
|
||||||
|
});
|
||||||
|
|
||||||
|
export default connect(
|
||||||
|
select,
|
||||||
|
perform,
|
||||||
|
)(ClaimResultItem);
|
||||||
@@ -0,0 +1,180 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { normalizeURI, parseURI } from 'lbry-redux';
|
||||||
|
import { ActivityIndicator, Platform, Text, TouchableOpacity, View } from 'react-native';
|
||||||
|
import { navigateToUri, getDownloadProgress, getStorageForFileInfo } from 'utils/helper';
|
||||||
|
import Colors from 'styles/colors';
|
||||||
|
import ChannelIconItem from 'component/channelIconItem';
|
||||||
|
import channelIconStyle from 'styles/channelIcon';
|
||||||
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
|
import DateTime from 'component/dateTime';
|
||||||
|
import FastImage from 'react-native-fast-image';
|
||||||
|
import FileItemMedia from 'component/fileItemMedia';
|
||||||
|
import FilePrice from 'component/filePrice';
|
||||||
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||||
|
import Link from 'component/link';
|
||||||
|
import NsfwOverlay from 'component/nsfwOverlay';
|
||||||
|
import ProgressBar from 'component/progressBar';
|
||||||
|
import fileListStyle from 'styles/fileList';
|
||||||
|
import seedrandom from 'seedrandom';
|
||||||
|
|
||||||
|
class ClaimResultItem extends React.PureComponent {
|
||||||
|
state = {
|
||||||
|
autoStyle: null,
|
||||||
|
};
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
const { result } = this.props;
|
||||||
|
|
||||||
|
if (!result || !result.name || !result.claimId) {
|
||||||
|
this.setState({
|
||||||
|
autoStyle:
|
||||||
|
ChannelIconItem.AUTO_THUMB_STYLES[Math.floor(Math.random() * ChannelIconItem.AUTO_THUMB_STYLES.length)],
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// result property set, use deterministic random style
|
||||||
|
const rng = seedrandom(normalizeURI(`${result.name}#${result.claimId}`));
|
||||||
|
const index = Math.floor(rng.quick() * ChannelIconItem.AUTO_THUMB_STYLES.length);
|
||||||
|
this.setState({ autoStyle: ChannelIconItem.AUTO_THUMB_STYLES[index] });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onPressHandler = () => {
|
||||||
|
const { autoplay, navigation, result, urlOpenHandler, setPlayerVisible } = this.props;
|
||||||
|
const { claimId, name } = result;
|
||||||
|
const url = normalizeURI(`${name}#${claimId}`);
|
||||||
|
if (urlOpenHandler) {
|
||||||
|
urlOpenHandler(url);
|
||||||
|
} else {
|
||||||
|
navigateToUri(navigation, url, { autoplay }, false, url, setPlayerVisible);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { fileInfo, navigation, obscureNsfw, result, rewardedContentClaimIds, setPlayerVisible, style } = this.props;
|
||||||
|
const {
|
||||||
|
channel,
|
||||||
|
channel_claim_id: channelClaimId,
|
||||||
|
claimId,
|
||||||
|
duration,
|
||||||
|
fee,
|
||||||
|
name,
|
||||||
|
nsfw,
|
||||||
|
release_time: releaseTime,
|
||||||
|
thumbnail_url: thumbnailUrl,
|
||||||
|
title,
|
||||||
|
} = result;
|
||||||
|
|
||||||
|
const isChannel = name && name.startsWith('@');
|
||||||
|
const hasThumbnail = !!thumbnailUrl;
|
||||||
|
const obscure = obscureNsfw && nsfw;
|
||||||
|
const url = normalizeURI(`${name}#${claimId}`);
|
||||||
|
const hasChannel = !!channel;
|
||||||
|
const channelUrl = hasChannel ? normalizeURI(`${channel}#${channelClaimId}`) : null;
|
||||||
|
const isRewardContent = rewardedContentClaimIds.includes(claimId);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={style}>
|
||||||
|
<TouchableOpacity
|
||||||
|
style={[style, isChannel ? fileListStyle.channelContainer : null]}
|
||||||
|
onPress={this.onPressHandler}
|
||||||
|
>
|
||||||
|
{!isChannel && (
|
||||||
|
<FileItemMedia
|
||||||
|
style={fileListStyle.thumbnail}
|
||||||
|
duration={duration}
|
||||||
|
resizeMode="cover"
|
||||||
|
title={title || name || normalizeURI(url).substring(7)}
|
||||||
|
thumbnail={thumbnailUrl}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{isChannel && (
|
||||||
|
<View style={fileListStyle.channelThumbnailView}>
|
||||||
|
<View style={[fileListStyle.channelThumbnailContainer, this.state.autoStyle]}>
|
||||||
|
{hasThumbnail && (
|
||||||
|
<FastImage
|
||||||
|
style={fileListStyle.channelThumbnail}
|
||||||
|
resizeMode={FastImage.resizeMode.cover}
|
||||||
|
source={{ uri: thumbnailUrl }}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{!hasThumbnail && (
|
||||||
|
<Text style={channelIconStyle.autothumbCharacter}>
|
||||||
|
{title ? title.substring(0, 1).toUpperCase() : name.substring(1, 2).toUpperCase()}
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{fileInfo && fileInfo.completed && fileInfo.download_path && (
|
||||||
|
<Icon style={fileListStyle.downloadedIcon} solid color={Colors.NextLbryGreen} name={'folder'} size={16} />
|
||||||
|
)}
|
||||||
|
<FilePrice
|
||||||
|
cost={fee ? parseFloat(fee) / 100000000 : 0}
|
||||||
|
uri={url}
|
||||||
|
style={fileListStyle.filePriceContainer}
|
||||||
|
iconStyle={fileListStyle.filePriceIcon}
|
||||||
|
textStyle={fileListStyle.filePriceText}
|
||||||
|
/>
|
||||||
|
<View style={fileListStyle.detailsContainer}>
|
||||||
|
{(title || name) && (
|
||||||
|
<View style={fileListStyle.titleContainer}>
|
||||||
|
<Text style={fileListStyle.title} numberOfLines={3}>
|
||||||
|
{title || name}
|
||||||
|
</Text>
|
||||||
|
{isRewardContent && <Icon style={fileListStyle.rewardIcon} name="award" size={12} />}
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{(hasChannel || isChannel) && (
|
||||||
|
<Link
|
||||||
|
style={fileListStyle.publisher}
|
||||||
|
text={isChannel ? name : channel}
|
||||||
|
onPress={() => {
|
||||||
|
navigateToUri(
|
||||||
|
navigation,
|
||||||
|
normalizeURI(isChannel ? url : channelUrl),
|
||||||
|
null,
|
||||||
|
false,
|
||||||
|
isChannel ? url : channelUrl,
|
||||||
|
setPlayerVisible,
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<View style={fileListStyle.info}>
|
||||||
|
{fileInfo && !isNaN(fileInfo.written_bytes) && fileInfo.written_bytes > 0 && (
|
||||||
|
<Text style={fileListStyle.infoText}>{getStorageForFileInfo(fileInfo)}</Text>
|
||||||
|
)}
|
||||||
|
<DateTime
|
||||||
|
style={fileListStyle.publishInfo}
|
||||||
|
textStyle={fileListStyle.infoText}
|
||||||
|
timeAgo
|
||||||
|
date={releaseTime}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{fileInfo && fileInfo.download_path && (
|
||||||
|
<View style={fileListStyle.downloadInfo}>
|
||||||
|
{!fileInfo.completed && (
|
||||||
|
<ProgressBar
|
||||||
|
borderRadius={3}
|
||||||
|
color={Colors.NextLbryGreen}
|
||||||
|
height={3}
|
||||||
|
style={fileListStyle.progress}
|
||||||
|
progress={getDownloadProgress(fileInfo)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
</TouchableOpacity>
|
||||||
|
{obscure && <NsfwOverlay onPress={() => navigation.navigate({ routeName: 'Settings', key: 'settingsPage' })} />}
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ClaimResultItem;
|
||||||
@@ -9,10 +9,10 @@ const select = state => ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
fetchChannelListMine: () => dispatch(doFetchChannelListMine(1, 99999, true)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
select,
|
select,
|
||||||
perform
|
perform,
|
||||||
)(DrawerContent);
|
)(DrawerContent);
|
||||||
@@ -9,8 +9,8 @@ import discoverStyle from 'styles/discover';
|
|||||||
|
|
||||||
const groupedMenuItems = {
|
const groupedMenuItems = {
|
||||||
'Find content': [
|
'Find content': [
|
||||||
|
{ icon: 'heart', solid: true, label: 'Following', route: Constants.DRAWER_ROUTE_SUBSCRIPTIONS },
|
||||||
{ icon: 'hashtag', label: 'Your Tags', route: Constants.DRAWER_ROUTE_DISCOVER },
|
{ icon: 'hashtag', label: 'Your Tags', route: Constants.DRAWER_ROUTE_DISCOVER },
|
||||||
{ icon: 'heart', solid: true, label: 'Subscriptions', route: Constants.DRAWER_ROUTE_SUBSCRIPTIONS },
|
|
||||||
{ icon: 'globe-americas', label: 'All Content', route: Constants.DRAWER_ROUTE_TRENDING },
|
{ icon: 'globe-americas', label: 'All Content', route: Constants.DRAWER_ROUTE_TRENDING },
|
||||||
],
|
],
|
||||||
'Your content': [
|
'Your content': [
|
||||||
@@ -22,6 +22,7 @@ const groupedMenuItems = {
|
|||||||
Wallet: [
|
Wallet: [
|
||||||
{ icon: 'wallet', label: 'Wallet', route: Constants.DRAWER_ROUTE_WALLET },
|
{ icon: 'wallet', label: 'Wallet', route: Constants.DRAWER_ROUTE_WALLET },
|
||||||
{ icon: 'award', label: 'Rewards', route: Constants.DRAWER_ROUTE_REWARDS },
|
{ icon: 'award', label: 'Rewards', route: Constants.DRAWER_ROUTE_REWARDS },
|
||||||
|
{ icon: 'user-friends', label: 'Invites', route: Constants.DRAWER_ROUTE_INVITES },
|
||||||
],
|
],
|
||||||
Settings: [
|
Settings: [
|
||||||
{ icon: 'cog', label: 'Settings', route: Constants.DRAWER_ROUTE_SETTINGS },
|
{ icon: 'cog', label: 'Settings', route: Constants.DRAWER_ROUTE_SETTINGS },
|
||||||
@@ -144,7 +145,7 @@ class DrawerContent extends React.PureComponent {
|
|||||||
const focused =
|
const focused =
|
||||||
activeItemKey === item.route ||
|
activeItemKey === item.route ||
|
||||||
(activeItemKey === Constants.FULL_ROUTE_NAME_DISCOVER &&
|
(activeItemKey === Constants.FULL_ROUTE_NAME_DISCOVER &&
|
||||||
item.route === Constants.DRAWER_ROUTE_DISCOVER) ||
|
item.route === Constants.DRAWER_ROUTE_SUBSCRIPTIONS) ||
|
||||||
(activeItemKey === Constants.FULL_ROUTE_NAME_WALLET &&
|
(activeItemKey === Constants.FULL_ROUTE_NAME_WALLET &&
|
||||||
item.route === Constants.DRAWER_ROUTE_WALLET);
|
item.route === Constants.DRAWER_ROUTE_WALLET);
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ class FileDownloadButton extends React.PureComponent {
|
|||||||
fileInfo,
|
fileInfo,
|
||||||
downloading,
|
downloading,
|
||||||
uri,
|
uri,
|
||||||
purchaseUri,
|
|
||||||
costInfo,
|
costInfo,
|
||||||
isPlayable,
|
isPlayable,
|
||||||
isViewable,
|
isViewable,
|
||||||
@@ -44,7 +43,17 @@ class FileDownloadButton extends React.PureComponent {
|
|||||||
onButtonLayout,
|
onButtonLayout,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
if ((fileInfo && !fileInfo.stopped) || loading || downloading) {
|
if (fileInfo && fileInfo.download_path && fileInfo.completed) {
|
||||||
|
return (
|
||||||
|
<TouchableOpacity
|
||||||
|
onLayout={onButtonLayout}
|
||||||
|
style={[style, fileDownloadButtonStyle.container]}
|
||||||
|
onPress={openFile}
|
||||||
|
>
|
||||||
|
<Text style={fileDownloadButtonStyle.text}>{isViewable ? __('View') : __('Open')}</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
);
|
||||||
|
} else if ((fileInfo && !fileInfo.stopped) || loading || downloading) {
|
||||||
const progress = fileInfo && fileInfo.written_bytes ? (fileInfo.written_bytes / fileInfo.total_bytes) * 100 : 0,
|
const progress = fileInfo && fileInfo.written_bytes ? (fileInfo.written_bytes / fileInfo.total_bytes) * 100 : 0,
|
||||||
label = fileInfo ? __('%progress%% complete', { progress: progress.toFixed(0) }) : __('Connecting...');
|
label = fileInfo ? __('%progress%% complete', { progress: progress.toFixed(0) }) : __('Connecting...');
|
||||||
|
|
||||||
@@ -71,16 +80,6 @@ class FileDownloadButton extends React.PureComponent {
|
|||||||
onPress={onFileActionPress}
|
onPress={onFileActionPress}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
} else if (fileInfo && fileInfo.download_path) {
|
|
||||||
return (
|
|
||||||
<TouchableOpacity
|
|
||||||
onLayout={onButtonLayout}
|
|
||||||
style={[style, fileDownloadButtonStyle.container]}
|
|
||||||
onPress={openFile}
|
|
||||||
>
|
|
||||||
<Text style={fileDownloadButtonStyle.text}>{isViewable ? __('View') : __('Open')}</Text>
|
|
||||||
</TouchableOpacity>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
makeSelectClaimIsNsfw,
|
makeSelectClaimIsNsfw,
|
||||||
makeSelectShortUrlForUri,
|
makeSelectShortUrlForUri,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
|
import { doSetPlayerVisible } from 'redux/actions/drawer';
|
||||||
import { selectBlackListedOutpoints, selectFilteredOutpoints, selectRewardContentClaimIds } from 'lbryinc';
|
import { selectBlackListedOutpoints, selectFilteredOutpoints, selectRewardContentClaimIds } from 'lbryinc';
|
||||||
import { selectShowNsfw } from 'redux/selectors/settings';
|
import { selectShowNsfw } from 'redux/selectors/settings';
|
||||||
import FileItem from './view';
|
import FileItem from './view';
|
||||||
@@ -31,9 +32,10 @@ const select = (state, props) => ({
|
|||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
resolveUri: uri => dispatch(doResolveUri(uri)),
|
resolveUri: uri => dispatch(doResolveUri(uri)),
|
||||||
|
setPlayerVisible: (visible, uri) => dispatch(doSetPlayerVisible(visible, uri)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
select,
|
select,
|
||||||
perform
|
perform,
|
||||||
)(FileItem);
|
)(FileItem);
|
||||||
@@ -56,6 +56,7 @@ class FileItem extends React.PureComponent {
|
|||||||
obscureNsfw,
|
obscureNsfw,
|
||||||
showDetails,
|
showDetails,
|
||||||
compactView,
|
compactView,
|
||||||
|
setPlayerVisible,
|
||||||
titleBeforeThumbnail,
|
titleBeforeThumbnail,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
@@ -107,7 +108,12 @@ class FileItem extends React.PureComponent {
|
|||||||
<Icon style={discoverStyle.downloadedIcon} solid color={Colors.NextLbryGreen} name={'folder'} size={16} />
|
<Icon style={discoverStyle.downloadedIcon} solid color={Colors.NextLbryGreen} name={'folder'} size={16} />
|
||||||
)}
|
)}
|
||||||
{!compactView && (!fileInfo || !fileInfo.completed || !fileInfo.download_path) && (
|
{!compactView && (!fileInfo || !fileInfo.completed || !fileInfo.download_path) && (
|
||||||
<FilePrice uri={uri} style={discoverStyle.filePriceContainer} textStyle={discoverStyle.filePriceText} />
|
<FilePrice
|
||||||
|
uri={uri}
|
||||||
|
style={discoverStyle.filePriceContainer}
|
||||||
|
iconStyle={discoverStyle.filePriceIcon}
|
||||||
|
textStyle={discoverStyle.filePriceText}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
{!compactView && (
|
{!compactView && (
|
||||||
<View style={isRewardContent ? discoverStyle.rewardTitleContainer : null}>
|
<View style={isRewardContent ? discoverStyle.rewardTitleContainer : null}>
|
||||||
@@ -129,7 +135,8 @@ class FileItem extends React.PureComponent {
|
|||||||
normalizeURI(shortChannelUri || fullChannelUri),
|
normalizeURI(shortChannelUri || fullChannelUri),
|
||||||
null,
|
null,
|
||||||
false,
|
false,
|
||||||
fullChannelUri
|
fullChannelUri,
|
||||||
|
setPlayerVisible,
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ class FileItemMedia extends React.PureComponent {
|
|||||||
let style = this.props.style;
|
let style = this.props.style;
|
||||||
const { duration, isResolvingUri, thumbnail, title, resizeMode } = this.props;
|
const { duration, isResolvingUri, thumbnail, title, resizeMode } = this.props;
|
||||||
const atStyle = this.state.autoThumbStyle;
|
const atStyle = this.state.autoThumbStyle;
|
||||||
|
const hasDuration = !!duration;
|
||||||
|
|
||||||
if (this.isThumbnailValid(thumbnail) && !this.state.imageLoadFailed) {
|
if (this.isThumbnailValid(thumbnail) && !this.state.imageLoadFailed) {
|
||||||
if (style == null) {
|
if (style == null) {
|
||||||
@@ -75,7 +76,7 @@ class FileItemMedia extends React.PureComponent {
|
|||||||
resizeMode={this.getFastImageResizeMode(resizeMode)}
|
resizeMode={this.getFastImageResizeMode(resizeMode)}
|
||||||
style={fileItemMediaStyle.image}
|
style={fileItemMediaStyle.image}
|
||||||
/>
|
/>
|
||||||
{duration && (
|
{duration > 0 && (
|
||||||
<VideoDuration
|
<VideoDuration
|
||||||
duration={duration}
|
duration={duration}
|
||||||
style={fileItemMediaStyle.duration}
|
style={fileItemMediaStyle.duration}
|
||||||
@@ -104,7 +105,7 @@ class FileItemMedia extends React.PureComponent {
|
|||||||
.toUpperCase()}
|
.toUpperCase()}
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
{duration && (
|
{duration > 0 && (
|
||||||
<VideoDuration
|
<VideoDuration
|
||||||
duration={duration}
|
duration={duration}
|
||||||
style={fileItemMediaStyle.duration}
|
style={fileItemMediaStyle.duration}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
makeSelectTitleForUri,
|
makeSelectTitleForUri,
|
||||||
makeSelectThumbnailForUri,
|
makeSelectThumbnailForUri,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
|
import { doSetPlayerVisible } from 'redux/actions/drawer';
|
||||||
import { selectBlackListedOutpoints, selectFilteredOutpoints, selectRewardContentClaimIds } from 'lbryinc';
|
import { selectBlackListedOutpoints, selectFilteredOutpoints, selectRewardContentClaimIds } from 'lbryinc';
|
||||||
import { selectShowNsfw } from 'redux/selectors/settings';
|
import { selectShowNsfw } from 'redux/selectors/settings';
|
||||||
import FileListItem from './view';
|
import FileListItem from './view';
|
||||||
@@ -32,9 +33,10 @@ const select = (state, props) => ({
|
|||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
resolveUri: uri => dispatch(doResolveUri(uri)),
|
resolveUri: uri => dispatch(doResolveUri(uri)),
|
||||||
|
setPlayerVisible: (visible, uri) => dispatch(doSetPlayerVisible(visible, uri)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
select,
|
select,
|
||||||
perform
|
perform,
|
||||||
)(FileListItem);
|
)(FileListItem);
|
||||||
@@ -1,11 +1,15 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { normalizeURI, parseURI } from 'lbry-redux';
|
import { normalizeURI, parseURI } from 'lbry-redux';
|
||||||
import { ActivityIndicator, Platform, Text, TouchableOpacity, View } from 'react-native';
|
import { ActivityIndicator, Platform, Text, TouchableOpacity, View } from 'react-native';
|
||||||
import { navigateToUri, formatBytes } from 'utils/helper';
|
import { navigateToUri, getDownloadProgress, getStorageForFileInfo } from 'utils/helper';
|
||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
|
import ChannelIconItem from 'component/channelIconItem';
|
||||||
|
import channelIconStyle from 'styles/channelIcon';
|
||||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import DateTime from 'component/dateTime';
|
import DateTime from 'component/dateTime';
|
||||||
|
import FastImage from 'react-native-fast-image';
|
||||||
import FileItemMedia from 'component/fileItemMedia';
|
import FileItemMedia from 'component/fileItemMedia';
|
||||||
|
import FilePrice from 'component/filePrice';
|
||||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||||
import Link from 'component/link';
|
import Link from 'component/link';
|
||||||
import NsfwOverlay from 'component/nsfwOverlay';
|
import NsfwOverlay from 'component/nsfwOverlay';
|
||||||
@@ -14,27 +18,10 @@ import fileListStyle from 'styles/fileList';
|
|||||||
|
|
||||||
class FileListItem extends React.PureComponent {
|
class FileListItem extends React.PureComponent {
|
||||||
state = {
|
state = {
|
||||||
|
autoStyle: null,
|
||||||
url: null,
|
url: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
getStorageForFileInfo = fileInfo => {
|
|
||||||
if (!fileInfo.completed) {
|
|
||||||
const written = formatBytes(fileInfo.written_bytes);
|
|
||||||
const total = formatBytes(fileInfo.total_bytes);
|
|
||||||
return `(${written} / ${total})`;
|
|
||||||
}
|
|
||||||
|
|
||||||
return formatBytes(fileInfo.written_bytes);
|
|
||||||
};
|
|
||||||
|
|
||||||
formatTitle = title => {
|
|
||||||
if (!title) {
|
|
||||||
return title;
|
|
||||||
}
|
|
||||||
|
|
||||||
return title.length > 80 ? title.substring(0, 77).trim() + '...' : title;
|
|
||||||
};
|
|
||||||
|
|
||||||
getDownloadProgress = fileInfo => {
|
getDownloadProgress = fileInfo => {
|
||||||
return Math.ceil((fileInfo.written_bytes / fileInfo.total_bytes) * 100);
|
return Math.ceil((fileInfo.written_bytes / fileInfo.total_bytes) * 100);
|
||||||
};
|
};
|
||||||
@@ -42,15 +29,18 @@ class FileListItem extends React.PureComponent {
|
|||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const { claim, resolveUri, uri, batchResolve } = this.props;
|
const { claim, resolveUri, uri, batchResolve } = this.props;
|
||||||
if (!claim && !batchResolve) {
|
if (!claim && !batchResolve) {
|
||||||
console.log('resolving on componentDidMount?');
|
|
||||||
resolveUri(uri);
|
resolveUri(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
autoStyle:
|
||||||
|
ChannelIconItem.AUTO_THUMB_STYLES[Math.floor(Math.random() * ChannelIconItem.AUTO_THUMB_STYLES.length)],
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate() {
|
componentDidUpdate() {
|
||||||
const { claim, resolveUri, uri, batchResolve } = this.props;
|
const { claim, resolveUri, uri, batchResolve } = this.props;
|
||||||
if (!claim && uri !== this.state.url && !batchResolve) {
|
if (!claim && uri !== this.state.url && !batchResolve) {
|
||||||
console.log('resolving on componentDidUpdate?');
|
|
||||||
this.setState({ url: uri }, () => resolveUri(uri));
|
this.setState({ url: uri }, () => resolveUri(uri));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -90,6 +80,7 @@ class FileListItem extends React.PureComponent {
|
|||||||
onPress,
|
onPress,
|
||||||
navigation,
|
navigation,
|
||||||
rewardedContentClaimIds,
|
rewardedContentClaimIds,
|
||||||
|
setPlayerVisible,
|
||||||
thumbnail,
|
thumbnail,
|
||||||
hideChannel,
|
hideChannel,
|
||||||
onLongPress,
|
onLongPress,
|
||||||
@@ -108,9 +99,12 @@ class FileListItem extends React.PureComponent {
|
|||||||
isRewardContent,
|
isRewardContent,
|
||||||
channelClaimId,
|
channelClaimId,
|
||||||
fullChannelUri,
|
fullChannelUri,
|
||||||
|
repostChannel,
|
||||||
|
repostChannelUrl,
|
||||||
shortChannelUri,
|
shortChannelUri,
|
||||||
shouldHide,
|
shouldHide,
|
||||||
signingChannel;
|
signingChannel,
|
||||||
|
isRepost;
|
||||||
if (claim) {
|
if (claim) {
|
||||||
name = claim.name;
|
name = claim.name;
|
||||||
signingChannel = claim.signing_channel;
|
signingChannel = claim.signing_channel;
|
||||||
@@ -120,6 +114,12 @@ class FileListItem extends React.PureComponent {
|
|||||||
channelClaimId = signingChannel ? signingChannel.claim_id : null;
|
channelClaimId = signingChannel ? signingChannel.claim_id : null;
|
||||||
fullChannelUri = channelClaimId ? `${channel}#${channelClaimId}` : channel;
|
fullChannelUri = channelClaimId ? `${channel}#${channelClaimId}` : channel;
|
||||||
shortChannelUri = signingChannel ? signingChannel.short_url : null;
|
shortChannelUri = signingChannel ? signingChannel.short_url : null;
|
||||||
|
repostChannelUrl = claim.repost_channel_url;
|
||||||
|
if (repostChannelUrl) {
|
||||||
|
const { claimName: repostChannelName } = parseURI(repostChannelUrl);
|
||||||
|
repostChannel = repostChannelName;
|
||||||
|
}
|
||||||
|
isRepost = !!repostChannelUrl;
|
||||||
|
|
||||||
if (blackListedOutpoints || filteredOutpoints) {
|
if (blackListedOutpoints || filteredOutpoints) {
|
||||||
const outpointsToHide = !blackListedOutpoints
|
const outpointsToHide = !blackListedOutpoints
|
||||||
@@ -136,10 +136,22 @@ class FileListItem extends React.PureComponent {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const actualHideChannel = !isRepost && hideChannel;
|
||||||
|
const isChannel = name && name.startsWith('@');
|
||||||
|
const hasThumbnail = !!thumbnail;
|
||||||
return (
|
return (
|
||||||
<View style={style}>
|
<View>
|
||||||
|
{isRepost && (
|
||||||
|
<View style={fileListStyle.repostInfo}>
|
||||||
|
<Icon name={"retweet"} size={14} style={fileListStyle.repostIcon} />
|
||||||
|
<Text style={fileListStyle.repostChannelName}>
|
||||||
|
<Link text={repostChannel}
|
||||||
|
onPress={() => navigateToUri(navigation, normalizeURI(repostChannelUrl), null, false, null, false)} /> reposted</Text>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={style}
|
style={[style, isChannel ? fileListStyle.channelContainer : null]}
|
||||||
onPress={this.onPressHandler}
|
onPress={this.onPressHandler}
|
||||||
onLongPress={() => {
|
onLongPress={() => {
|
||||||
if (onLongPress) {
|
if (onLongPress) {
|
||||||
@@ -147,13 +159,35 @@ class FileListItem extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<FileItemMedia
|
{!isChannel && (
|
||||||
style={fileListStyle.thumbnail}
|
<FileItemMedia
|
||||||
duration={duration}
|
style={fileListStyle.thumbnail}
|
||||||
resizeMode="cover"
|
duration={duration}
|
||||||
title={title || name || normalizeURI(uri).substring(7)}
|
resizeMode="cover"
|
||||||
thumbnail={thumbnail}
|
title={title || name || normalizeURI(uri).substring(7)}
|
||||||
/>
|
thumbnail={thumbnail}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{isChannel && (
|
||||||
|
<View style={fileListStyle.channelThumbnailView}>
|
||||||
|
<View style={[fileListStyle.channelThumbnailContainer, this.state.autoStyle]}>
|
||||||
|
{hasThumbnail && (
|
||||||
|
<FastImage
|
||||||
|
style={fileListStyle.channelThumbnail}
|
||||||
|
resizeMode={FastImage.resizeMode.cover}
|
||||||
|
source={{ uri: thumbnail }}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{!hasThumbnail && (
|
||||||
|
<Text style={channelIconStyle.autothumbCharacter}>
|
||||||
|
{title ? title.substring(0, 1).toUpperCase() : claim.name.substring(1, 2).toUpperCase()}
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
|
||||||
{selected && (
|
{selected && (
|
||||||
<View style={fileListStyle.selectedOverlay}>
|
<View style={fileListStyle.selectedOverlay}>
|
||||||
<Icon name={'check-circle'} solid color={Colors.NextLbryGreen} size={32} />
|
<Icon name={'check-circle'} solid color={Colors.NextLbryGreen} size={32} />
|
||||||
@@ -168,6 +202,12 @@ class FileListItem extends React.PureComponent {
|
|||||||
size={16}
|
size={16}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
<FilePrice
|
||||||
|
uri={uri}
|
||||||
|
style={fileListStyle.filePriceContainer}
|
||||||
|
iconStyle={fileListStyle.filePriceIcon}
|
||||||
|
textStyle={fileListStyle.filePriceText}
|
||||||
|
/>
|
||||||
<View style={fileListStyle.detailsContainer}>
|
<View style={fileListStyle.detailsContainer}>
|
||||||
{featuredResult && (
|
{featuredResult && (
|
||||||
<Text style={fileListStyle.featuredUri} numberOfLines={1}>
|
<Text style={fileListStyle.featuredUri} numberOfLines={1}>
|
||||||
@@ -188,8 +228,11 @@ class FileListItem extends React.PureComponent {
|
|||||||
|
|
||||||
{(title || name) && (
|
{(title || name) && (
|
||||||
<View style={fileListStyle.titleContainer}>
|
<View style={fileListStyle.titleContainer}>
|
||||||
<Text style={featuredResult ? fileListStyle.featuredTitle : fileListStyle.title}>
|
<Text
|
||||||
{this.formatTitle(title) || this.formatTitle(name)}
|
style={featuredResult ? fileListStyle.featuredTitle : fileListStyle.title}
|
||||||
|
numberOfLines={actualHideChannel ? 4 : 3}
|
||||||
|
>
|
||||||
|
{title || name}
|
||||||
</Text>
|
</Text>
|
||||||
{isRewardContent && <Icon style={fileListStyle.rewardIcon} name="award" size={12} />}
|
{isRewardContent && <Icon style={fileListStyle.rewardIcon} name="award" size={12} />}
|
||||||
</View>
|
</View>
|
||||||
@@ -201,17 +244,18 @@ class FileListItem extends React.PureComponent {
|
|||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{channel && !hideChannel && (
|
{(channel || isChannel) && !actualHideChannel && (
|
||||||
<Link
|
<Link
|
||||||
style={fileListStyle.publisher}
|
style={fileListStyle.publisher}
|
||||||
text={channel}
|
text={isChannel ? name : channel}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
navigateToUri(
|
navigateToUri(
|
||||||
navigation,
|
navigation,
|
||||||
normalizeURI(shortChannelUri || fullChannelUri),
|
normalizeURI(isChannel ? uri : shortChannelUri || fullChannelUri),
|
||||||
null,
|
null,
|
||||||
false,
|
false,
|
||||||
fullChannelUri,
|
isChannel ? claim && claim.permanent_url : fullChannelUri,
|
||||||
|
setPlayerVisible,
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -219,7 +263,7 @@ class FileListItem extends React.PureComponent {
|
|||||||
|
|
||||||
<View style={fileListStyle.info}>
|
<View style={fileListStyle.info}>
|
||||||
{fileInfo && !isNaN(fileInfo.written_bytes) && fileInfo.written_bytes > 0 && (
|
{fileInfo && !isNaN(fileInfo.written_bytes) && fileInfo.written_bytes > 0 && (
|
||||||
<Text style={fileListStyle.infoText}>{this.getStorageForFileInfo(fileInfo)}</Text>
|
<Text style={fileListStyle.infoText}>{getStorageForFileInfo(fileInfo)}</Text>
|
||||||
)}
|
)}
|
||||||
<DateTime style={fileListStyle.publishInfo} textStyle={fileListStyle.infoText} timeAgo uri={uri} />
|
<DateTime style={fileListStyle.publishInfo} textStyle={fileListStyle.infoText} timeAgo uri={uri} />
|
||||||
</View>
|
</View>
|
||||||
@@ -232,7 +276,7 @@ class FileListItem extends React.PureComponent {
|
|||||||
color={Colors.NextLbryGreen}
|
color={Colors.NextLbryGreen}
|
||||||
height={3}
|
height={3}
|
||||||
style={fileListStyle.progress}
|
style={fileListStyle.progress}
|
||||||
progress={this.getDownloadProgress(fileInfo)}
|
progress={getDownloadProgress(fileInfo)}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import React from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Text, View } from 'react-native';
|
import { Text, View } from 'react-native';
|
||||||
import { formatCredits, formatFullPrice } from 'lbry-redux';
|
import { formatCredits, formatFullPrice } from 'lbry-redux';
|
||||||
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||||
|
|
||||||
class CreditAmount extends React.PureComponent {
|
class CreditAmount extends React.PureComponent {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
@@ -62,25 +63,27 @@ class CreditAmount extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* {this.props.isEstimate ? (
|
return (
|
||||||
<span
|
<Text style={style} numberOfLines={1}>
|
||||||
className="credit-amount__estimate"
|
{amountText}
|
||||||
title={__('This is an estimate and does not include data fees')}
|
</Text>
|
||||||
>
|
);
|
||||||
*
|
|
||||||
</span>
|
|
||||||
) : null} */
|
|
||||||
return <Text style={style}>{amountText}</Text>;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class FilePrice extends React.PureComponent {
|
class FilePrice extends React.PureComponent {
|
||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
this.fetchCost(this.props);
|
const { cost } = this.props;
|
||||||
|
if (isNaN(parseFloat(cost))) {
|
||||||
|
this.fetchCost(this.props);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
this.fetchCost(nextProps);
|
const { cost } = this.props;
|
||||||
|
if (isNaN(parseFloat(cost))) {
|
||||||
|
this.fetchCost(nextProps);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchCost(props) {
|
fetchCost(props) {
|
||||||
@@ -92,30 +95,25 @@ class FilePrice extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { costInfo, look = 'indicator', showFullPrice = false, style, textStyle } = this.props;
|
const { cost, costInfo, look = 'indicator', showFullPrice = false, style, iconStyle, textStyle } = this.props;
|
||||||
|
|
||||||
const isEstimate = costInfo ? !costInfo.includesData : null;
|
const isEstimate = costInfo ? !costInfo.includesData : null;
|
||||||
|
const amount = cost ? parseFloat(cost) : costInfo ? parseFloat(costInfo.cost) : 0;
|
||||||
if (!costInfo) {
|
if (isNaN(amount) || amount === 0) {
|
||||||
return (
|
return null;
|
||||||
<View style={style}>
|
|
||||||
<Text style={textStyle}>???</Text>
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={style}>
|
<View style={style}>
|
||||||
|
<Icon name="coins" size={9} style={iconStyle} />
|
||||||
<CreditAmount
|
<CreditAmount
|
||||||
style={textStyle}
|
style={textStyle}
|
||||||
label={false}
|
label={false}
|
||||||
amount={parseFloat(costInfo.cost)}
|
amount={amount}
|
||||||
isEstimate={isEstimate}
|
isEstimate={isEstimate}
|
||||||
showFree
|
showFree
|
||||||
showFullPrice={showFullPrice}
|
showFullPrice={showFullPrice}
|
||||||
>
|
/>
|
||||||
???
|
|
||||||
</CreditAmount>
|
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class MediaPlayer extends React.PureComponent {
|
|||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
buffering: false,
|
buffering: true,
|
||||||
backgroundPlayEnabled: false,
|
backgroundPlayEnabled: false,
|
||||||
autoPaused: false,
|
autoPaused: false,
|
||||||
rate: 1,
|
rate: 1,
|
||||||
@@ -45,9 +45,9 @@ class MediaPlayer extends React.PureComponent {
|
|||||||
resizeMode: 'contain',
|
resizeMode: 'contain',
|
||||||
duration: 0.0,
|
duration: 0.0,
|
||||||
currentTime: 0.0,
|
currentTime: 0.0,
|
||||||
paused: !props.autoPlay,
|
paused: true,
|
||||||
fullscreenMode: false,
|
fullscreenMode: false,
|
||||||
areControlsVisible: true,
|
areControlsVisible: false,
|
||||||
controlsTimeout: -1,
|
controlsTimeout: -1,
|
||||||
seekerOffset: 0,
|
seekerOffset: 0,
|
||||||
seekerPosition: 0,
|
seekerPosition: 0,
|
||||||
@@ -87,7 +87,9 @@ class MediaPlayer extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onLoad = data => {
|
onLoad = data => {
|
||||||
|
const { autoPlay } = this.props;
|
||||||
this.setState({
|
this.setState({
|
||||||
|
buffering: false,
|
||||||
duration: data.duration,
|
duration: data.duration,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -100,13 +102,17 @@ class MediaPlayer extends React.PureComponent {
|
|||||||
if (this.props.onMediaLoaded) {
|
if (this.props.onMediaLoaded) {
|
||||||
this.props.onMediaLoaded();
|
this.props.onMediaLoaded();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (autoPlay) {
|
||||||
|
this.setState({ paused: false });
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
onProgress = data => {
|
onProgress = data => {
|
||||||
const { savePosition, claim } = this.props;
|
const { savePosition, claim } = this.props;
|
||||||
|
|
||||||
this.setState({ buffering: false, currentTime: data.currentTime });
|
this.setState({ buffering: false, currentTime: data.currentTime });
|
||||||
if (data.currentTime > 0 && Math.floor(data.currentTime) % positionSaveInterval === 0) {
|
if (claim && data.currentTime > 0 && Math.floor(data.currentTime) % positionSaveInterval === 0) {
|
||||||
const { claim_id: claimId, txid, nout } = claim;
|
const { claim_id: claimId, txid, nout } = claim;
|
||||||
savePosition(claimId, `${txid}:${nout}`, data.currentTime);
|
savePosition(claimId, `${txid}:${nout}`, data.currentTime);
|
||||||
}
|
}
|
||||||
@@ -167,7 +173,7 @@ class MediaPlayer extends React.PureComponent {
|
|||||||
|
|
||||||
togglePlay = () => {
|
togglePlay = () => {
|
||||||
this.showPlayerControls();
|
this.showPlayerControls();
|
||||||
this.setState({ paused: !this.state.paused }, this.handlePausedState);
|
this.setState({ paused: !this.state.paused }, this.updateBackgroundMediaNotification);
|
||||||
};
|
};
|
||||||
|
|
||||||
handlePausedState = () => {
|
handlePausedState = () => {
|
||||||
@@ -188,7 +194,7 @@ class MediaPlayer extends React.PureComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onEnd = () => {
|
onEnd = () => {
|
||||||
this.setState({ paused: true });
|
this.setState({ paused: true }, this.updateBackgroundMediaNotification);
|
||||||
if (this.props.onPlaybackFinished) {
|
if (this.props.onPlaybackFinished) {
|
||||||
this.props.onPlaybackFinished();
|
this.props.onPlaybackFinished();
|
||||||
}
|
}
|
||||||
@@ -327,6 +333,10 @@ class MediaPlayer extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onFocusChanged = evt => {
|
||||||
|
this.setState({ paused: !(this.state.paused && evt.hasAudioFocus) }, this.updateBackgroundMediaNotification);
|
||||||
|
};
|
||||||
|
|
||||||
onBuffer = () => {
|
onBuffer = () => {
|
||||||
if (!this.state.paused) {
|
if (!this.state.paused) {
|
||||||
this.setState({ buffering: true }, () => this.manualHidePlayerControls());
|
this.setState({ buffering: true }, () => this.manualHidePlayerControls());
|
||||||
@@ -341,6 +351,12 @@ class MediaPlayer extends React.PureComponent {
|
|||||||
this.setState({ paused: true }, this.updateBackgroundMediaNotification);
|
this.setState({ paused: true }, this.updateBackgroundMediaNotification);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
handleSeek = time => {
|
||||||
|
const { currentTime } = this.state;
|
||||||
|
const newTime = currentTime + time;
|
||||||
|
this.seekTo(newTime);
|
||||||
|
};
|
||||||
|
|
||||||
updateBackgroundMediaNotification = () => {
|
updateBackgroundMediaNotification = () => {
|
||||||
this.handlePausedState();
|
this.handlePausedState();
|
||||||
const { backgroundPlayEnabled } = this.props;
|
const { backgroundPlayEnabled } = this.props;
|
||||||
@@ -362,14 +378,26 @@ class MediaPlayer extends React.PureComponent {
|
|||||||
<Icon name={'arrow-left'} size={18} style={mediaPlayerStyle.backButtonIcon} />
|
<Icon name={'arrow-left'} size={18} style={mediaPlayerStyle.backButtonIcon} />
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|
||||||
<TouchableOpacity style={mediaPlayerStyle.playPauseButton} onPress={this.togglePlay}>
|
<View style={mediaPlayerStyle.midControls}>
|
||||||
{this.state.paused && <Icon name="play" size={40} color="#ffffff" />}
|
<TouchableOpacity style={mediaPlayerStyle.rewind10} onPress={() => this.handleSeek(-10)}>
|
||||||
{!this.state.paused && <Icon name="pause" size={40} color="#ffffff" />}
|
<Icon name="undo" size={24} color={Colors.White} />
|
||||||
</TouchableOpacity>
|
<Text style={[mediaPlayerStyle.midControlText, mediaPlayerStyle.leftMidControlText]}>10</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
|
||||||
|
<TouchableOpacity style={mediaPlayerStyle.playPauseButton} onPress={this.togglePlay}>
|
||||||
|
{this.state.paused && <Icon name="play" size={40} color={Colors.White} />}
|
||||||
|
{!this.state.paused && <Icon name="pause" size={40} color={Colors.White} />}
|
||||||
|
</TouchableOpacity>
|
||||||
|
|
||||||
|
<TouchableOpacity style={mediaPlayerStyle.forward10} onPress={() => this.handleSeek(10)}>
|
||||||
|
<Icon name="redo" size={24} color={Colors.White} />
|
||||||
|
<Text style={[mediaPlayerStyle.midControlText, mediaPlayerStyle.rightMidControlText]}>10</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
|
||||||
<TouchableOpacity style={mediaPlayerStyle.toggleFullscreenButton} onPress={this.toggleFullscreenMode}>
|
<TouchableOpacity style={mediaPlayerStyle.toggleFullscreenButton} onPress={this.toggleFullscreenMode}>
|
||||||
{this.state.fullscreenMode && <Icon name="compress" size={16} color="#ffffff" />}
|
{this.state.fullscreenMode && <Icon name="compress" size={16} color={Colors.White} />}
|
||||||
{!this.state.fullscreenMode && <Icon name="expand" size={16} color="#ffffff" />}
|
{!this.state.fullscreenMode && <Icon name="expand" size={16} color={Colors.White} />}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|
||||||
<Text style={mediaPlayerStyle.elapsedDuration}>{this.formatTime(this.state.currentTime)}</Text>
|
<Text style={mediaPlayerStyle.elapsedDuration}>{this.formatTime(this.state.currentTime)}</Text>
|
||||||
@@ -421,7 +449,7 @@ class MediaPlayer extends React.PureComponent {
|
|||||||
const seekerCircleStyle = [this.state.seeking ? mediaPlayerStyle.bigSeekerCircle : mediaPlayerStyle.seekerCircle];
|
const seekerCircleStyle = [this.state.seeking ? mediaPlayerStyle.bigSeekerCircle : mediaPlayerStyle.seekerCircle];
|
||||||
if (!this.state.seeking) {
|
if (!this.state.seeking) {
|
||||||
seekerCircleStyle.push(
|
seekerCircleStyle.push(
|
||||||
this.state.fullscreenMode ? mediaPlayerStyle.seekerCircleTopFs : mediaPlayerStyle.seekerCircleTop
|
this.state.fullscreenMode ? mediaPlayerStyle.seekerCircleTopFs : mediaPlayerStyle.seekerCircleTop,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -440,6 +468,7 @@ class MediaPlayer extends React.PureComponent {
|
|||||||
}}
|
}}
|
||||||
resizeMode={this.state.resizeMode}
|
resizeMode={this.state.resizeMode}
|
||||||
playInBackground={this.state.backgroundPlayEnabled}
|
playInBackground={this.state.backgroundPlayEnabled}
|
||||||
|
playWhenInactive={this.state.backgroundPlayEnabled}
|
||||||
style={mediaPlayerStyle.player}
|
style={mediaPlayerStyle.player}
|
||||||
rate={this.state.rate}
|
rate={this.state.rate}
|
||||||
volume={this.state.volume}
|
volume={this.state.volume}
|
||||||
@@ -450,6 +479,7 @@ class MediaPlayer extends React.PureComponent {
|
|||||||
onEnd={this.onEnd}
|
onEnd={this.onEnd}
|
||||||
onError={this.onError}
|
onError={this.onError}
|
||||||
minLoadRetryCount={999}
|
minLoadRetryCount={999}
|
||||||
|
onAudioFocusChanged={this.onFocusChanged}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{this.state.firstPlay && thumbnail && (
|
{this.state.firstPlay && thumbnail && (
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
import { selectFetchingClaimSearch } from 'lbry-redux';
|
||||||
import ModalSuggestedSubscriptions from './view';
|
import ModalSuggestedSubscriptions from './view';
|
||||||
|
|
||||||
export default connect()(ModalSuggestedSubscriptions);
|
const select = state => ({
|
||||||
|
loadingSuggested: selectFetchingClaimSearch(state),
|
||||||
|
});
|
||||||
|
|
||||||
|
export default connect(select)(ModalSuggestedSubscriptions);
|
||||||
@@ -1,23 +1,26 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
import { ActivityIndicator, ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
||||||
import modalStyle from 'styles/modal';
|
import modalStyle from 'styles/modal';
|
||||||
import subscriptionsStyle from 'styles/subscriptions';
|
import subscriptionsStyle from 'styles/subscriptions';
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
import SuggestedSubscriptions from 'component/suggestedSubscriptions';
|
import SuggestedSubscriptionsGrid from 'component/suggestedSubscriptionsGrid';
|
||||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||||
|
|
||||||
export default class ModalSuggestedSubcriptions extends React.PureComponent {
|
export default class ModalSuggestedSubcriptions extends React.PureComponent {
|
||||||
render() {
|
render() {
|
||||||
const { navigation, onDonePress, onOverlayPress } = this.props;
|
const { loadingSuggested, navigation, onDonePress, onOverlayPress } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity style={modalStyle.overlay} activeOpacity={1} onPress={onOverlayPress}>
|
<TouchableOpacity style={modalStyle.overlay} activeOpacity={1} onPress={onOverlayPress}>
|
||||||
<TouchableOpacity style={[modalStyle.container, subscriptionsStyle.modalContainer]} activeOpacity={1}>
|
<TouchableOpacity style={[modalStyle.container, subscriptionsStyle.modalContainer]} activeOpacity={1}>
|
||||||
<SuggestedSubscriptions inModal navigation={navigation} />
|
<SuggestedSubscriptionsGrid inModal navigation={navigation} />
|
||||||
<View style={modalStyle.buttons}>
|
<View style={modalStyle.wideButtons}>
|
||||||
<Button style={modalStyle.doneButton} text={__('Done')} onPress={onDonePress} />
|
<Button style={modalStyle.wideDoneButton} text={__('Done')} onPress={onDonePress} />
|
||||||
|
{loadingSuggested && (
|
||||||
|
<ActivityIndicator size="small" color={Colors.White} style={subscriptionsStyle.modalLoading} />
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|||||||
@@ -1,27 +1,35 @@
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import {
|
import {
|
||||||
doResolveUris,
|
doResolveUris,
|
||||||
doSearch,
|
doResolvedSearch,
|
||||||
makeSelectClaimForUri,
|
makeSelectClaimForUri,
|
||||||
makeSelectRecommendedContentForUri,
|
makeSelectResolvedRecommendedContentForUri,
|
||||||
selectResolvingUris,
|
selectResolvingUris,
|
||||||
selectIsSearching,
|
selectIsSearching,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
|
import { selectShowNsfw } from 'redux/selectors/settings';
|
||||||
import RelatedContent from './view';
|
import RelatedContent from './view';
|
||||||
|
|
||||||
|
const RESULT_SIZE = 16;
|
||||||
|
|
||||||
const select = (state, props) => ({
|
const select = (state, props) => ({
|
||||||
claim: makeSelectClaimForUri(props.uri)(state),
|
claim: makeSelectClaimForUri(props.uri)(state),
|
||||||
isSearching: selectIsSearching(state),
|
isSearching: selectIsSearching(state),
|
||||||
recommendedContent: makeSelectRecommendedContentForUri(props.uri)(state),
|
recommendedContent: makeSelectResolvedRecommendedContentForUri(
|
||||||
|
props.uri,
|
||||||
|
RESULT_SIZE,
|
||||||
|
props.claimId,
|
||||||
|
props.claimName,
|
||||||
|
props.title,
|
||||||
|
)(state),
|
||||||
resolvingUris: selectResolvingUris(state),
|
resolvingUris: selectResolvingUris(state),
|
||||||
|
showNsfwContent: selectShowNsfw(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
resolveUris: uris => dispatch(doResolveUris(uris)),
|
resolveUris: uris => dispatch(doResolveUris(uris)),
|
||||||
searchRecommended: query => dispatch(doSearch(query, 20, undefined, true, false)),
|
searchRecommended: (query, claimId, nsfw) =>
|
||||||
|
dispatch(doResolvedSearch(query, RESULT_SIZE, undefined, true, { related_to: claimId }, nsfw)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(select, perform)(RelatedContent);
|
||||||
select,
|
|
||||||
perform,
|
|
||||||
)(RelatedContent);
|
|
||||||
@@ -4,71 +4,42 @@ import { normalizeURI } from 'lbry-redux';
|
|||||||
import { navigateToUri } from 'utils/helper';
|
import { navigateToUri } from 'utils/helper';
|
||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
import FileListItem from 'component/fileListItem';
|
import FileListItem from 'component/fileListItem';
|
||||||
|
import ClaimResultItem from 'component/claimResultItem';
|
||||||
import fileListStyle from 'styles/fileList';
|
import fileListStyle from 'styles/fileList';
|
||||||
import relatedContentStyle from 'styles/relatedContent';
|
import relatedContentStyle from 'styles/relatedContent';
|
||||||
|
|
||||||
export default class RelatedContent extends React.PureComponent {
|
export default class RelatedContent extends React.PureComponent {
|
||||||
state = {
|
|
||||||
resolveStarted: false,
|
|
||||||
};
|
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const { title, searchRecommended } = this.props;
|
const { title, claimId, searchRecommended, showNsfwContent } = this.props;
|
||||||
if (title) {
|
if (title && claimId) {
|
||||||
searchRecommended(title);
|
searchRecommended(title, claimId, showNsfwContent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldComponentUpdate(nextProps, nextState) {
|
shouldComponentUpdate(nextProps, nextState) {
|
||||||
const { isSearching, recommendedContent } = nextProps;
|
const { isSearching, recommendedContent } = nextProps;
|
||||||
return isSearching || (!isSearching && this.allContentResolved());
|
return isSearching || (!isSearching && recommendedContent && recommendedContent.length > 0);
|
||||||
}
|
|
||||||
|
|
||||||
allContentResolved() {
|
|
||||||
const { recommendedContent, resolvingUris } = this.props;
|
|
||||||
if (recommendedContent) {
|
|
||||||
let allResolved = true;
|
|
||||||
recommendedContent.forEach(uri => {
|
|
||||||
allResolved = allResolved && !resolvingUris.includes(uri);
|
|
||||||
});
|
|
||||||
return allResolved;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidUpdate() {
|
|
||||||
const { isSearching, resolveUris, recommendedContent } = this.props;
|
|
||||||
if (!isSearching && !this.state.resolveStarted) {
|
|
||||||
this.setState({ resolveStarted: true }, () => {
|
|
||||||
if (recommendedContent && recommendedContent.length > 0) {
|
|
||||||
// batch resolve the uris
|
|
||||||
resolveUris(recommendedContent);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { isSearching, recommendedContent, navigation, uri, fullUri } = this.props;
|
const { isSearching, recommendedContent, navigation, urlOpenHandler, uri, fullUri } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={relatedContentStyle.container}>
|
<View style={relatedContentStyle.container}>
|
||||||
<Text style={relatedContentStyle.title}>{__('Related Content')}</Text>
|
<Text style={relatedContentStyle.title}>{__('Related Content')}</Text>
|
||||||
{isSearching && <ActivityIndicator size={'small'} color={Colors.NextLbryGreen} />}
|
{isSearching && <ActivityIndicator size={'small'} color={Colors.NextLbryGreen} />}
|
||||||
{recommendedContent &&
|
{recommendedContent &&
|
||||||
recommendedContent
|
recommendedContent.map(result => (
|
||||||
.filter(recommendedUri => recommendedUri !== normalizeURI(fullUri))
|
<ClaimResultItem
|
||||||
.map(recommendedUri => (
|
style={fileListStyle.item}
|
||||||
<FileListItem
|
uri={result ? normalizeURI(`${result.name}#${result.claimId}`) : null}
|
||||||
style={fileListStyle.item}
|
urlOpenHandler={urlOpenHandler}
|
||||||
key={recommendedUri}
|
key={result.claimId}
|
||||||
uri={recommendedUri}
|
result={result}
|
||||||
batchResolve
|
navigation={navigation}
|
||||||
navigation={navigation}
|
autoplay
|
||||||
autoplay
|
/>
|
||||||
/>
|
))}
|
||||||
))}
|
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import { connect } from 'react-redux';
|
||||||
|
import { doChannelSubscribe, doChannelUnsubscribe, selectSubscriptions, makeSelectIsSubscribed } from 'lbryinc';
|
||||||
|
import { doToast } from 'lbry-redux';
|
||||||
|
import SubscribeButtonOverlay from './view';
|
||||||
|
|
||||||
|
const select = (state, props) => ({
|
||||||
|
subscriptions: selectSubscriptions(state),
|
||||||
|
isSubscribed: makeSelectIsSubscribed(props.uri, true)(state),
|
||||||
|
});
|
||||||
|
|
||||||
|
export default connect(
|
||||||
|
select,
|
||||||
|
{
|
||||||
|
doChannelSubscribe,
|
||||||
|
doChannelUnsubscribe,
|
||||||
|
doToast,
|
||||||
|
},
|
||||||
|
)(SubscribeButtonOverlay);
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { normalizeURI, parseURI } from 'lbry-redux';
|
||||||
|
import { NativeModules, Text, View, TouchableOpacity } from 'react-native';
|
||||||
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||||
|
import Button from 'component/button';
|
||||||
|
import Colors from 'styles/colors';
|
||||||
|
|
||||||
|
class SubscribeButtonOverlay extends React.PureComponent {
|
||||||
|
handlePress = () => {
|
||||||
|
const { claim, isSubscribed, doChannelSubscribe, doChannelUnsubscribe, uri } = this.props;
|
||||||
|
if (!claim) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const subscriptionHandler = isSubscribed ? doChannelUnsubscribe : doChannelSubscribe;
|
||||||
|
const { name: claimName } = claim;
|
||||||
|
subscriptionHandler({
|
||||||
|
channelName: claimName,
|
||||||
|
uri: normalizeURI(uri),
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { uri, isSubscribed, style } = this.props;
|
||||||
|
let styles = style.length ? style : [style];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<TouchableOpacity style={styles} opacity={0.7} onPress={this.handlePress}>
|
||||||
|
{isSubscribed && <Icon name={'heart'} size={20} solid color={Colors.Red} />}
|
||||||
|
{!isSubscribed && <Icon name={'heart'} size={20} color={Colors.Red} />}
|
||||||
|
</TouchableOpacity>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SubscribeButtonOverlay;
|
||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
makeSelectTitleForUri,
|
makeSelectTitleForUri,
|
||||||
makeSelectIsUriResolving,
|
makeSelectIsUriResolving,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
|
import { doChannelSubscribe, doChannelUnsubscribe, makeSelectIsSubscribed } from 'lbryinc';
|
||||||
import SuggestedSubscriptionItem from './view';
|
import SuggestedSubscriptionItem from './view';
|
||||||
|
|
||||||
const select = (state, props) => ({
|
const select = (state, props) => ({
|
||||||
@@ -13,13 +14,16 @@ const select = (state, props) => ({
|
|||||||
title: makeSelectTitleForUri(props.uri)(state),
|
title: makeSelectTitleForUri(props.uri)(state),
|
||||||
claim: makeSelectClaimForUri(props.uri)(state),
|
claim: makeSelectClaimForUri(props.uri)(state),
|
||||||
isResolvingUri: makeSelectIsUriResolving(props.uri)(state),
|
isResolvingUri: makeSelectIsUriResolving(props.uri)(state),
|
||||||
|
isSubscribed: makeSelectIsSubscribed(props.uri, true)(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
resolveUri: uri => dispatch(doResolveUri(uri)),
|
resolveUri: uri => dispatch(doResolveUri(uri)),
|
||||||
|
subscribe: subscription => doChannelSubscribe(subscription),
|
||||||
|
unsubscribe: subscription => doChannelUnsubscribe(subscription),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
select,
|
select,
|
||||||
perform
|
perform,
|
||||||
)(SuggestedSubscriptionItem);
|
)(SuggestedSubscriptionItem);
|
||||||
@@ -1,25 +1,37 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { buildURI, normalizeURI } from 'lbry-redux';
|
import { buildURI, normalizeURI } from 'lbry-redux';
|
||||||
import { ActivityIndicator, FlatList, Image, Text, View } from 'react-native';
|
import { ActivityIndicator, FlatList, Image, Text, TouchableOpacity, View } from 'react-native';
|
||||||
import { navigateToUri } from 'utils/helper';
|
import { navigateToUri } from 'utils/helper';
|
||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
|
import ChannelIconItem from 'component/channelIconItem';
|
||||||
|
import channelIconStyle from 'styles/channelIcon';
|
||||||
import discoverStyle from 'styles/discover';
|
import discoverStyle from 'styles/discover';
|
||||||
import FileItem from 'component/fileItem';
|
import FileItem from 'component/fileItem';
|
||||||
import SubscribeButton from 'component/subscribeButton';
|
import SubscribeButtonOverlay from 'component/subscribeButtonOverlay';
|
||||||
import subscriptionsStyle from 'styles/subscriptions';
|
import subscriptionsStyle from 'styles/subscriptions';
|
||||||
import Link from 'component/link';
|
import Link from 'component/link';
|
||||||
import Tag from 'component/tag';
|
import Tag from 'component/tag';
|
||||||
|
|
||||||
class SuggestedSubscriptionItem extends React.PureComponent {
|
class SuggestedSubscriptionItem extends React.PureComponent {
|
||||||
|
state = {
|
||||||
|
autoStyle: null,
|
||||||
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const { claim, uri, resolveUri } = this.props;
|
const { claim, uri, resolveUri } = this.props;
|
||||||
if (!claim) {
|
if (!claim) {
|
||||||
resolveUri(uri);
|
resolveUri(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
autoStyle:
|
||||||
|
ChannelIconItem.AUTO_THUMB_STYLES[Math.floor(Math.random() * ChannelIconItem.AUTO_THUMB_STYLES.length)],
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { claim, isResolvingUri, navigation, thumbnail, title, uri } = this.props;
|
const { claim, isResolvingUri, navigation, thumbnail, title, uri } = this.props;
|
||||||
|
|
||||||
let shortUrl, tags;
|
let shortUrl, tags;
|
||||||
if (claim) {
|
if (claim) {
|
||||||
shortUrl = claim.short_url;
|
shortUrl = claim.short_url;
|
||||||
@@ -28,54 +40,60 @@ class SuggestedSubscriptionItem extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const hasThumbnail = !!thumbnail;
|
||||||
if (isResolvingUri) {
|
if (isResolvingUri) {
|
||||||
return (
|
return (
|
||||||
<View style={subscriptionsStyle.itemLoadingContainer}>
|
<View style={subscriptionsStyle.itemLoadingContainer}>
|
||||||
<ActivityIndicator size={'small'} color={Colors.LbryGreen} />
|
<ActivityIndicator size={'small'} color={Colors.NextLbryGreen} />
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={subscriptionsStyle.suggestedItem}>
|
<TouchableOpacity style={subscriptionsStyle.suggestedItem}>
|
||||||
<View style={subscriptionsStyle.suggestedItemThumbnailContainer}>
|
<View style={[subscriptionsStyle.suggestedItemThumbnailContainer, this.state.autoStyle]}>
|
||||||
<Image
|
{hasThumbnail && (
|
||||||
style={subscriptionsStyle.suggestedItemThumbnail}
|
<Image style={subscriptionsStyle.suggestedItemThumbnail} resizeMode={'cover'} source={{ uri: thumbnail }} />
|
||||||
resizeMode={'cover'}
|
)}
|
||||||
source={thumbnail ? { uri: thumbnail } : require('../../assets/default_avatar.jpg')}
|
{!hasThumbnail && (
|
||||||
/>
|
<Text style={channelIconStyle.autothumbCharacter}>
|
||||||
|
{title ? title.substring(0, 1).toUpperCase() : claim ? claim.name.substring(1, 2).toUpperCase() : ''}
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View style={subscriptionsStyle.suggestedItemDetails}>
|
<View style={subscriptionsStyle.suggestedItemDetails}>
|
||||||
{title && (
|
<Text style={subscriptionsStyle.suggestedItemTitle} numberOfLines={2}>
|
||||||
<Text style={subscriptionsStyle.suggestedItemTitle} numberOfLines={1}>
|
{title || claim.name}
|
||||||
{title}
|
</Text>
|
||||||
</Text>
|
|
||||||
)}
|
|
||||||
{claim && (
|
|
||||||
<Link
|
|
||||||
style={subscriptionsStyle.suggestedItemName}
|
|
||||||
numberOfLines={1}
|
|
||||||
text={claim.name}
|
|
||||||
onPress={() => navigateToUri(navigation, normalizeURI(shortUrl || uri), null, false, claim.permanent_url)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{tags && (
|
{tags && (
|
||||||
<View style={subscriptionsStyle.suggestedItemTagList}>
|
<View style={subscriptionsStyle.suggestedItemTagList}>
|
||||||
{tags &&
|
{tags &&
|
||||||
tags
|
tags
|
||||||
.slice(0, 3)
|
.slice(0, 1)
|
||||||
.map(tag => (
|
.map(tag => (
|
||||||
<Tag style={subscriptionsStyle.tag} key={tag} name={tag} navigation={navigation} truncate />
|
<Tag
|
||||||
|
numberOfLines={1}
|
||||||
|
onPress={this.handleItemPress}
|
||||||
|
style={subscriptionsStyle.tag}
|
||||||
|
key={tag}
|
||||||
|
name={tag}
|
||||||
|
navigation={navigation}
|
||||||
|
truncate
|
||||||
|
/>
|
||||||
))}
|
))}
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
{claim && (
|
{claim && (
|
||||||
<SubscribeButton style={subscriptionsStyle.suggestedItemSubscribe} uri={normalizeURI(claim.permanent_url)} />
|
<SubscribeButtonOverlay
|
||||||
|
claim={claim}
|
||||||
|
style={subscriptionsStyle.suggestedItemSubscribeOverlay}
|
||||||
|
uri={normalizeURI(claim.permanent_url)}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</View>
|
</TouchableOpacity>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import { connect } from 'react-redux';
|
||||||
|
import {
|
||||||
|
doClaimSearch,
|
||||||
|
selectFetchingClaimSearch,
|
||||||
|
selectClaimSearchByQuery,
|
||||||
|
selectClaimSearchByQueryLastPageReached,
|
||||||
|
selectFollowedTags,
|
||||||
|
} from 'lbry-redux';
|
||||||
|
import { selectSubscriptions, selectSuggestedChannels, selectIsFetchingSuggested } from 'lbryinc';
|
||||||
|
import { selectShowNsfw } from 'redux/selectors/settings';
|
||||||
|
import SuggestedSubscriptionsGrid from './view';
|
||||||
|
|
||||||
|
const select = state => ({
|
||||||
|
followedTags: selectFollowedTags(state),
|
||||||
|
subscriptions: selectSubscriptions(state),
|
||||||
|
suggested: selectSuggestedChannels(state),
|
||||||
|
loading: selectIsFetchingSuggested(state) || selectFetchingClaimSearch(state),
|
||||||
|
claimSearchByQuery: selectClaimSearchByQuery(state),
|
||||||
|
lastPageReached: selectClaimSearchByQueryLastPageReached(state),
|
||||||
|
showNsfwContent: selectShowNsfw(state),
|
||||||
|
});
|
||||||
|
|
||||||
|
const perform = dispatch => ({
|
||||||
|
claimSearch: options => dispatch(doClaimSearch(options)),
|
||||||
|
});
|
||||||
|
|
||||||
|
export default connect(
|
||||||
|
select,
|
||||||
|
perform,
|
||||||
|
)(SuggestedSubscriptionsGrid);
|
||||||
@@ -0,0 +1,111 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { ActivityIndicator, SectionList, Text, View } from 'react-native';
|
||||||
|
import { MATURE_TAGS, createNormalizedClaimSearchKey, normalizeURI } from 'lbry-redux';
|
||||||
|
import { navigateToUri } from 'utils/helper';
|
||||||
|
import { FlatGrid } from 'react-native-super-grid';
|
||||||
|
import SubscribeButton from 'component/subscribeButton';
|
||||||
|
import SuggestedSubscriptionItem from 'component/suggestedSubscriptionItem';
|
||||||
|
import Colors from 'styles/colors';
|
||||||
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
|
import discoverStyle from 'styles/discover';
|
||||||
|
import subscriptionsStyle from 'styles/subscriptions';
|
||||||
|
import Link from 'component/link';
|
||||||
|
import _ from 'lodash';
|
||||||
|
|
||||||
|
const suggestedPageSize = 24;
|
||||||
|
const softLimit = 2400;
|
||||||
|
class SuggestedSubscriptionsGrid extends React.PureComponent {
|
||||||
|
state = {
|
||||||
|
currentPage: 1,
|
||||||
|
options: {},
|
||||||
|
// maintain a local state of subscriptions so that changes don't affect the search
|
||||||
|
subscriptionIds: [],
|
||||||
|
};
|
||||||
|
|
||||||
|
buildClaimSearchOptions() {
|
||||||
|
const { showNsfwContent } = this.props;
|
||||||
|
const { currentPage } = this.state;
|
||||||
|
|
||||||
|
const options = {
|
||||||
|
no_totals: true,
|
||||||
|
page: currentPage,
|
||||||
|
page_size: suggestedPageSize,
|
||||||
|
claim_type: 'channel',
|
||||||
|
order_by: [Constants.ORDER_BY_EFFECTIVE_AMOUNT],
|
||||||
|
};
|
||||||
|
if (!showNsfwContent) {
|
||||||
|
options.not_tags = MATURE_TAGS;
|
||||||
|
}
|
||||||
|
if (this.state.subscriptionIds.length > 0) {
|
||||||
|
options.not_channel_ids = this.state.subscriptionIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
|
||||||
|
doClaimSearch() {
|
||||||
|
const { claimSearch } = this.props;
|
||||||
|
const options = this.buildClaimSearchOptions();
|
||||||
|
claimSearch(options);
|
||||||
|
}
|
||||||
|
|
||||||
|
handleVerticalEndReached = () => {
|
||||||
|
// fetch more content
|
||||||
|
const { claimSearchByQuery, lastPageReached } = this.props;
|
||||||
|
|
||||||
|
const options = this.buildClaimSearchOptions();
|
||||||
|
const claimSearchKey = createNormalizedClaimSearchKey(options);
|
||||||
|
const uris = claimSearchByQuery[claimSearchKey];
|
||||||
|
if (
|
||||||
|
lastPageReached[claimSearchKey] ||
|
||||||
|
((uris.length > 0 && uris.length < suggestedPageSize) || uris.length >= softLimit)
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setState({ currentPage: this.state.currentPage + 1 }, () => this.doClaimSearch());
|
||||||
|
};
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
const { claimSearch, followedTags, showNsfwContent, subscriptions } = this.props;
|
||||||
|
if (subscriptions && subscriptions.length > 0) {
|
||||||
|
this.setState(
|
||||||
|
{
|
||||||
|
subscriptionIds: subscriptions.map(subscription => subscription.uri.split('#')[1]),
|
||||||
|
},
|
||||||
|
() => this.doClaimSearch(),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
this.doClaimSearch();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { claimSearchByQuery, suggested, inModal, navigation } = this.props;
|
||||||
|
const options = this.buildClaimSearchOptions();
|
||||||
|
const claimSearchKey = createNormalizedClaimSearchKey(options);
|
||||||
|
const claimSearchUris = claimSearchByQuery[claimSearchKey];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<FlatGrid
|
||||||
|
initialNumToRender={24}
|
||||||
|
maxToRenderPerBatch={48}
|
||||||
|
removeClippedSubviews
|
||||||
|
itemDimension={120}
|
||||||
|
spacing={2}
|
||||||
|
items={claimSearchUris}
|
||||||
|
style={inModal ? subscriptionsStyle.modalScrollContainer : subscriptionsStyle.scrollContainer}
|
||||||
|
contentContainerStyle={
|
||||||
|
inModal ? subscriptionsStyle.modalSuggestedScrollContent : subscriptionsStyle.suggestedScrollContent
|
||||||
|
}
|
||||||
|
renderItem={({ item, index }) => (
|
||||||
|
<SuggestedSubscriptionItem key={item} uri={normalizeURI(item)} navigation={navigation} />
|
||||||
|
)}
|
||||||
|
onEndReached={this.handleVerticalEndReached}
|
||||||
|
onEndReachedThreshold={0.2}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SuggestedSubscriptionsGrid;
|
||||||
@@ -30,7 +30,7 @@ export default class Tag extends React.PureComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { name, onPress, style, type, truncate } = this.props;
|
const { name, numberOfLines, onPress, style, type, truncate } = this.props;
|
||||||
|
|
||||||
let styles = [];
|
let styles = [];
|
||||||
if (style) {
|
if (style) {
|
||||||
@@ -50,7 +50,9 @@ export default class Tag extends React.PureComponent {
|
|||||||
return (
|
return (
|
||||||
<TouchableOpacity style={styles} onPress={onPress || this.onPressDefault}>
|
<TouchableOpacity style={styles} onPress={onPress || this.onPressDefault}>
|
||||||
<View style={tagStyle.content}>
|
<View style={tagStyle.content}>
|
||||||
<Text style={tagStyle.text}>{truncate ? formatTagName(name) : name}</Text>
|
<Text style={tagStyle.text} numberOfLines={numberOfLines}>
|
||||||
|
{truncate ? formatTagName(name) : name}
|
||||||
|
</Text>
|
||||||
{type && <Icon style={tagStyle.icon} name={type === 'add' ? 'plus' : 'times'} size={8} />}
|
{type && <Icon style={tagStyle.icon} name={type === 'add' ? 'plus' : 'times'} size={8} />}
|
||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
selectSearchSuggestions,
|
selectSearchSuggestions,
|
||||||
SETTINGS,
|
SETTINGS,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
|
import { doSetPlayerVisible } from 'redux/actions/drawer';
|
||||||
import { selectCurrentRoute } from 'redux/selectors/drawer';
|
import { selectCurrentRoute } from 'redux/selectors/drawer';
|
||||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||||
import UriBar from './view';
|
import UriBar from './view';
|
||||||
@@ -24,9 +25,10 @@ const select = state => {
|
|||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
updateSearchQuery: query => dispatch(doUpdateSearchQuery(query)),
|
updateSearchQuery: query => dispatch(doUpdateSearchQuery(query)),
|
||||||
|
setPlayerVisible: (visible, uri) => dispatch(doSetPlayerVisible(visible, uri)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
select,
|
select,
|
||||||
perform
|
perform,
|
||||||
)(UriBar);
|
)(UriBar);
|
||||||
@@ -1,13 +1,14 @@
|
|||||||
// @flow
|
// @flow
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { SEARCH_TYPES, isNameValid, isURIValid, normalizeURI } from 'lbry-redux';
|
import { SEARCH_TYPES, isNameValid, isURIValid, normalizeURI } from 'lbry-redux';
|
||||||
import { Dimensions, FlatList, Keyboard, Text, TextInput, TouchableOpacity, View } from 'react-native';
|
import { Alert, Dimensions, FlatList, Keyboard, Text, TextInput, TouchableOpacity, View } from 'react-native';
|
||||||
import { navigateToUri, transformUrl } from 'utils/helper';
|
import { navigateToUri, transformUrl } from 'utils/helper';
|
||||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import UriBarItem from './internal/uri-bar-item';
|
import UriBarItem from './internal/uri-bar-item';
|
||||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||||
import NavigationButton from 'component/navigationButton';
|
import NavigationButton from 'component/navigationButton';
|
||||||
import uriBarStyle from 'styles/uriBar';
|
import uriBarStyle from 'styles/uriBar';
|
||||||
|
import { NavigationActions, StackActions } from 'react-navigation';
|
||||||
|
|
||||||
class UriBar extends React.PureComponent {
|
class UriBar extends React.PureComponent {
|
||||||
static INPUT_TIMEOUT = 2500; // 2.5 seconds
|
static INPUT_TIMEOUT = 2500; // 2.5 seconds
|
||||||
@@ -18,18 +19,20 @@ class UriBar extends React.PureComponent {
|
|||||||
|
|
||||||
keyboardDidHideListener = null;
|
keyboardDidHideListener = null;
|
||||||
|
|
||||||
|
changeTextTimeout = -1;
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
changeTextTimeout: null,
|
|
||||||
currentValue: null,
|
currentValue: null,
|
||||||
inputText: null,
|
inputText: null,
|
||||||
focused: false,
|
focused: false,
|
||||||
keyboardHeight: 0,
|
keyboardHeight: 0,
|
||||||
|
selection: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this._keyboardDidShow);
|
this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this._keyboardDidShow);
|
||||||
this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide);
|
this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide);
|
||||||
this.setSelection();
|
this.setState({ selection: { start: 0, end: 0 } });
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
@@ -51,15 +54,14 @@ class UriBar extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleChangeText = text => {
|
handleChangeText = text => {
|
||||||
|
this.setState({ selection: undefined });
|
||||||
const newValue = text || '';
|
const newValue = text || '';
|
||||||
clearTimeout(this.state.changeTextTimeout);
|
clearTimeout(this.changeTextTimeout);
|
||||||
const { updateSearchQuery, onSearchSubmitted, showUriBarSuggestions, navigation } = this.props;
|
const { updateSearchQuery, onSearchSubmitted, showUriBarSuggestions, navigation } = this.props;
|
||||||
|
|
||||||
updateSearchQuery(text);
|
this.changeTextTimeout = -1;
|
||||||
|
|
||||||
let timeout = -1;
|
|
||||||
if (!showUriBarSuggestions) {
|
if (!showUriBarSuggestions) {
|
||||||
timeout = setTimeout(() => {
|
this.changeTextTimeout = setTimeout(() => {
|
||||||
if (text.trim().length === 0) {
|
if (text.trim().length === 0) {
|
||||||
// don't do anything if the text is empty
|
// don't do anything if the text is empty
|
||||||
return;
|
return;
|
||||||
@@ -67,6 +69,7 @@ class UriBar extends React.PureComponent {
|
|||||||
|
|
||||||
if (!text.startsWith('lbry://')) {
|
if (!text.startsWith('lbry://')) {
|
||||||
// not a URI input, so this is a search, perform a direct search
|
// not a URI input, so this is a search, perform a direct search
|
||||||
|
updateSearchQuery(text);
|
||||||
if (onSearchSubmitted) {
|
if (onSearchSubmitted) {
|
||||||
onSearchSubmitted(text);
|
onSearchSubmitted(text);
|
||||||
} else {
|
} else {
|
||||||
@@ -74,12 +77,14 @@ class UriBar extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, UriBar.INPUT_TIMEOUT);
|
}, UriBar.INPUT_TIMEOUT);
|
||||||
|
} else {
|
||||||
|
updateSearchQuery(text);
|
||||||
}
|
}
|
||||||
this.setState({ inputText: newValue, currentValue: newValue, changeTextTimeout: timeout });
|
this.setState({ inputText: newValue, currentValue: newValue });
|
||||||
};
|
};
|
||||||
|
|
||||||
handleItemPress = item => {
|
handleItemPress = item => {
|
||||||
const { navigation, onSearchSubmitted, updateSearchQuery } = this.props;
|
const { navigation, onSearchSubmitted, setPlayerVisible, updateSearchQuery } = this.props;
|
||||||
const { type, value } = item;
|
const { type, value } = item;
|
||||||
|
|
||||||
Keyboard.dismiss();
|
Keyboard.dismiss();
|
||||||
@@ -108,7 +113,7 @@ class UriBar extends React.PureComponent {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
const uri = normalizeURI(value);
|
const uri = normalizeURI(value);
|
||||||
navigateToUri(navigation, uri);
|
navigateToUri(navigation, uri, null, false, null, setPlayerVisible);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -123,14 +128,8 @@ class UriBar extends React.PureComponent {
|
|||||||
this.setState({ focused: false, keyboardHeight: 0 });
|
this.setState({ focused: false, keyboardHeight: 0 });
|
||||||
};
|
};
|
||||||
|
|
||||||
setSelection() {
|
|
||||||
if (this.textInput) {
|
|
||||||
this.textInput.setNativeProps({ selection: { start: 0, end: 0 } });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
handleSubmitEditing = () => {
|
handleSubmitEditing = () => {
|
||||||
const { navigation, onSearchSubmitted, updateSearchQuery } = this.props;
|
const { navigation, onSearchSubmitted, setPlayerVisible, updateSearchQuery } = this.props;
|
||||||
if (this.state.inputText) {
|
if (this.state.inputText) {
|
||||||
let inputText = this.state.inputText,
|
let inputText = this.state.inputText,
|
||||||
inputTextIsUrl = false;
|
inputTextIsUrl = false;
|
||||||
@@ -139,7 +138,7 @@ class UriBar extends React.PureComponent {
|
|||||||
// if it's a URI (lbry://...), open the file page
|
// if it's a URI (lbry://...), open the file page
|
||||||
if (transformedUrl && isURIValid(transformedUrl)) {
|
if (transformedUrl && isURIValid(transformedUrl)) {
|
||||||
inputTextIsUrl = true;
|
inputTextIsUrl = true;
|
||||||
navigateToUri(navigation, transformedUrl);
|
navigateToUri(navigation, transformedUrl, null, false, null, setPlayerVisible);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,9 +158,58 @@ class UriBar extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
onSearchPageBlurred() {
|
handleFocus = () => {
|
||||||
this.setState({ currenValueSet: false });
|
this.setState(
|
||||||
}
|
{
|
||||||
|
focused: true,
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
this.setState({
|
||||||
|
selection: { start: 0, end: this.state.currentValue ? this.state.currentValue.length : 0 },
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
handleTouchStart = () => {
|
||||||
|
if (this.state.focused) {
|
||||||
|
this.setState({ selection: null });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
handleBlur = () => {
|
||||||
|
this.setState({
|
||||||
|
focused: false,
|
||||||
|
selection: { start: 0, end: 0 },
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
handleNavigationButtonPress = () => {
|
||||||
|
const { navigation } = this.props;
|
||||||
|
if (!navigation.openDrawer) {
|
||||||
|
Alert.alert(
|
||||||
|
__('Stop watching?'),
|
||||||
|
'The LBRY service is still loading stuff in the background. Would you like to continue?',
|
||||||
|
[
|
||||||
|
{ text: __('No') },
|
||||||
|
{
|
||||||
|
text: __('Yes'),
|
||||||
|
onPress: () => {
|
||||||
|
const resetAction = StackActions.reset({
|
||||||
|
index: 0,
|
||||||
|
actions: [
|
||||||
|
NavigationActions.navigate({ routeName: 'Splash', params: { resetUrl: 'lbry://?subscriptions' } }),
|
||||||
|
],
|
||||||
|
});
|
||||||
|
navigation.dispatch(resetAction);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
navigation.openDrawer();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
@@ -242,7 +290,7 @@ class UriBar extends React.PureComponent {
|
|||||||
size={24}
|
size={24}
|
||||||
style={uriBarStyle.drawerMenuButton}
|
style={uriBarStyle.drawerMenuButton}
|
||||||
iconStyle={uriBarStyle.drawerHamburger}
|
iconStyle={uriBarStyle.drawerHamburger}
|
||||||
onPress={() => navigation.openDrawer()}
|
onPress={this.handleNavigationButtonPress}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{!selectionMode && (
|
{!selectionMode && (
|
||||||
@@ -250,12 +298,10 @@ class UriBar extends React.PureComponent {
|
|||||||
ref={ref => {
|
ref={ref => {
|
||||||
this.textInput = ref;
|
this.textInput = ref;
|
||||||
}}
|
}}
|
||||||
|
onTouchStart={this.handleTouchStart}
|
||||||
autoCorrect={false}
|
autoCorrect={false}
|
||||||
style={uriBarStyle.uriText}
|
style={uriBarStyle.uriText}
|
||||||
onLayout={() => {
|
selection={this.state.selection}
|
||||||
this.setSelection();
|
|
||||||
}}
|
|
||||||
selectTextOnFocus
|
|
||||||
placeholder={__('Search movies, music, and more')}
|
placeholder={__('Search movies, music, and more')}
|
||||||
underlineColorAndroid={'transparent'}
|
underlineColorAndroid={'transparent'}
|
||||||
numberOfLines={1}
|
numberOfLines={1}
|
||||||
@@ -264,11 +310,8 @@ class UriBar extends React.PureComponent {
|
|||||||
returnKeyType={'go'}
|
returnKeyType={'go'}
|
||||||
inlineImageLeft={'baseline_search_black_24'}
|
inlineImageLeft={'baseline_search_black_24'}
|
||||||
inlineImagePadding={16}
|
inlineImagePadding={16}
|
||||||
onFocus={() => this.setState({ focused: true })}
|
onFocus={this.handleFocus}
|
||||||
onBlur={() => {
|
onBlur={this.handleBlur}
|
||||||
this.setState({ focused: false });
|
|
||||||
this.setSelection();
|
|
||||||
}}
|
|
||||||
onChangeText={this.handleChangeText}
|
onChangeText={this.handleChangeText}
|
||||||
onSubmitEditing={this.handleSubmitEditing}
|
onSubmitEditing={this.handleSubmitEditing}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import { connect } from 'react-redux';
|
||||||
|
import { selectClaimsBalance, selectSupportsBalance, selectTipsBalance } from 'lbry-redux';
|
||||||
|
import WalletBalanceExtra from './view';
|
||||||
|
|
||||||
|
const select = state => ({
|
||||||
|
claimsBalance: selectClaimsBalance(state) || 0,
|
||||||
|
supportsBalance: selectSupportsBalance(state) || 0,
|
||||||
|
tipsBalance: selectTipsBalance(state) || 0,
|
||||||
|
});
|
||||||
|
|
||||||
|
export default connect(
|
||||||
|
select,
|
||||||
|
null,
|
||||||
|
)(WalletBalanceExtra);
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
// @flow
|
||||||
|
import React from 'react';
|
||||||
|
import { Image, Text, View } from 'react-native';
|
||||||
|
import { Lbry, formatCredits } from 'lbry-redux';
|
||||||
|
import Address from 'component/address';
|
||||||
|
import Button from 'component/button';
|
||||||
|
import Colors from 'styles/colors';
|
||||||
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||||
|
import walletStyle from 'styles/wallet';
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
claimsBalance: number,
|
||||||
|
supportsBalance: number,
|
||||||
|
tipsBalance: number,
|
||||||
|
};
|
||||||
|
|
||||||
|
class WalletBalanceExtra extends React.PureComponent<Props> {
|
||||||
|
render() {
|
||||||
|
const { claimsBalance, supportsBalance, tipsBalance } = this.props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={walletStyle.balanceExtraCard}>
|
||||||
|
<View style={walletStyle.walletExtraRow}>
|
||||||
|
<View style={walletStyle.walletExtraCol}>
|
||||||
|
<Icon style={walletStyle.walletExtraIcon} color={Colors.LbryGreen} name={'gift'} size={16} />
|
||||||
|
<Text style={walletStyle.walletExtraCaption}>{__('You also have')}</Text>
|
||||||
|
<View style={walletStyle.balanceRow}>
|
||||||
|
<Text style={walletStyle.walletExtraBalance}>{formatCredits(parseFloat(tipsBalance), 2)}</Text>
|
||||||
|
<Text style={walletStyle.walletExtraCurrency}>LBC</Text>
|
||||||
|
</View>
|
||||||
|
<Text style={walletStyle.text}>{__('in tips')}</Text>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={walletStyle.walletExtraCol}>
|
||||||
|
<Icon style={walletStyle.walletExtraIcon} color={Colors.LbryGreen} name={'lock'} size={16} />
|
||||||
|
<Text style={walletStyle.walletExtraCaption}>{__('You staked')}</Text>
|
||||||
|
<View style={walletStyle.balanceRow}>
|
||||||
|
<Text style={walletStyle.walletExtraBalance}>{formatCredits(parseFloat(claimsBalance), 2)}</Text>
|
||||||
|
<Text style={walletStyle.walletExtraCurrency}>LBC</Text>
|
||||||
|
</View>
|
||||||
|
<Text style={walletStyle.text}>{__('in your publishes')}</Text>
|
||||||
|
<View style={[walletStyle.balanceRow, walletStyle.walletExtraTopMargin]}>
|
||||||
|
<Text style={walletStyle.walletExtraBalance}>{formatCredits(parseFloat(supportsBalance), 2)}</Text>
|
||||||
|
<Text style={walletStyle.walletExtraCurrency}>LBC</Text>
|
||||||
|
</View>
|
||||||
|
<Text style={walletStyle.text}>{__('in your supports')}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default WalletBalanceExtra;
|
||||||
@@ -38,9 +38,10 @@ class WalletSend extends React.PureComponent<Props> {
|
|||||||
handleSend = () => {
|
handleSend = () => {
|
||||||
const { balance, sendToAddress, notify } = this.props;
|
const { balance, sendToAddress, notify } = this.props;
|
||||||
const { address, amount } = this.state;
|
const { address, amount } = this.state;
|
||||||
if (address && !regexAddress.test(address)) {
|
if (address && (!regexAddress.test(address) || address.substring(0, 1) === 'r')) {
|
||||||
notify({
|
notify({
|
||||||
message: __('The recipient address is not a valid LBRY address.'),
|
message: __('The recipient address is not a valid LBRY address.'),
|
||||||
|
isError: true,
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -48,6 +49,7 @@ class WalletSend extends React.PureComponent<Props> {
|
|||||||
if (amount > balance) {
|
if (amount > balance) {
|
||||||
notify({
|
notify({
|
||||||
message: __('Insufficient credits'),
|
message: __('Insufficient credits'),
|
||||||
|
isError: true,
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -72,6 +74,7 @@ class WalletSend extends React.PureComponent<Props> {
|
|||||||
const { notify } = this.props;
|
const { notify } = this.props;
|
||||||
notify({
|
notify({
|
||||||
message: __('The recipient address is not a valid LBRY address.'),
|
message: __('The recipient address is not a valid LBRY address.'),
|
||||||
|
isError: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -97,9 +100,10 @@ class WalletSend extends React.PureComponent<Props> {
|
|||||||
this.setState({
|
this.setState({
|
||||||
address: value,
|
address: value,
|
||||||
addressChanged: true,
|
addressChanged: true,
|
||||||
addressValid: value.trim().length === 0 || regexAddress.test(value),
|
addressValid: value.trim().length === 0 || (regexAddress.test(value) && !value.startsWith('r')),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
numberOfLines={1}
|
||||||
onBlur={this.handleAddressInputBlur}
|
onBlur={this.handleAddressInputBlur}
|
||||||
onSubmitEditing={this.handleAddressInputSubmit}
|
onSubmitEditing={this.handleAddressInputSubmit}
|
||||||
placeholder={'bbFxRyXXXXXXXXXXXZD8nE7XTLUxYnddTs'}
|
placeholder={'bbFxRyXXXXXXXXXXXZD8nE7XTLUxYnddTs'}
|
||||||
|
|||||||
+7
-1
@@ -44,6 +44,7 @@ const Constants = {
|
|||||||
SETTING_BACKUP_DISMISSED: 'backupDismissed',
|
SETTING_BACKUP_DISMISSED: 'backupDismissed',
|
||||||
SETTING_REWARDS_NOT_INTERESTED: 'rewardsNotInterested',
|
SETTING_REWARDS_NOT_INTERESTED: 'rewardsNotInterested',
|
||||||
SETTING_DEVICE_WALLET_SYNCED: 'deviceWalletSynced',
|
SETTING_DEVICE_WALLET_SYNCED: 'deviceWalletSynced',
|
||||||
|
SETTING_DHT_ENABLED: 'dhtEnabled',
|
||||||
|
|
||||||
ACTION_DELETE_COMPLETED_BLOBS: 'DELETE_COMPLETED_BLOBS',
|
ACTION_DELETE_COMPLETED_BLOBS: 'DELETE_COMPLETED_BLOBS',
|
||||||
ACTION_FIRST_RUN_PAGE_CHANGED: 'FIRST_RUN_PAGE_CHANGED',
|
ACTION_FIRST_RUN_PAGE_CHANGED: 'FIRST_RUN_PAGE_CHANGED',
|
||||||
@@ -64,6 +65,8 @@ const Constants = {
|
|||||||
ACTION_CLEAR_PUBLISH_FORM_STATE: 'CLEAR_PUBLISH_FORM_STATE',
|
ACTION_CLEAR_PUBLISH_FORM_STATE: 'CLEAR_PUBLISH_FORM_STATE',
|
||||||
ACTION_CLEAR_CHANNEL_FORM_STATE: 'CLEAR_CHANNEL_FORM_STATE',
|
ACTION_CLEAR_CHANNEL_FORM_STATE: 'CLEAR_CHANNEL_FORM_STATE',
|
||||||
|
|
||||||
|
ACTION_SET_EXPLICIT_NAVIGATE_BACK: 'SET_EXPLICIT_NAVIGATE_BACK',
|
||||||
|
|
||||||
ACTION_FULLSCREEN_MODE_TOGGLED: 'FULLSCREEN_MODE_TOGGLED',
|
ACTION_FULLSCREEN_MODE_TOGGLED: 'FULLSCREEN_MODE_TOGGLED',
|
||||||
|
|
||||||
ORIENTATION_HORIZONTAL: 'horizontal',
|
ORIENTATION_HORIZONTAL: 'horizontal',
|
||||||
@@ -90,6 +93,8 @@ const Constants = {
|
|||||||
DRAWER_ROUTE_TAG: 'Tag',
|
DRAWER_ROUTE_TAG: 'Tag',
|
||||||
DRAWER_ROUTE_CHANNEL_CREATOR: 'ChannelCreator',
|
DRAWER_ROUTE_CHANNEL_CREATOR: 'ChannelCreator',
|
||||||
DRAWER_ROUTE_CHANNEL_CREATOR_FORM: 'ChannnelCreatorForm',
|
DRAWER_ROUTE_CHANNEL_CREATOR_FORM: 'ChannnelCreatorForm',
|
||||||
|
DRAWER_ROUTE_INVITES: 'Invites',
|
||||||
|
DRAWER_ROUTE_LITE_FILE: 'LiteFile',
|
||||||
|
|
||||||
FULL_ROUTE_NAME_DISCOVER: 'DiscoverStack',
|
FULL_ROUTE_NAME_DISCOVER: 'DiscoverStack',
|
||||||
FULL_ROUTE_NAME_WALLET: 'WalletStack',
|
FULL_ROUTE_NAME_WALLET: 'WalletStack',
|
||||||
@@ -134,7 +139,7 @@ const Constants = {
|
|||||||
|
|
||||||
ORDER_BY_EFFECTIVE_AMOUNT: 'effective_amount',
|
ORDER_BY_EFFECTIVE_AMOUNT: 'effective_amount',
|
||||||
|
|
||||||
DEFAULT_PAGE_SIZE: 10,
|
DEFAULT_PAGE_SIZE: 20,
|
||||||
|
|
||||||
ALL_PLACEHOLDER: '_all',
|
ALL_PLACEHOLDER: '_all',
|
||||||
|
|
||||||
@@ -165,6 +170,7 @@ export const DrawerRoutes = [
|
|||||||
Constants.DRAWER_ROUTE_SEARCH,
|
Constants.DRAWER_ROUTE_SEARCH,
|
||||||
Constants.DRAWER_ROUTE_TRANSACTION_HISTORY,
|
Constants.DRAWER_ROUTE_TRANSACTION_HISTORY,
|
||||||
Constants.DRAWER_ROUTE_CHANNEL_CREATOR,
|
Constants.DRAWER_ROUTE_CHANNEL_CREATOR,
|
||||||
|
Constants.DRAWER_ROUTE_INVITES,
|
||||||
];
|
];
|
||||||
|
|
||||||
// sub-pages for main routes
|
// sub-pages for main routes
|
||||||
|
|||||||
+8
-5
@@ -42,6 +42,7 @@ import AppWithNavigationState, {
|
|||||||
} from 'component/AppNavigator';
|
} from 'component/AppNavigator';
|
||||||
import { REHYDRATE, PURGE, persistCombineReducers, persistStore } from 'redux-persist';
|
import { REHYDRATE, PURGE, persistCombineReducers, persistStore } from 'redux-persist';
|
||||||
import { __ } from 'i18n';
|
import { __ } from 'i18n';
|
||||||
|
import reactotron from '../reactotron';
|
||||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import getStoredStateMigrateV4 from 'redux-persist/lib/integration/getStoredStateMigrateV4';
|
import getStoredStateMigrateV4 from 'redux-persist/lib/integration/getStoredStateMigrateV4';
|
||||||
import FilesystemStorage from 'redux-persist-filesystem-storage';
|
import FilesystemStorage from 'redux-persist-filesystem-storage';
|
||||||
@@ -94,6 +95,7 @@ const compressor = createCompressor();
|
|||||||
const authFilter = createFilter('auth', ['authToken']);
|
const authFilter = createFilter('auth', ['authToken']);
|
||||||
const blockedFilter = createFilter('blocked', ['blockedChannels']);
|
const blockedFilter = createFilter('blocked', ['blockedChannels']);
|
||||||
const contentFilter = createFilter('content', ['positions']);
|
const contentFilter = createFilter('content', ['positions']);
|
||||||
|
const drawerFilter = createFilter('drawer', ['lastRouteInStack']);
|
||||||
const saveClaimsFilter = createFilter('claims', ['claimsByUri']);
|
const saveClaimsFilter = createFilter('claims', ['claimsByUri']);
|
||||||
const subscriptionsFilter = createFilter('subscriptions', ['enabledChannelNotifications', 'subscriptions', 'latest']);
|
const subscriptionsFilter = createFilter('subscriptions', ['enabledChannelNotifications', 'subscriptions', 'latest']);
|
||||||
const settingsFilter = createFilter('settings', ['clientSettings']);
|
const settingsFilter = createFilter('settings', ['clientSettings']);
|
||||||
@@ -101,12 +103,13 @@ const tagsFilter = createFilter('tags', ['followedTags']);
|
|||||||
const walletFilter = createFilter('wallet', ['receiveAddress']);
|
const walletFilter = createFilter('wallet', ['receiveAddress']);
|
||||||
|
|
||||||
const v4PersistOptions = {
|
const v4PersistOptions = {
|
||||||
whitelist: ['auth', 'blocked', 'claims', 'content', 'subscriptions', 'settings', 'tags', 'wallet'],
|
whitelist: ['auth', 'blocked', 'claims', 'drawer', 'content', 'subscriptions', 'settings', 'tags', 'wallet'],
|
||||||
// Order is important. Needs to be compressed last or other transforms can't
|
// Order is important. Needs to be compressed last or other transforms can't
|
||||||
// read the data
|
// read the data
|
||||||
transforms: [
|
transforms: [
|
||||||
authFilter,
|
authFilter,
|
||||||
blockedFilter,
|
blockedFilter,
|
||||||
|
drawerFilter,
|
||||||
saveClaimsFilter,
|
saveClaimsFilter,
|
||||||
subscriptionsFilter,
|
subscriptionsFilter,
|
||||||
settingsFilter,
|
settingsFilter,
|
||||||
@@ -179,7 +182,7 @@ const sharedStateCallback = ({ dispatch, getState }) => {
|
|||||||
const emailVerified = selectUserVerifiedEmail(state);
|
const emailVerified = selectUserVerifiedEmail(state);
|
||||||
if (syncEnabled && emailVerified) {
|
if (syncEnabled && emailVerified) {
|
||||||
NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(password =>
|
NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(password =>
|
||||||
dispatch(doGetSync(password))
|
dispatch(doGetSync(password)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -195,13 +198,13 @@ const composeEnhancers = compose;
|
|||||||
const store = createStore(
|
const store = createStore(
|
||||||
enableBatching(reducers),
|
enableBatching(reducers),
|
||||||
{}, // initial state,
|
{}, // initial state,
|
||||||
composeEnhancers(applyMiddleware(...middleware))
|
composeEnhancers(applyMiddleware(...middleware), reactotron.createEnhancer()),
|
||||||
);
|
);
|
||||||
window.store = store;
|
window.store = store;
|
||||||
|
|
||||||
const persistor = persistStore(store, persistOptions, err => {
|
const persistor = persistStore(store, null, err => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log('Unable to load saved SETTINGS');
|
// console.log('Unable to load saved SETTINGS');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
window.persistor = persistor;
|
window.persistor = persistor;
|
||||||
|
|||||||
+18
-7
@@ -10,6 +10,7 @@ import aboutStyle from 'styles/about';
|
|||||||
class AboutPage extends React.PureComponent {
|
class AboutPage extends React.PureComponent {
|
||||||
state = {
|
state = {
|
||||||
appVersion: null,
|
appVersion: null,
|
||||||
|
firebaseToken: null,
|
||||||
lbryId: null,
|
lbryId: null,
|
||||||
versionInfo: null,
|
versionInfo: null,
|
||||||
};
|
};
|
||||||
@@ -45,11 +46,12 @@ class AboutPage extends React.PureComponent {
|
|||||||
setPlayerVisible();
|
setPlayerVisible();
|
||||||
|
|
||||||
NativeModules.Firebase.setCurrentScreen('About').then(result => {
|
NativeModules.Firebase.setCurrentScreen('About').then(result => {
|
||||||
if (NativeModules.VersionInfo) {
|
NativeModules.VersionInfo.getAppVersion().then(version => {
|
||||||
NativeModules.VersionInfo.getAppVersion().then(version => {
|
this.setState({ appVersion: version });
|
||||||
this.setState({ appVersion: version });
|
});
|
||||||
});
|
NativeModules.Firebase.getMessagingToken().then(firebaseToken => {
|
||||||
}
|
this.setState({ firebaseToken });
|
||||||
|
});
|
||||||
Lbry.version().then(info => {
|
Lbry.version().then(info => {
|
||||||
this.setState({
|
this.setState({
|
||||||
versionInfo: info,
|
versionInfo: info,
|
||||||
@@ -77,7 +79,7 @@ class AboutPage extends React.PureComponent {
|
|||||||
<Text style={aboutStyle.title}>{__('Content Freedom')}</Text>
|
<Text style={aboutStyle.title}>{__('Content Freedom')}</Text>
|
||||||
<Text style={aboutStyle.paragraph}>
|
<Text style={aboutStyle.paragraph}>
|
||||||
{__(
|
{__(
|
||||||
'LBRY is a free, open, and community-run digital marketplace. It is a decentralized peer-to-peer content distribution platform for creators to upload and share content, and earn LBRY credits for their effort. Users will be able to find a wide selection of videos, music, ebooks and other digital content they are interested in.'
|
'LBRY is a free, open, and community-run digital marketplace. It is a decentralized peer-to-peer content distribution platform for creators to upload and share content, and earn LBRY credits for their effort. Users will be able to find a wide selection of videos, music, ebooks and other digital content they are interested in.',
|
||||||
)}
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
<View style={aboutStyle.links}>
|
<View style={aboutStyle.links}>
|
||||||
@@ -88,7 +90,7 @@ class AboutPage extends React.PureComponent {
|
|||||||
<Text style={aboutStyle.socialTitle}>{__('Get Social')}</Text>
|
<Text style={aboutStyle.socialTitle}>{__('Get Social')}</Text>
|
||||||
<Text style={aboutStyle.paragraph}>
|
<Text style={aboutStyle.paragraph}>
|
||||||
{__(
|
{__(
|
||||||
'You can interact with the LBRY team and members of the community on Discord, Facebook, Instagram, Twitter or Reddit.'
|
'You can interact with the LBRY team and members of the community on Discord, Facebook, Instagram, Twitter or Reddit.',
|
||||||
)}
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
<View style={aboutStyle.links}>
|
<View style={aboutStyle.links}>
|
||||||
@@ -164,6 +166,15 @@ class AboutPage extends React.PureComponent {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
<View style={aboutStyle.row}>
|
||||||
|
<View style={aboutStyle.col}>
|
||||||
|
<Text style={aboutStyle.text}>{__('Firebase Token')}</Text>
|
||||||
|
<Text selectable style={aboutStyle.lineValueText}>
|
||||||
|
{this.state.firebaseToken ? this.state.firebaseToken : loading}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
<View style={aboutStyle.row}>
|
<View style={aboutStyle.row}>
|
||||||
<View style={aboutStyle.col}>
|
<View style={aboutStyle.col}>
|
||||||
<Text style={aboutStyle.text}>{__('Logs')}</Text>
|
<Text style={aboutStyle.text}>{__('Logs')}</Text>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ const select = (state, props) => ({
|
|||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
abandonClaim: (txid, nout) => dispatch(doAbandonClaim(txid, nout)),
|
abandonClaim: (txid, nout) => dispatch(doAbandonClaim(txid, nout)),
|
||||||
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
fetchChannelListMine: () => dispatch(doFetchChannelListMine(1, 99999, true)),
|
||||||
fetchSubCount: claimId => dispatch(doFetchSubCount(claimId)),
|
fetchSubCount: claimId => dispatch(doFetchSubCount(claimId)),
|
||||||
popDrawerStack: () => dispatch(doPopDrawerStack()),
|
popDrawerStack: () => dispatch(doPopDrawerStack()),
|
||||||
setSortByItem: item => dispatch(doSetSortByItem(item)),
|
setSortByItem: item => dispatch(doSetSortByItem(item)),
|
||||||
@@ -27,5 +27,5 @@ const perform = dispatch => ({
|
|||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
select,
|
select,
|
||||||
perform
|
perform,
|
||||||
)(ChannelPage);
|
)(ChannelPage);
|
||||||
@@ -173,9 +173,10 @@ class ChannelPage extends React.PureComponent {
|
|||||||
const { permanent_url: permanentUrl } = claim;
|
const { permanent_url: permanentUrl } = claim;
|
||||||
navigation.navigate({
|
navigation.navigate({
|
||||||
routeName: Constants.DRAWER_ROUTE_CHANNEL_CREATOR,
|
routeName: Constants.DRAWER_ROUTE_CHANNEL_CREATOR,
|
||||||
params: { editChannelUrl: permanentUrl },
|
params: { editChannelUrl: permanentUrl, returnUrl: permanentUrl },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
this.onEditPressed = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
onTipPressed = () => {
|
onTipPressed = () => {
|
||||||
@@ -210,7 +211,7 @@ class ChannelPage extends React.PureComponent {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
{ cancelable: true }
|
{ cancelable: true },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,7 +13,12 @@ import {
|
|||||||
doToast,
|
doToast,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
import { doGetSync } from 'lbryinc';
|
import { doGetSync } from 'lbryinc';
|
||||||
import { doPushDrawerStack, doPopDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
import {
|
||||||
|
doPushDrawerStack,
|
||||||
|
doPopDrawerStack,
|
||||||
|
doSetPlayerVisible,
|
||||||
|
doSetExplicitNavigateBack,
|
||||||
|
} from 'redux/actions/drawer';
|
||||||
import { doUpdateChannelFormState, doClearChannelFormState } from 'redux/actions/form';
|
import { doUpdateChannelFormState, doClearChannelFormState } from 'redux/actions/form';
|
||||||
import { selectDrawerStack } from 'redux/selectors/drawer';
|
import { selectDrawerStack } from 'redux/selectors/drawer';
|
||||||
import { selectChannelFormState, selectHasChannelFormState } from 'redux/selectors/form';
|
import { selectChannelFormState, selectHasChannelFormState } from 'redux/selectors/form';
|
||||||
@@ -37,16 +42,17 @@ const perform = dispatch => ({
|
|||||||
notify: data => dispatch(doToast(data)),
|
notify: data => dispatch(doToast(data)),
|
||||||
clearChannelFormState: () => dispatch(doClearChannelFormState()),
|
clearChannelFormState: () => dispatch(doClearChannelFormState()),
|
||||||
createChannel: (name, amount, optionalParams) => dispatch(doCreateChannel(name, amount, optionalParams)),
|
createChannel: (name, amount, optionalParams) => dispatch(doCreateChannel(name, amount, optionalParams)),
|
||||||
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
fetchChannelListMine: () => dispatch(doFetchChannelListMine(1, 99999, true)),
|
||||||
getSync: (password, callback) => dispatch(doGetSync(password, callback)),
|
getSync: (password, callback) => dispatch(doGetSync(password, callback)),
|
||||||
updateChannel: params => dispatch(doUpdateChannel(params)),
|
updateChannel: params => dispatch(doUpdateChannel(params)),
|
||||||
updateChannelFormState: data => dispatch(doUpdateChannelFormState(data)),
|
updateChannelFormState: data => dispatch(doUpdateChannelFormState(data)),
|
||||||
pushDrawerStack: (routeName, params) => dispatch(doPushDrawerStack(routeName, params)),
|
pushDrawerStack: (routeName, params) => dispatch(doPushDrawerStack(routeName, params)),
|
||||||
popDrawerStack: () => dispatch(doPopDrawerStack()),
|
popDrawerStack: () => dispatch(doPopDrawerStack()),
|
||||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||||
|
setExplicitNavigateBack: flag => dispatch(doSetExplicitNavigateBack(flag)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
select,
|
select,
|
||||||
perform
|
perform,
|
||||||
)(ChannelCreator);
|
)(ChannelCreator);
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { CLAIM_VALUES, formatCredits, isNameValid, regexInvalidURI } from 'lbry-redux';
|
import { CLAIM_VALUES, Lbry, formatCredits, isNameValid, regexInvalidURI } from 'lbry-redux';
|
||||||
import {
|
import {
|
||||||
ActivityIndicator,
|
ActivityIndicator,
|
||||||
Alert,
|
Alert,
|
||||||
@@ -14,13 +14,14 @@ import {
|
|||||||
TouchableOpacity,
|
TouchableOpacity,
|
||||||
View,
|
View,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import { navigateToUri, logPublish, uploadImageAsset } from 'utils/helper';
|
import { navigateBack, navigateToUri, logPublish, uploadImageAsset } from 'utils/helper';
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
import ChannelIconItem from 'component/channelIconItem';
|
import ChannelIconItem from 'component/channelIconItem';
|
||||||
import ChannelRewardsDriver from 'component/channelRewardsDriver';
|
import ChannelRewardsDriver from 'component/channelRewardsDriver';
|
||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import EmptyStateView from 'component/emptyStateView';
|
import EmptyStateView from 'component/emptyStateView';
|
||||||
|
import FastImage from 'react-native-fast-image';
|
||||||
import FloatingWalletBalance from 'component/floatingWalletBalance';
|
import FloatingWalletBalance from 'component/floatingWalletBalance';
|
||||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||||
import Link from 'component/link';
|
import Link from 'component/link';
|
||||||
@@ -36,6 +37,7 @@ export default class ChannelCreator extends React.PureComponent {
|
|||||||
|
|
||||||
state = {
|
state = {
|
||||||
autoStyle: null,
|
autoStyle: null,
|
||||||
|
returnUrl: null,
|
||||||
canSave: true,
|
canSave: true,
|
||||||
claimId: null,
|
claimId: null,
|
||||||
creditsInputFocused: false,
|
creditsInputFocused: false,
|
||||||
@@ -76,6 +78,7 @@ export default class ChannelCreator extends React.PureComponent {
|
|||||||
descriptionFocused: false,
|
descriptionFocused: false,
|
||||||
websiteFocused: false,
|
websiteFocused: false,
|
||||||
emailFocused: false,
|
emailFocused: false,
|
||||||
|
hasReturnedBack: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
didFocusListener;
|
didFocusListener;
|
||||||
@@ -117,7 +120,14 @@ export default class ChannelCreator extends React.PureComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
const { currentRoute: prevRoute, drawerStack: prevDrawerStack, notify } = this.props;
|
const {
|
||||||
|
currentRoute: prevRoute,
|
||||||
|
drawerStack: prevDrawerStack,
|
||||||
|
popDrawerStack,
|
||||||
|
setPlayerVisible,
|
||||||
|
navigation,
|
||||||
|
notify,
|
||||||
|
} = this.props;
|
||||||
const { currentRoute, drawerStack, updatingChannel, updateChannelError } = nextProps;
|
const { currentRoute, drawerStack, updatingChannel, updateChannelError } = nextProps;
|
||||||
|
|
||||||
if (Constants.DRAWER_ROUTE_CHANNEL_CREATOR === currentRoute && currentRoute !== prevRoute) {
|
if (Constants.DRAWER_ROUTE_CHANNEL_CREATOR === currentRoute && currentRoute !== prevRoute) {
|
||||||
@@ -141,6 +151,11 @@ export default class ChannelCreator extends React.PureComponent {
|
|||||||
) {
|
) {
|
||||||
// navigated back from the form
|
// navigated back from the form
|
||||||
this.setState({ currentPhase: Constants.PHASE_LIST });
|
this.setState({ currentPhase: Constants.PHASE_LIST });
|
||||||
|
if (!this.state.hasReturnedBack && this.state.returnUrl) {
|
||||||
|
this.setState({ hasReturnedBack: true }, () => {
|
||||||
|
navigateBack(navigation, drawerStack, popDrawerStack, setPlayerVisible);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,11 +185,12 @@ export default class ChannelCreator extends React.PureComponent {
|
|||||||
|
|
||||||
let isEditMode = false;
|
let isEditMode = false;
|
||||||
if (navigation.state.params) {
|
if (navigation.state.params) {
|
||||||
const { editChannelUrl, displayForm } = navigation.state.params;
|
const { editChannelUrl, displayForm, returnUrl } = navigation.state.params;
|
||||||
if (editChannelUrl) {
|
if (editChannelUrl) {
|
||||||
isEditMode = true;
|
isEditMode = true;
|
||||||
this.setState({ editChannelUrl, currentPhase: Constants.PHASE_CREATE });
|
this.setState({ editChannelUrl, currentPhase: Constants.PHASE_CREATE });
|
||||||
}
|
}
|
||||||
|
this.setState({ returnUrl });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isEditMode && hasFormState) {
|
if (!isEditMode && hasFormState) {
|
||||||
@@ -225,9 +241,9 @@ export default class ChannelCreator extends React.PureComponent {
|
|||||||
error => {
|
error => {
|
||||||
notify({ message: `The image could not be uploaded: ${error}` });
|
notify({ message: `The image could not be uploaded: ${error}` });
|
||||||
this.setState({ uploadingImage: false });
|
this.setState({ uploadingImage: false });
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// could not determine the file path
|
// could not determine the file path
|
||||||
@@ -489,12 +505,12 @@ export default class ChannelCreator extends React.PureComponent {
|
|||||||
claim_id: claimId,
|
claim_id: claimId,
|
||||||
amount: newChannelBid,
|
amount: newChannelBid,
|
||||||
},
|
},
|
||||||
optionalParams
|
optionalParams,
|
||||||
);
|
);
|
||||||
this.setState({ updateChannelStarted: true }, () => updateChannel(params));
|
this.setState({ updateChannelStarted: true }, () => updateChannel(params));
|
||||||
} else {
|
} else {
|
||||||
this.setState({ creatingChannel: true }, () =>
|
this.setState({ creatingChannel: true }, () =>
|
||||||
createChannel(channelName, newChannelBid, optionalParams).then(success, failure)
|
createChannel(channelName, newChannelBid, optionalParams).then(success, failure),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -527,7 +543,7 @@ export default class ChannelCreator extends React.PureComponent {
|
|||||||
avatarImagePickerOpen: false,
|
avatarImagePickerOpen: false,
|
||||||
coverImagePickerOpen: true,
|
coverImagePickerOpen: true,
|
||||||
},
|
},
|
||||||
() => NativeModules.UtilityModule.openDocumentPicker('image/*')
|
() => this.checkStoragePermission(),
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -543,7 +559,7 @@ export default class ChannelCreator extends React.PureComponent {
|
|||||||
avatarImagePickerOpen: true,
|
avatarImagePickerOpen: true,
|
||||||
coverImagePickerOpen: false,
|
coverImagePickerOpen: false,
|
||||||
},
|
},
|
||||||
() => NativeModules.UtilityModule.openDocumentPicker('image/*')
|
() => this.checkStoragePermission(),
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -673,7 +689,7 @@ export default class ChannelCreator extends React.PureComponent {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
{ cancelable: true }
|
{ cancelable: true },
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -749,6 +765,42 @@ export default class ChannelCreator extends React.PureComponent {
|
|||||||
this.addOrRemoveItem(channel);
|
this.addOrRemoveItem(channel);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
checkStoragePermission = () => {
|
||||||
|
// check if we the permission to write to external storage has been granted
|
||||||
|
NativeModules.UtilityModule.canReadWriteStorage().then(canReadWrite => {
|
||||||
|
if (!canReadWrite) {
|
||||||
|
// request permission
|
||||||
|
NativeModules.UtilityModule.requestStoragePermission();
|
||||||
|
} else {
|
||||||
|
NativeModules.UtilityModule.openDocumentPicker('image/*');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
handleStoragePermissionGranted = () => {
|
||||||
|
// update the configured download folder
|
||||||
|
NativeModules.UtilityModule.getDownloadDirectory().then(downloadDirectory => {
|
||||||
|
Lbry.settings_set({
|
||||||
|
key: 'download_dir',
|
||||||
|
value: downloadDirectory,
|
||||||
|
})
|
||||||
|
.then(() => {})
|
||||||
|
.catch(() => {});
|
||||||
|
});
|
||||||
|
|
||||||
|
// open picker for images
|
||||||
|
NativeModules.UtilityModule.openDocumentPicker('image/*');
|
||||||
|
};
|
||||||
|
|
||||||
|
handleStoragePermissionRefused = () => {
|
||||||
|
const { notify } = this.props;
|
||||||
|
notify({
|
||||||
|
message: __('Pictures from your device cannot be used because the permission to read storage was not granted.'),
|
||||||
|
isError: true,
|
||||||
|
});
|
||||||
|
this.setState({ avatarImagePickerOpen: false, coverImagePickerOpen: false });
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { abandoningClaimIds, balance, fetchingChannels, updatingChannel, channels = [], navigation } = this.props;
|
const { abandoningClaimIds, balance, fetchingChannels, updatingChannel, channels = [], navigation } = this.props;
|
||||||
const {
|
const {
|
||||||
@@ -831,9 +883,9 @@ export default class ChannelCreator extends React.PureComponent {
|
|||||||
>
|
>
|
||||||
<View style={[channelCreatorStyle.channelListAvatar, itemAutoStyle]}>
|
<View style={[channelCreatorStyle.channelListAvatar, itemAutoStyle]}>
|
||||||
{itemThumbnailUrl && (
|
{itemThumbnailUrl && (
|
||||||
<Image
|
<FastImage
|
||||||
style={channelCreatorStyle.avatarImage}
|
style={channelCreatorStyle.avatarImage}
|
||||||
resizeMode={'cover'}
|
resizeMode={FastImage.resizeMode.cover}
|
||||||
source={{ uri: itemThumbnailUrl }}
|
source={{ uri: itemThumbnailUrl }}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
@@ -868,7 +920,7 @@ export default class ChannelCreator extends React.PureComponent {
|
|||||||
style={channelCreatorStyle.coverImage}
|
style={channelCreatorStyle.coverImage}
|
||||||
resizeMode={'cover'}
|
resizeMode={'cover'}
|
||||||
source={
|
source={
|
||||||
coverImageUrl !== null && coverImageUrl.trim().length > 0
|
!!coverImageUrl && coverImageUrl.trim().length > 0
|
||||||
? { uri: coverImageUrl }
|
? { uri: coverImageUrl }
|
||||||
: require('../../assets/default_channel_cover.png')
|
: require('../../assets/default_channel_cover.png')
|
||||||
}
|
}
|
||||||
@@ -887,14 +939,15 @@ export default class ChannelCreator extends React.PureComponent {
|
|||||||
|
|
||||||
<View style={[channelCreatorStyle.avatarImageContainer, autoStyle]}>
|
<View style={[channelCreatorStyle.avatarImageContainer, autoStyle]}>
|
||||||
<TouchableOpacity style={channelCreatorStyle.avatarTouchArea} onPress={this.onAvatarImagePress}>
|
<TouchableOpacity style={channelCreatorStyle.avatarTouchArea} onPress={this.onAvatarImagePress}>
|
||||||
{thumbnailUrl !== null && thumbnailUrl.trim().length > 0 && (
|
{!!thumbnailUrl && thumbnailUrl.trim().length > 0 && (
|
||||||
<Image
|
<Image
|
||||||
style={channelCreatorStyle.avatarImage}
|
style={channelCreatorStyle.avatarImage}
|
||||||
resizeMode={'cover'}
|
resizeMode={'cover'}
|
||||||
source={{ uri: thumbnailUrl }}
|
source={{ uri: thumbnailUrl }}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{(thumbnailUrl === null || thumbnailUrl.trim().length === 0) && newChannelName.length > 0 && (
|
{(!!thumbnailUrl || (!!thumbnailUrl && thumbnailUrl.trim().length === 0)) &&
|
||||||
|
newChannelName.length > 0 && (
|
||||||
<Text style={channelIconStyle.autothumbCharacter}>
|
<Text style={channelIconStyle.autothumbCharacter}>
|
||||||
{newChannelName.substring(0, 1).toUpperCase()}
|
{newChannelName.substring(0, 1).toUpperCase()}
|
||||||
</Text>
|
</Text>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import {
|
|||||||
selectSubscriptionClaims,
|
selectSubscriptionClaims,
|
||||||
selectUnreadSubscriptions,
|
selectUnreadSubscriptions,
|
||||||
} from 'lbryinc';
|
} from 'lbryinc';
|
||||||
import { doPushDrawerStack } from 'redux/actions/drawer';
|
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||||
import { doSetClientSetting, doSetSortByItem, doSetTimeItem } from 'redux/actions/settings';
|
import { doSetClientSetting, doSetSortByItem, doSetTimeItem } from 'redux/actions/settings';
|
||||||
import { makeSelectClientSetting, selectSortByItem, selectTimeItem } from 'redux/selectors/settings';
|
import { makeSelectClientSetting, selectSortByItem, selectTimeItem } from 'redux/selectors/settings';
|
||||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
@@ -41,11 +41,12 @@ const perform = dispatch => ({
|
|||||||
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_DISCOVER)),
|
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_DISCOVER)),
|
||||||
removeUnreadSubscriptions: () => dispatch(doRemoveUnreadSubscriptions()),
|
removeUnreadSubscriptions: () => dispatch(doRemoveUnreadSubscriptions()),
|
||||||
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
||||||
|
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||||
setSortByItem: item => dispatch(doSetSortByItem(item)),
|
setSortByItem: item => dispatch(doSetSortByItem(item)),
|
||||||
setTimeItem: item => dispatch(doSetTimeItem(item)),
|
setTimeItem: item => dispatch(doSetTimeItem(item)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
select,
|
select,
|
||||||
perform
|
perform,
|
||||||
)(DiscoverPage);
|
)(DiscoverPage);
|
||||||
+22
-41
@@ -37,29 +37,6 @@ class DiscoverPage extends React.PureComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
// Track the total time taken if this is the first launch
|
|
||||||
AsyncStorage.getItem('firstLaunchTime').then(startTime => {
|
|
||||||
if (startTime !== null && !isNaN(parseInt(startTime, 10))) {
|
|
||||||
// We don't need this value anymore once we've retrieved it
|
|
||||||
AsyncStorage.removeItem('firstLaunchTime');
|
|
||||||
|
|
||||||
// We know this is the first app launch because firstLaunchTime is set and it"s a valid number
|
|
||||||
const start = parseInt(startTime, 10);
|
|
||||||
const now = moment().unix();
|
|
||||||
const delta = now - start;
|
|
||||||
AsyncStorage.getItem('firstLaunchSuspended').then(suspended => {
|
|
||||||
AsyncStorage.removeItem('firstLaunchSuspended');
|
|
||||||
const appSuspended = suspended === 'true';
|
|
||||||
if (NativeModules.Firebase) {
|
|
||||||
NativeModules.Firebase.track('first_run_time', {
|
|
||||||
total_seconds: delta,
|
|
||||||
app_suspended: appSuspended,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const { sortByItem, fetchRewardedContent, fileList, followedTags } = this.props;
|
const { sortByItem, fetchRewardedContent, fileList, followedTags } = this.props;
|
||||||
|
|
||||||
this.buildTagCollection(followedTags);
|
this.buildTagCollection(followedTags);
|
||||||
@@ -86,9 +63,11 @@ class DiscoverPage extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onComponentFocused = () => {
|
onComponentFocused = () => {
|
||||||
const { pushDrawerStack } = this.props;
|
const { pushDrawerStack, setPlayerVisible, currentRoute } = this.props;
|
||||||
// pushDrawerStack();
|
pushDrawerStack();
|
||||||
|
|
||||||
NativeModules.Firebase.setCurrentScreen('Your tags');
|
NativeModules.Firebase.setCurrentScreen('Your tags');
|
||||||
|
setPlayerVisible();
|
||||||
};
|
};
|
||||||
|
|
||||||
handleSortByItemSelected = item => {
|
handleSortByItemSelected = item => {
|
||||||
@@ -135,7 +114,7 @@ class DiscoverPage extends React.PureComponent {
|
|||||||
Alert.alert(
|
Alert.alert(
|
||||||
__('Enjoying LBRY?'),
|
__('Enjoying LBRY?'),
|
||||||
__(
|
__(
|
||||||
'Are you enjoying your experience with the LBRY app? You can leave a review for us on the Play Store.'
|
'Are you enjoying your experience with the LBRY app? You can leave a review for us on the Play Store.',
|
||||||
),
|
),
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -151,7 +130,7 @@ class DiscoverPage extends React.PureComponent {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
{ cancelable: false }
|
{ cancelable: false },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -289,25 +268,27 @@ class DiscoverPage extends React.PureComponent {
|
|||||||
);
|
);
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { navigation, sortByItem, timeItem } = this.props;
|
const { currentRoute, navigation, sortByItem, timeItem } = this.props;
|
||||||
const { orderBy, showModalTagSelector, showSortPicker, showTimePicker } = this.state;
|
const { orderBy, showModalTagSelector, showSortPicker, showTimePicker } = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={discoverStyle.container}>
|
<View style={discoverStyle.container}>
|
||||||
<UriBar navigation={navigation} belowOverlay={showModalTagSelector} />
|
<UriBar navigation={navigation} belowOverlay={showModalTagSelector} />
|
||||||
<SectionList
|
{currentRoute !== Constants.ROUTE_FILE && currentRoute !== Constants.DRAWER_ROUTE_FILE_VIEW && (
|
||||||
ListHeaderComponent={this.sectionListHeader}
|
<SectionList
|
||||||
ListFooterComponent={this.sectionListFooter}
|
ListHeaderComponent={this.sectionListHeader}
|
||||||
style={discoverStyle.scrollContainer}
|
ListFooterComponent={this.sectionListFooter}
|
||||||
contentContainerStyle={discoverStyle.scrollPadding}
|
style={discoverStyle.scrollContainer}
|
||||||
initialNumToRender={4}
|
contentContainerStyle={discoverStyle.scrollPadding}
|
||||||
maxToRenderPerBatch={4}
|
initialNumToRender={4}
|
||||||
removeClippedSubviews
|
maxToRenderPerBatch={4}
|
||||||
renderItem={this.renderSectionListItem}
|
removeClippedSubviews
|
||||||
renderSectionHeader={this.renderSectionHeader}
|
renderItem={this.renderSectionListItem}
|
||||||
sections={this.buildSections()}
|
renderSectionHeader={this.renderSectionHeader}
|
||||||
keyExtractor={(item, index) => item}
|
sections={this.buildSections()}
|
||||||
/>
|
keyExtractor={(item, index) => item}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{!showModalTagSelector && !showSortPicker && !showTimePicker && (
|
{!showModalTagSelector && !showSortPicker && !showTimePicker && (
|
||||||
<FloatingWalletBalance navigation={navigation} />
|
<FloatingWalletBalance navigation={navigation} />
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class DownloadsPage extends React.PureComponent {
|
|||||||
const { claims, fileInfos } = this.props;
|
const { claims, fileInfos } = this.props;
|
||||||
const claimUris = claims.map(claim => normalizeURI(`${claim.name}#${claim.claim_id}`));
|
const claimUris = claims.map(claim => normalizeURI(`${claim.name}#${claim.claim_id}`));
|
||||||
return fileInfos.filter(
|
return fileInfos.filter(
|
||||||
fileInfo => !claimUris.includes(normalizeURI(`${fileInfo.claim_name}#${fileInfo.claim_id}`))
|
fileInfo => !claimUris.includes(normalizeURI(`${fileInfo.claim_name}#${fileInfo.claim_id}`)),
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -125,7 +125,11 @@ class DownloadsPage extends React.PureComponent {
|
|||||||
onPress: () => {
|
onPress: () => {
|
||||||
const uris = Object.keys(selectedClaimsMap);
|
const uris = Object.keys(selectedClaimsMap);
|
||||||
uris.forEach(uri => {
|
uris.forEach(uri => {
|
||||||
const { txid, nout } = selectedClaimsMap[uri];
|
const { txid, nout, name, claim_id: claimId } = selectedClaimsMap[uri];
|
||||||
|
if (name && claimId) {
|
||||||
|
NativeModules.UtilityModule.deleteDownload(normalizeURI(`${name}#${claimId}`));
|
||||||
|
}
|
||||||
|
|
||||||
deleteFile(`${txid}:${nout}`, true);
|
deleteFile(`${txid}:${nout}`, true);
|
||||||
});
|
});
|
||||||
this.onExitSelectionMode();
|
this.onExitSelectionMode();
|
||||||
@@ -135,7 +139,7 @@ class DownloadsPage extends React.PureComponent {
|
|||||||
],
|
],
|
||||||
{
|
{
|
||||||
cancelable: true,
|
cancelable: true,
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -184,7 +188,7 @@ class DownloadsPage extends React.PureComponent {
|
|||||||
this.handleSelectItem(item, claim);
|
this.handleSelectItem(item, claim);
|
||||||
} else {
|
} else {
|
||||||
// TODO: when shortUrl is available for my claims, navigate to that URL instead
|
// TODO: when shortUrl is available for my claims, navigate to that URL instead
|
||||||
navigateToUri(navigation, item, { autoplay: true });
|
navigateToUri(navigation, item, { autoplay: true }, false, null);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
onLongPress={claim => this.handleItemLongPress(item, claim)}
|
onLongPress={claim => this.handleItemLongPress(item, claim)}
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ import {
|
|||||||
selectPurchasedUris,
|
selectPurchasedUris,
|
||||||
selectFailedPurchaseUris,
|
selectFailedPurchaseUris,
|
||||||
selectPurchaseUriErrorMessage,
|
selectPurchaseUriErrorMessage,
|
||||||
selectIsSearching,
|
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
import {
|
import {
|
||||||
doClaimEligiblePurchaseRewards,
|
doClaimEligiblePurchaseRewards,
|
||||||
@@ -41,7 +40,7 @@ import {
|
|||||||
import { doDeleteFile, doStopDownloadingFile } from 'redux/actions/file';
|
import { doDeleteFile, doStopDownloadingFile } from 'redux/actions/file';
|
||||||
import { doPushDrawerStack, doPopDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
import { doPushDrawerStack, doPopDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||||
import { doToggleFullscreenMode } from 'redux/actions/settings';
|
import { doToggleFullscreenMode } from 'redux/actions/settings';
|
||||||
import { selectDrawerStack } from 'redux/selectors/drawer';
|
import { selectDrawerStack, makeSelectPlayerVisible } from 'redux/selectors/drawer';
|
||||||
import FilePage from './view';
|
import FilePage from './view';
|
||||||
|
|
||||||
const select = (state, props) => {
|
const select = (state, props) => {
|
||||||
@@ -61,6 +60,7 @@ const select = (state, props) => {
|
|||||||
fileInfo: makeSelectFileInfoForUri(contentUri)(state),
|
fileInfo: makeSelectFileInfoForUri(contentUri)(state),
|
||||||
rewardedContentClaimIds: selectRewardContentClaimIds(state, selectProps),
|
rewardedContentClaimIds: selectRewardContentClaimIds(state, selectProps),
|
||||||
channelUri: makeSelectChannelForClaimUri(contentUri, true)(state),
|
channelUri: makeSelectChannelForClaimUri(contentUri, true)(state),
|
||||||
|
isPlayerVisible: makeSelectPlayerVisible(uri)(state), // use navigation uri for this selector
|
||||||
position: makeSelectContentPositionForUri(contentUri)(state),
|
position: makeSelectContentPositionForUri(contentUri)(state),
|
||||||
purchasedUris: selectPurchasedUris(state),
|
purchasedUris: selectPurchasedUris(state),
|
||||||
failedPurchaseUris: selectFailedPurchaseUris(state),
|
failedPurchaseUris: selectFailedPurchaseUris(state),
|
||||||
@@ -69,7 +69,6 @@ const select = (state, props) => {
|
|||||||
streamingUrl: makeSelectStreamingUrlForUri(contentUri)(state),
|
streamingUrl: makeSelectStreamingUrlForUri(contentUri)(state),
|
||||||
thumbnail: makeSelectThumbnailForUri(contentUri)(state),
|
thumbnail: makeSelectThumbnailForUri(contentUri)(state),
|
||||||
title: makeSelectTitleForUri(contentUri)(state),
|
title: makeSelectTitleForUri(contentUri)(state),
|
||||||
isSearchingRecommendContent: selectIsSearching(state),
|
|
||||||
viewCount: makeSelectViewCountForUri(contentUri)(state),
|
viewCount: makeSelectViewCountForUri(contentUri)(state),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -83,7 +82,7 @@ const perform = dispatch => ({
|
|||||||
fetchFileInfo: uri => dispatch(doFetchFileInfo(uri)),
|
fetchFileInfo: uri => dispatch(doFetchFileInfo(uri)),
|
||||||
fetchCostInfo: uri => dispatch(doFetchCostInfoForUri(uri)),
|
fetchCostInfo: uri => dispatch(doFetchCostInfoForUri(uri)),
|
||||||
fetchMyClaims: () => dispatch(doFetchClaimListMine()),
|
fetchMyClaims: () => dispatch(doFetchClaimListMine()),
|
||||||
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
fetchChannelListMine: () => dispatch(doFetchChannelListMine(1, 99999, true)),
|
||||||
fetchViewCount: claimId => dispatch(doFetchViewCount(claimId)),
|
fetchViewCount: claimId => dispatch(doFetchViewCount(claimId)),
|
||||||
fileGet: (uri, saveFile) => dispatch(doFileGet(uri, saveFile)),
|
fileGet: (uri, saveFile) => dispatch(doFileGet(uri, saveFile)),
|
||||||
notify: data => dispatch(doToast(data)),
|
notify: data => dispatch(doToast(data)),
|
||||||
@@ -95,7 +94,7 @@ const perform = dispatch => ({
|
|||||||
resolveUris: uris => dispatch(doResolveUris(uris)),
|
resolveUris: uris => dispatch(doResolveUris(uris)),
|
||||||
sendTip: (amount, claimId, isSupport, successCallback, errorCallback) =>
|
sendTip: (amount, claimId, isSupport, successCallback, errorCallback) =>
|
||||||
dispatch(doSendTip(amount, claimId, isSupport, successCallback, errorCallback)),
|
dispatch(doSendTip(amount, claimId, isSupport, successCallback, errorCallback)),
|
||||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(true)),
|
setPlayerVisible: (visible, uri) => dispatch(doSetPlayerVisible(visible, uri)),
|
||||||
stopDownload: (uri, fileInfo) => dispatch(doStopDownloadingFile(uri, fileInfo)),
|
stopDownload: (uri, fileInfo) => dispatch(doStopDownloadingFile(uri, fileInfo)),
|
||||||
toggleFullscreenMode: mode => dispatch(doToggleFullscreenMode(mode)),
|
toggleFullscreenMode: mode => dispatch(doToggleFullscreenMode(mode)),
|
||||||
});
|
});
|
||||||
|
|||||||
+427
-137
@@ -9,6 +9,7 @@ import {
|
|||||||
Image,
|
Image,
|
||||||
Linking,
|
Linking,
|
||||||
NativeModules,
|
NativeModules,
|
||||||
|
Platform,
|
||||||
ScrollView,
|
ScrollView,
|
||||||
StatusBar,
|
StatusBar,
|
||||||
StyleSheet,
|
StyleSheet,
|
||||||
@@ -17,10 +18,10 @@ import {
|
|||||||
TouchableOpacity,
|
TouchableOpacity,
|
||||||
TouchableWithoutFeedback,
|
TouchableWithoutFeedback,
|
||||||
View,
|
View,
|
||||||
WebView,
|
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
|
import { WebView } from 'react-native-webview';
|
||||||
import { NavigationEvents } from 'react-navigation';
|
import { NavigationEvents } from 'react-navigation';
|
||||||
import { navigateBack, navigateToUri, formatLbryUrlForWeb } from 'utils/helper';
|
import { navigateBack, navigateToUri, formatBytes, formatLbryUrlForWeb } from 'utils/helper';
|
||||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||||
import ImageViewer from 'react-native-image-zoom-viewer';
|
import ImageViewer from 'react-native-image-zoom-viewer';
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
@@ -37,6 +38,7 @@ import FloatingWalletBalance from 'component/floatingWalletBalance';
|
|||||||
import Link from 'component/link';
|
import Link from 'component/link';
|
||||||
import MediaPlayer from 'component/mediaPlayer';
|
import MediaPlayer from 'component/mediaPlayer';
|
||||||
import ModalTipView from 'component/modalTipView';
|
import ModalTipView from 'component/modalTipView';
|
||||||
|
import ProgressCircle from 'react-native-progress-circle';
|
||||||
import RelatedContent from 'component/relatedContent';
|
import RelatedContent from 'component/relatedContent';
|
||||||
import SubscribeButton from 'component/subscribeButton';
|
import SubscribeButton from 'component/subscribeButton';
|
||||||
import SubscribeNotificationButton from 'component/subscribeNotificationButton';
|
import SubscribeNotificationButton from 'component/subscribeNotificationButton';
|
||||||
@@ -45,6 +47,8 @@ import Video from 'react-native-video';
|
|||||||
import FileRewardsDriver from 'component/fileRewardsDriver';
|
import FileRewardsDriver from 'component/fileRewardsDriver';
|
||||||
import filePageStyle from 'styles/filePage';
|
import filePageStyle from 'styles/filePage';
|
||||||
import uriBarStyle from 'styles/uriBar';
|
import uriBarStyle from 'styles/uriBar';
|
||||||
|
import RNFS from 'react-native-fs';
|
||||||
|
import showdown from 'showdown';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
|
||||||
class FilePage extends React.PureComponent {
|
class FilePage extends React.PureComponent {
|
||||||
@@ -58,6 +62,14 @@ class FilePage extends React.PureComponent {
|
|||||||
|
|
||||||
startTime = null;
|
startTime = null;
|
||||||
|
|
||||||
|
webView = null;
|
||||||
|
|
||||||
|
converter = null;
|
||||||
|
|
||||||
|
linkHandlerScript = `(function () {
|
||||||
|
window.onclick = function(evt) { evt.preventDefault(); window.ReactNativeWebView.postMessage(evt.target.href); evt.stopPropagation(); }
|
||||||
|
}());`;
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
@@ -83,6 +95,7 @@ class FilePage extends React.PureComponent {
|
|||||||
showImageViewer: false,
|
showImageViewer: false,
|
||||||
showWebView: false,
|
showWebView: false,
|
||||||
showTipView: false,
|
showTipView: false,
|
||||||
|
playbackStarted: false,
|
||||||
playerBgHeight: 0,
|
playerBgHeight: 0,
|
||||||
playerHeight: 0,
|
playerHeight: 0,
|
||||||
uri: null,
|
uri: null,
|
||||||
@@ -91,6 +104,8 @@ class FilePage extends React.PureComponent {
|
|||||||
stopDownloadConfirmed: false,
|
stopDownloadConfirmed: false,
|
||||||
streamingMode: false,
|
streamingMode: false,
|
||||||
viewCountFetched: false,
|
viewCountFetched: false,
|
||||||
|
isRepost: false,
|
||||||
|
uriPushedToDrawerStack: false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,9 +116,28 @@ class FilePage extends React.PureComponent {
|
|||||||
// this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
// this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkRepost = () => {
|
||||||
|
const { claim, isResolvingUri, navigation, pushDrawerStack } = this.props;
|
||||||
|
const { uri } = this.state;
|
||||||
|
if (!isResolvingUri) {
|
||||||
|
if (claim && claim.repost_url) {
|
||||||
|
// redirect to canonical url
|
||||||
|
this.setState({ isRepost: true });
|
||||||
|
navigateToUri(navigation, claim.canonical_url, null, false, claim.permanent_url, false, true);
|
||||||
|
} else {
|
||||||
|
this.setState({ uriPushedToDrawerStack: true }, () => {
|
||||||
|
pushDrawerStack(uri);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
onComponentFocused = () => {
|
onComponentFocused = () => {
|
||||||
StatusBar.setHidden(false);
|
StatusBar.setHidden(false);
|
||||||
NativeModules.Firebase.setCurrentScreen('File').then(result => {
|
NativeModules.Firebase.setCurrentScreen('File').then(result => {
|
||||||
|
const { setPlayerVisible } = this.props;
|
||||||
|
|
||||||
|
DeviceEventEmitter.addListener('onDownloadAborted', this.handleDownloadAborted);
|
||||||
DeviceEventEmitter.addListener('onStoragePermissionGranted', this.handleStoragePermissionGranted);
|
DeviceEventEmitter.addListener('onStoragePermissionGranted', this.handleStoragePermissionGranted);
|
||||||
DeviceEventEmitter.addListener('onStoragePermissionRefused', this.handleStoragePermissionRefused);
|
DeviceEventEmitter.addListener('onStoragePermissionRefused', this.handleStoragePermissionRefused);
|
||||||
|
|
||||||
@@ -111,10 +145,13 @@ class FilePage extends React.PureComponent {
|
|||||||
const { uri, uriVars } = navigation.state.params;
|
const { uri, uriVars } = navigation.state.params;
|
||||||
this.setState({ uri, uriVars });
|
this.setState({ uri, uriVars });
|
||||||
|
|
||||||
|
setPlayerVisible(true, uri);
|
||||||
if (!isResolvingUri && !claim) resolveUri(uri);
|
if (!isResolvingUri && !claim) resolveUri(uri);
|
||||||
|
|
||||||
this.fetchFileInfo(this.props);
|
this.checkRepost();
|
||||||
this.fetchCostInfo(this.props);
|
|
||||||
|
this.fetchFileInfo(uri, this.props);
|
||||||
|
this.fetchCostInfo(uri, this.props);
|
||||||
|
|
||||||
fetchMyClaims();
|
fetchMyClaims();
|
||||||
|
|
||||||
@@ -145,13 +182,12 @@ class FilePage extends React.PureComponent {
|
|||||||
failedPurchaseUris: prevFailedPurchaseUris,
|
failedPurchaseUris: prevFailedPurchaseUris,
|
||||||
fetchViewCount,
|
fetchViewCount,
|
||||||
purchasedUris: prevPurchasedUris,
|
purchasedUris: prevPurchasedUris,
|
||||||
|
purchaseUriErrorMessage: prevPurchaseUriErrorMessage,
|
||||||
navigation,
|
navigation,
|
||||||
contentType,
|
contentType,
|
||||||
notify,
|
notify,
|
||||||
recommendedContent: prevRecommendedContent,
|
|
||||||
drawerStack: prevDrawerStack,
|
drawerStack: prevDrawerStack,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const { uri } = navigation.state.params;
|
|
||||||
const {
|
const {
|
||||||
currentRoute: prevRoute,
|
currentRoute: prevRoute,
|
||||||
failedPurchaseUris,
|
failedPurchaseUris,
|
||||||
@@ -160,39 +196,41 @@ class FilePage extends React.PureComponent {
|
|||||||
purchaseUriErrorMessage,
|
purchaseUriErrorMessage,
|
||||||
streamingUrl,
|
streamingUrl,
|
||||||
drawerStack,
|
drawerStack,
|
||||||
recommendedContent,
|
|
||||||
resolveUris,
|
resolveUris,
|
||||||
} = nextProps;
|
} = nextProps;
|
||||||
|
const uri = this.getPurchaseUrl();
|
||||||
|
|
||||||
if (Constants.ROUTE_FILE === currentRoute && currentRoute !== prevRoute) {
|
if (Constants.ROUTE_FILE === currentRoute && currentRoute !== prevRoute) {
|
||||||
this.onComponentFocused();
|
this.onComponentFocused();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (failedPurchaseUris.includes(uri) && !purchasedUris.includes(uri)) {
|
if (failedPurchaseUris.includes(uri) && prevPurchaseUriErrorMessage !== purchaseUriErrorMessage) {
|
||||||
if (purchaseUriErrorMessage && purchaseUriErrorMessage.trim().length > 0) {
|
if (purchaseUriErrorMessage && purchaseUriErrorMessage.trim().length > 0) {
|
||||||
notify({ message: purchaseUriErrorMessage, isError: true });
|
notify({ message: purchaseUriErrorMessage, isError: true });
|
||||||
}
|
}
|
||||||
this.setState({ downloadPressed: false, fileViewLogged: false, mediaLoaded: false });
|
this.setState({ downloadPressed: false, fileViewLogged: false, mediaLoaded: false, showRecommended: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
const mediaType = Lbry.getMediaType(contentType);
|
const mediaType = Lbry.getMediaType(contentType);
|
||||||
const isPlayable = mediaType === 'video' || mediaType === 'audio';
|
const isPlayable = mediaType === 'video' || mediaType === 'audio';
|
||||||
if (this.state.fileGetStarted || prevPurchasedUris.length !== purchasedUris.length) {
|
if (this.state.fileGetStarted || prevPurchasedUris.length !== purchasedUris.length) {
|
||||||
const { permanent_url: permanentUrl } = claim;
|
const { permanent_url: permanentUrl, nout, txid } = claim;
|
||||||
if (purchasedUris.includes(uri) || purchasedUris.includes(permanentUrl)) {
|
const outpoint = `${txid}:${nout}`;
|
||||||
const { nout, txid } = claim;
|
if (this.state.fileGetStarted) {
|
||||||
const outpoint = `${txid}:${nout}`;
|
|
||||||
NativeModules.UtilityModule.queueDownload(outpoint);
|
NativeModules.UtilityModule.queueDownload(outpoint);
|
||||||
|
this.setState({ fileGetStarted: false });
|
||||||
|
}
|
||||||
|
|
||||||
|
if (purchasedUris.includes(uri) || purchasedUris.includes(permanentUrl)) {
|
||||||
// If the media is playable, file/view will be done in onPlaybackStarted
|
// If the media is playable, file/view will be done in onPlaybackStarted
|
||||||
if (!isPlayable && !this.state.fileViewLogged) {
|
if (!isPlayable && !this.state.fileViewLogged) {
|
||||||
this.logFileView(uri, claim);
|
this.logFileView(uri, claim);
|
||||||
}
|
}
|
||||||
this.setState({ fileGetStarted: false });
|
|
||||||
}
|
}
|
||||||
NativeModules.UtilityModule.checkDownloads();
|
NativeModules.UtilityModule.checkDownloads();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.state.streamingMode && isPlayable) {
|
if ((!fileInfo || (fileInfo && !fileInfo.completed)) && !this.state.streamingMode && isPlayable) {
|
||||||
if (streamingUrl) {
|
if (streamingUrl) {
|
||||||
this.setState({ streamingMode: true, currentStreamUrl: streamingUrl });
|
this.setState({ streamingMode: true, currentStreamUrl: streamingUrl });
|
||||||
} else if (fileInfo && fileInfo.streaming_url) {
|
} else if (fileInfo && fileInfo.streaming_url) {
|
||||||
@@ -214,39 +252,62 @@ class FilePage extends React.PureComponent {
|
|||||||
if (claim && !this.state.viewCountFetched) {
|
if (claim && !this.state.viewCountFetched) {
|
||||||
this.setState({ viewCountFetched: true }, () => fetchViewCount(claim.claim_id));
|
this.setState({ viewCountFetched: true }, () => fetchViewCount(claim.claim_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
|
||||||
(!prevRecommendedContent && recommendedContent) ||
|
|
||||||
(recommendedContent && prevRecommendedContent && recommendedContent.length !== prevRecommendedContent.length)
|
|
||||||
) {
|
|
||||||
resolveUris(recommendedContent);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldComponentUpdate(nextProps, nextState) {
|
shouldComponentUpdate(nextProps, nextState) {
|
||||||
return (
|
const { fileInfo: prevFileInfo } = this.props;
|
||||||
Object.keys(this.difference(nextProps, this.props)).length > 0 ||
|
const { fileInfo } = nextProps;
|
||||||
Object.keys(this.difference(nextState, this.state)).length > 0
|
|
||||||
);
|
const propKeyTriggers = ['balance', 'viewCount', 'isResolvingUri'];
|
||||||
|
const stateKeyTriggers = [
|
||||||
|
'downloadPressed',
|
||||||
|
'fullscreenMode',
|
||||||
|
'mediaLoaded',
|
||||||
|
'playerBgHeighht',
|
||||||
|
'playerHeight',
|
||||||
|
'relatedY',
|
||||||
|
'showTipView',
|
||||||
|
'showImageViewer',
|
||||||
|
'showWebView',
|
||||||
|
'showDescription',
|
||||||
|
'showRecommended',
|
||||||
|
'uri',
|
||||||
|
];
|
||||||
|
for (let i = 0; i < propKeyTriggers.length; i++) {
|
||||||
|
const key = propKeyTriggers[i];
|
||||||
|
if (this.props[key] !== nextProps[key]) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (let i = 0; i < stateKeyTriggers.length; i++) {
|
||||||
|
const key = stateKeyTriggers[i];
|
||||||
|
if (this.state[key] !== nextState[key]) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!prevFileInfo && fileInfo) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (prevFileInfo && fileInfo && Object.keys(this.difference(fileInfo, prevFileInfo)).length > 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate(prevProps, prevState) {
|
componentDidUpdate(prevProps, prevState) {
|
||||||
const {
|
const { claim, contentType, costInfo, fileInfo, isResolvingUri, resolveUri, navigation, title } = this.props;
|
||||||
claim,
|
|
||||||
contentType,
|
|
||||||
costInfo,
|
|
||||||
fileInfo,
|
|
||||||
isResolvingUri,
|
|
||||||
resolveUri,
|
|
||||||
navigation,
|
|
||||||
purchaseUri,
|
|
||||||
title,
|
|
||||||
} = this.props;
|
|
||||||
const { uri } = this.state;
|
const { uri } = this.state;
|
||||||
if (!isResolvingUri && claim === undefined && uri) {
|
if (!isResolvingUri && claim === undefined && uri) {
|
||||||
resolveUri(uri);
|
resolveUri(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!prevProps.claim && claim) {
|
||||||
|
this.checkRepost();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Returned to the page. If mediaLoaded, and currentMediaInfo is different, update
|
// Returned to the page. If mediaLoaded, and currentMediaInfo is different, update
|
||||||
if (this.state.mediaLoaded && window.currentMediaInfo && window.currentMediaInfo.uri !== this.state.uri) {
|
if (this.state.mediaLoaded && window.currentMediaInfo && window.currentMediaInfo.uri !== this.state.uri) {
|
||||||
const { metadata } = this.props;
|
const { metadata } = this.props;
|
||||||
@@ -259,31 +320,51 @@ class FilePage extends React.PureComponent {
|
|||||||
|
|
||||||
// attempt to retrieve images and html/text automatically once the claim is loaded, and it's free
|
// attempt to retrieve images and html/text automatically once the claim is loaded, and it's free
|
||||||
const mediaType = Lbry.getMediaType(contentType);
|
const mediaType = Lbry.getMediaType(contentType);
|
||||||
|
const isPlayable = mediaType === 'video' || mediaType === 'audio';
|
||||||
const isViewable = mediaType === 'image' || mediaType === 'text';
|
const isViewable = mediaType === 'image' || mediaType === 'text';
|
||||||
if (claim && costInfo && costInfo.cost === 0 && !this.state.autoGetAttempted && isViewable) {
|
if (claim && costInfo && costInfo.cost === 0 && !this.state.autoGetAttempted && isViewable) {
|
||||||
this.setState({ autoGetAttempted: true }, () => this.checkStoragePermissionForDownload());
|
this.setState({ autoGetAttempted: true }, () => this.checkStoragePermissionForDownload());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fetchFileInfo(props) {
|
if (((costInfo && costInfo.cost > 0) || !isPlayable) && (!fileInfo && !isViewable) && !this.state.showRecommended) {
|
||||||
if (props.fileInfo === undefined) {
|
this.setState({ showRecommended: true });
|
||||||
props.fetchFileInfo(props.navigation.state.params.uri);
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
!fileInfo &&
|
||||||
|
!this.state.autoDownloadStarted &&
|
||||||
|
claim &&
|
||||||
|
costInfo &&
|
||||||
|
costInfo.cost === 0 &&
|
||||||
|
(isPlayable || (this.state.uriVars && this.state.uriVars.download === 'true'))
|
||||||
|
) {
|
||||||
|
this.setState({ autoDownloadStarted: true }, () => {
|
||||||
|
if (!isPlayable) {
|
||||||
|
this.checkStoragePermissionForDownload();
|
||||||
|
} else {
|
||||||
|
this.confirmPurchaseUri(claim.permanent_url, costInfo, !isPlayable);
|
||||||
|
}
|
||||||
|
NativeModules.UtilityModule.checkDownloads();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchCostInfo(props) {
|
fetchFileInfo(uri, props) {
|
||||||
|
if (props.fileInfo === undefined) {
|
||||||
|
props.fetchFileInfo(uri);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fetchCostInfo(uri, props) {
|
||||||
if (props.costInfo === undefined) {
|
if (props.costInfo === undefined) {
|
||||||
props.fetchCostInfo(props.navigation.state.params.uri);
|
props.fetchCostInfo(uri);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handleFullscreenToggle = isFullscreen => {
|
handleFullscreenToggle = isFullscreen => {
|
||||||
const { toggleFullscreenMode } = this.props;
|
const { toggleFullscreenMode } = this.props;
|
||||||
this.setState({ fullscreenMode: isFullscreen });
|
|
||||||
toggleFullscreenMode(isFullscreen);
|
toggleFullscreenMode(isFullscreen);
|
||||||
|
|
||||||
StatusBar.setHidden(isFullscreen);
|
|
||||||
|
|
||||||
if (isFullscreen) {
|
if (isFullscreen) {
|
||||||
// fullscreen, so change orientation to landscape mode
|
// fullscreen, so change orientation to landscape mode
|
||||||
NativeModules.ScreenOrientation.lockOrientationLandscape();
|
NativeModules.ScreenOrientation.lockOrientationLandscape();
|
||||||
@@ -294,33 +375,41 @@ class FilePage extends React.PureComponent {
|
|||||||
// Switch back to portrait mode when the media is not fullscreen
|
// Switch back to portrait mode when the media is not fullscreen
|
||||||
NativeModules.ScreenOrientation.lockOrientationPortrait();
|
NativeModules.ScreenOrientation.lockOrientationPortrait();
|
||||||
|
|
||||||
// hide the navigation bar (on devices that have the soft navigation bar)
|
// show the navigation bar (on devices that have the soft navigation bar)
|
||||||
NativeModules.UtilityModule.showNavigationBar();
|
NativeModules.UtilityModule.showNavigationBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.setState({ fullscreenMode: isFullscreen });
|
||||||
|
StatusBar.setHidden(isFullscreen);
|
||||||
};
|
};
|
||||||
|
|
||||||
onEditPressed = () => {
|
onEditPressed = () => {
|
||||||
const { claim, navigation } = this.props;
|
const { claim, navigation } = this.props;
|
||||||
navigation.navigate({ routeName: Constants.DRAWER_ROUTE_PUBLISH, params: { editMode: true, claimToEdit: claim } });
|
const uri = this.state.uri || this.getPurchaseUrl();
|
||||||
|
navigation.navigate({
|
||||||
|
routeName: Constants.DRAWER_ROUTE_PUBLISH,
|
||||||
|
params: { editMode: true, claimToEdit: claim, returnUrl: uri },
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
onDeletePressed = () => {
|
onDeletePressed = () => {
|
||||||
const { abandonClaim, claim, deleteFile, deletePurchasedUri, myClaimUris, fileInfo, navigation } = this.props;
|
const { abandonClaim, claim, deleteFile, deletePurchasedUri, myClaimUris, fileInfo, navigation } = this.props;
|
||||||
|
|
||||||
Alert.alert(
|
Alert.alert(
|
||||||
'Delete file',
|
__('Delete file'),
|
||||||
'Are you sure you want to remove this file from your device?',
|
__('Are you sure you want to remove this file from your device?'),
|
||||||
[
|
[
|
||||||
{ text: 'No' },
|
{ text: __('No') },
|
||||||
{
|
{
|
||||||
text: 'Yes',
|
text: __('Yes'),
|
||||||
onPress: () => {
|
onPress: () => {
|
||||||
const { uri } = navigation.state.params;
|
const { uri } = navigation.state.params;
|
||||||
|
const purchaseUrl = this.getPurchaseUrl();
|
||||||
|
|
||||||
deleteFile(`${claim.txid}:${claim.nout}`, true);
|
deleteFile(`${claim.txid}:${claim.nout}`, true);
|
||||||
deletePurchasedUri(uri);
|
deletePurchasedUri(uri);
|
||||||
|
|
||||||
NativeModules.UtilityModule.deleteDownload(uri);
|
NativeModules.UtilityModule.deleteDownload(normalizeURI(purchaseUrl));
|
||||||
this.setState({
|
this.setState({
|
||||||
downloadPressed: false,
|
downloadPressed: false,
|
||||||
fileViewLogged: false,
|
fileViewLogged: false,
|
||||||
@@ -348,19 +437,18 @@ class FilePage extends React.PureComponent {
|
|||||||
const { deletePurchasedUri, fileInfo, navigation, notify, stopDownload } = this.props;
|
const { deletePurchasedUri, fileInfo, navigation, notify, stopDownload } = this.props;
|
||||||
|
|
||||||
Alert.alert(
|
Alert.alert(
|
||||||
'Stop download',
|
__('Stop download'),
|
||||||
'Are you sure you want to stop downloading this file?',
|
__('Are you sure you want to stop downloading this file?'),
|
||||||
[
|
[
|
||||||
{ text: 'No' },
|
{ text: __('No') },
|
||||||
{
|
{
|
||||||
text: 'Yes',
|
text: __('Yes'),
|
||||||
onPress: () => {
|
onPress: () => {
|
||||||
const { uri } = navigation.state.params;
|
const uri = this.getPurchaseUrl();
|
||||||
stopDownload(uri, fileInfo);
|
stopDownload(uri, fileInfo);
|
||||||
deletePurchasedUri(uri);
|
deletePurchasedUri(uri);
|
||||||
if (NativeModules.UtilityModule) {
|
NativeModules.UtilityModule.deleteDownload(normalizeURI(uri));
|
||||||
NativeModules.UtilityModule.deleteDownload(uri);
|
|
||||||
}
|
|
||||||
this.setState({
|
this.setState({
|
||||||
downloadPressed: false,
|
downloadPressed: false,
|
||||||
fileViewLogged: false,
|
fileViewLogged: false,
|
||||||
@@ -371,7 +459,7 @@ class FilePage extends React.PureComponent {
|
|||||||
// there can be a bit of lag between the user pressing Yes and the UI being updated
|
// there can be a bit of lag between the user pressing Yes and the UI being updated
|
||||||
// after the file_set_status and file_delete operations, so let the user know
|
// after the file_set_status and file_delete operations, so let the user know
|
||||||
notify({
|
notify({
|
||||||
message: 'The download will stop momentarily. You do not need to wait to discover something else.',
|
message: __('The download will stop momentarily. You do not need to wait to discover something else.'),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -396,12 +484,29 @@ class FilePage extends React.PureComponent {
|
|||||||
if (window.currentMediaInfo) {
|
if (window.currentMediaInfo) {
|
||||||
window.currentMediaInfo = null;
|
window.currentMediaInfo = null;
|
||||||
}
|
}
|
||||||
window.player = null;
|
DeviceEventEmitter.removeListener('onDownloadAborted', this.handleDownloadAborted);
|
||||||
|
|
||||||
DeviceEventEmitter.removeListener('onStoragePermissionGranted', this.handleStoragePermissionGranted);
|
DeviceEventEmitter.removeListener('onStoragePermissionGranted', this.handleStoragePermissionGranted);
|
||||||
DeviceEventEmitter.removeListener('onStoragePermissionRefused', this.handleStoragePermissionRefused);
|
DeviceEventEmitter.removeListener('onStoragePermissionRefused', this.handleStoragePermissionRefused);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleDownloadAborted = evt => {
|
||||||
|
const { deletePurchasedUri, fileInfo, stopDownload } = this.props;
|
||||||
|
const { uri, outpoint } = evt;
|
||||||
|
const purchaseUrl = normalizeURI(this.getPurchaseUrl());
|
||||||
|
if (purchaseUrl === uri) {
|
||||||
|
stopDownload(uri, fileInfo);
|
||||||
|
deletePurchasedUri(uri);
|
||||||
|
NativeModules.UtilityModule.deleteDownload(normalizeURI(uri));
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
downloadPressed: false,
|
||||||
|
fileViewLogged: false,
|
||||||
|
mediaLoaded: false,
|
||||||
|
stopDownloadConfirmed: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
handleStoragePermissionGranted = () => {
|
handleStoragePermissionGranted = () => {
|
||||||
// permission was allowed. proceed to download
|
// permission was allowed. proceed to download
|
||||||
const { notify } = this.props;
|
const { notify } = this.props;
|
||||||
@@ -414,7 +519,7 @@ class FilePage extends React.PureComponent {
|
|||||||
})
|
})
|
||||||
.then(() => this.performDownload())
|
.then(() => this.performDownload())
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
notify({ message: 'The file could not be downloaded to the default download directory.', isError: true });
|
notify({ message: __('The file could not be downloaded to the default download directory.'), isError: true });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -432,12 +537,14 @@ class FilePage extends React.PureComponent {
|
|||||||
if (!fileInfo) {
|
if (!fileInfo) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return 'file:///' + fileInfo.download_path;
|
return 'file://' + fileInfo.download_path;
|
||||||
};
|
};
|
||||||
|
|
||||||
playerUriForFileInfo = fileInfo => {
|
playerUriForFileInfo = fileInfo => {
|
||||||
const { streamingUrl } = this.props;
|
const { streamingUrl } = this.props;
|
||||||
if (fileInfo && fileInfo.download_path) {
|
if (!this.state.streamingMode && fileInfo && fileInfo.download_path && fileInfo.completed) {
|
||||||
|
// take streamingMode in the state into account because if the download completes while
|
||||||
|
// the media is already streaming, it will restart from the beginning
|
||||||
return this.getEncodedDownloadPath(fileInfo);
|
return this.getEncodedDownloadPath(fileInfo);
|
||||||
}
|
}
|
||||||
if (streamingUrl) {
|
if (streamingUrl) {
|
||||||
@@ -528,7 +635,7 @@ class FilePage extends React.PureComponent {
|
|||||||
let timeToStartMillis, timeToStart;
|
let timeToStartMillis, timeToStart;
|
||||||
if (this.startTime) {
|
if (this.startTime) {
|
||||||
timeToStartMillis = Date.now() - this.startTime;
|
timeToStartMillis = Date.now() - this.startTime;
|
||||||
timeToStart = Math.ceil(timeToStartMillis / 1000);
|
timeToStart = Math.ceil(timeToStartMillis / 1000.0);
|
||||||
this.startTime = null;
|
this.startTime = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -538,13 +645,13 @@ class FilePage extends React.PureComponent {
|
|||||||
|
|
||||||
let payload = { uri: uri };
|
let payload = { uri: uri };
|
||||||
if (!isNaN(timeToStart)) {
|
if (!isNaN(timeToStart)) {
|
||||||
payload['time_to_start_seconds'] = timeToStart;
|
payload['time_to_start_seconds'] = parseInt(timeToStart, 10);
|
||||||
payload['time_to_start_ms'] = timeToStartMillis;
|
payload['time_to_start_ms'] = parseInt(timeToStartMillis, 10);
|
||||||
}
|
}
|
||||||
NativeModules.Firebase.track('play', payload);
|
NativeModules.Firebase.track('play', payload);
|
||||||
|
|
||||||
// only fetch recommended content after playback has started
|
// only fetch recommended content after playback has started
|
||||||
this.setState({ showRecommended: true });
|
this.setState({ playbackStarted: true, showRecommended: true });
|
||||||
};
|
};
|
||||||
|
|
||||||
onPlaybackFinished = () => {
|
onPlaybackFinished = () => {
|
||||||
@@ -598,33 +705,102 @@ class FilePage extends React.PureComponent {
|
|||||||
));
|
));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
confirmPurchaseUri = (uri, costInfo, download) => {
|
||||||
|
const { notify, purchaseUri, title } = this.props;
|
||||||
|
if (!costInfo) {
|
||||||
|
notify({ message: __('This content cannot be viewed at this time. Please try again in a bit.'), isError: true });
|
||||||
|
this.setState({ downloadPressed: false });
|
||||||
|
this.fetchCostInfo(uri, this.props);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { cost } = costInfo;
|
||||||
|
if (costInfo.cost > 0) {
|
||||||
|
Alert.alert(
|
||||||
|
__('Confirm Purchase'),
|
||||||
|
__(
|
||||||
|
cost === 1
|
||||||
|
? 'This will purchase "%title%" for %amount% credit'
|
||||||
|
: 'This will purchase "%title%" for %amount% credits',
|
||||||
|
{ title, amount: cost },
|
||||||
|
),
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: __('OK'),
|
||||||
|
onPress: () => {
|
||||||
|
this.startTime = Date.now();
|
||||||
|
purchaseUri(uri, costInfo, download);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ text: __('Cancel') },
|
||||||
|
],
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
// Free content. Just call purchaseUri directly.
|
||||||
|
this.startTime = Date.now();
|
||||||
|
purchaseUri(uri, costInfo, download);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
onFileDownloadButtonPressed = () => {
|
onFileDownloadButtonPressed = () => {
|
||||||
const { claim, costInfo, contentType, purchaseUri, setPlayerVisible } = this.props;
|
this.startTime = Date.now();
|
||||||
|
const { claim, costInfo, contentType, setPlayerVisible } = this.props;
|
||||||
const mediaType = Lbry.getMediaType(contentType);
|
const mediaType = Lbry.getMediaType(contentType);
|
||||||
const isPlayable = mediaType === 'video' || mediaType === 'audio';
|
const isPlayable = mediaType === 'video' || mediaType === 'audio';
|
||||||
const isViewable = mediaType === 'image' || mediaType === 'text';
|
const isViewable = mediaType === 'image' || mediaType === 'text';
|
||||||
|
|
||||||
const { permanent_url: uri } = claim;
|
const purchaseUrl = this.getPurchaseUrl();
|
||||||
NativeModules.Firebase.track('purchase_uri', { uri: uri });
|
NativeModules.Firebase.track('purchase_uri', { uri: purchaseUrl });
|
||||||
|
|
||||||
if (!isPlayable) {
|
if (!isPlayable) {
|
||||||
this.checkStoragePermissionForDownload();
|
this.onDownloadPressed();
|
||||||
} else {
|
} else {
|
||||||
purchaseUri(uri, costInfo, !isPlayable);
|
this.confirmPurchaseUri(purchaseUrl, costInfo, !isPlayable);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isPlayable) {
|
if (isPlayable) {
|
||||||
this.startTime = Date.now();
|
|
||||||
this.setState({ downloadPressed: true, autoPlayMedia: true, stopDownloadConfirmed: false });
|
this.setState({ downloadPressed: true, autoPlayMedia: true, stopDownloadConfirmed: false });
|
||||||
setPlayerVisible();
|
|
||||||
}
|
}
|
||||||
if (isViewable) {
|
if (isViewable) {
|
||||||
this.setState({ downloadPressed: true });
|
this.setState({ downloadPressed: true });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
getPurchaseUrl = () => {
|
||||||
|
const { claim, navigation } = this.props;
|
||||||
|
const permanentUrl = claim ? claim.permanent_url : null;
|
||||||
|
|
||||||
|
let purchaseUrl;
|
||||||
|
if (navigation.state.params) {
|
||||||
|
const { uri, fullUri } = navigation.state.params;
|
||||||
|
purchaseUrl = fullUri || permanentUrl || uri;
|
||||||
|
}
|
||||||
|
if (!purchaseUrl && permanentUrl) {
|
||||||
|
purchaseUrl = permanentUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
return purchaseUrl;
|
||||||
|
};
|
||||||
|
|
||||||
onDownloadPressed = () => {
|
onDownloadPressed = () => {
|
||||||
this.checkStoragePermissionForDownload();
|
const { claim, title } = this.props;
|
||||||
|
const fileSize = claim && claim.value && claim.value.source ? claim.value.source.size : 0;
|
||||||
|
Alert.alert(
|
||||||
|
__('Download file'),
|
||||||
|
fileSize > 0
|
||||||
|
? __('Save "%title%" (%size%) to your device', { title, size: formatBytes(fileSize, 0) })
|
||||||
|
: __('Save "%title%" to your device', { title }),
|
||||||
|
[
|
||||||
|
{ text: __('No') },
|
||||||
|
{
|
||||||
|
text: __('Yes'),
|
||||||
|
onPress: () => {
|
||||||
|
this.checkStoragePermissionForDownload();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
{ cancelable: true },
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
checkStoragePermissionForDownload = () => {
|
checkStoragePermissionForDownload = () => {
|
||||||
@@ -640,7 +816,7 @@ class FilePage extends React.PureComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
performDownload = () => {
|
performDownload = () => {
|
||||||
const { claim, costInfo, purchaseUri } = this.props;
|
const { claim, costInfo, fileGet, fileInfo, purchasedUris } = this.props;
|
||||||
this.setState(
|
this.setState(
|
||||||
{
|
{
|
||||||
downloadPressed: true,
|
downloadPressed: true,
|
||||||
@@ -648,30 +824,39 @@ class FilePage extends React.PureComponent {
|
|||||||
stopDownloadConfirmed: false,
|
stopDownloadConfirmed: false,
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
purchaseUri(claim.permanent_url, costInfo, true);
|
const url = this.getPurchaseUrl();
|
||||||
|
if (fileInfo || purchasedUris.includes(url)) {
|
||||||
|
// file already in library or URI already purchased, use fileGet directly
|
||||||
|
this.setState({ fileGetStarted: true }, () => fileGet(url, true));
|
||||||
|
} else {
|
||||||
|
this.confirmPurchaseUri(url, costInfo, true);
|
||||||
|
}
|
||||||
NativeModules.UtilityModule.checkDownloads();
|
NativeModules.UtilityModule.checkDownloads();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
onBackButtonPressed = () => {
|
onBackButtonPressed = () => {
|
||||||
const { navigation, drawerStack, popDrawerStack } = this.props;
|
const { navigation, drawerStack, popDrawerStack, setPlayerVisible } = this.props;
|
||||||
navigateBack(navigation, drawerStack, popDrawerStack);
|
navigateBack(navigation, drawerStack, popDrawerStack, setPlayerVisible);
|
||||||
};
|
};
|
||||||
|
|
||||||
onSaveFilePressed = () => {
|
onOpenFilePressed = () => {
|
||||||
const { costInfo, fileGet, fileInfo, navigation, purchasedUris, purchaseUri } = this.props;
|
const { contentType, fileInfo, notify } = this.props;
|
||||||
const { uri } = navigation.state.params;
|
const localFileUri = this.localUriForFileInfo(fileInfo);
|
||||||
|
const mediaType = Lbry.getMediaType(contentType);
|
||||||
if (fileInfo || purchasedUris.includes(uri)) {
|
const isViewable = mediaType === 'image' || mediaType === 'text';
|
||||||
// file already in library or URI already purchased, use fileGet directly
|
const isPlayable = mediaType === 'video' || mediaType === 'audio';
|
||||||
this.setState({ fileGetStarted: true }, () => fileGet(uri, true));
|
if (isViewable) {
|
||||||
|
this.openFile(localFileUri, mediaType, contentType);
|
||||||
|
} else if (isPlayable) {
|
||||||
|
notify({ message: __('Please press the Play button.') });
|
||||||
} else {
|
} else {
|
||||||
this.checkStoragePermissionForDownload();
|
notify({ message: __('This file cannot be displayed in the LBRY app.') });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
openFile = (localFileUri, mediaType) => {
|
openFile = (localFileUri, mediaType, contentType) => {
|
||||||
const { pushDrawerStack } = this.props;
|
const { pushDrawerStack } = this.props;
|
||||||
const isWebViewable = mediaType === 'text';
|
const isWebViewable = mediaType === 'text';
|
||||||
|
|
||||||
@@ -686,6 +871,7 @@ class FilePage extends React.PureComponent {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
showImageViewer: true,
|
showImageViewer: true,
|
||||||
|
showRecommended: true,
|
||||||
},
|
},
|
||||||
() => pushDrawerStack(Constants.DRAWER_ROUTE_FILE_VIEW),
|
() => pushDrawerStack(Constants.DRAWER_ROUTE_FILE_VIEW),
|
||||||
);
|
);
|
||||||
@@ -697,13 +883,88 @@ class FilePage extends React.PureComponent {
|
|||||||
this.setState(
|
this.setState(
|
||||||
{
|
{
|
||||||
showWebView: true,
|
showWebView: true,
|
||||||
|
showRecommended: true,
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
pushDrawerStack(Constants.DRAWER_ROUTE_FILE_VIEW);
|
||||||
},
|
},
|
||||||
() => pushDrawerStack(Constants.DRAWER_ROUTE_FILE_VIEW),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
handleWebViewLoad = () => {
|
||||||
|
const { contentType, fileInfo } = this.props;
|
||||||
|
const localFileUri = this.localUriForFileInfo(fileInfo);
|
||||||
|
if (this.webView && ['text/markdown', 'text/md'].includes(contentType)) {
|
||||||
|
RNFS.readFile(localFileUri, 'utf8').then(markdown => {
|
||||||
|
if (this.webView) {
|
||||||
|
if (!this.converter) {
|
||||||
|
this.converter = new showdown.Converter();
|
||||||
|
}
|
||||||
|
const html = this.converter.makeHtml(markdown);
|
||||||
|
this.webView.injectJavaScript(
|
||||||
|
'document.getElementById("content").innerHTML = \'' +
|
||||||
|
html.replace(/\n/g, '').replace(/'/g, "\\'") +
|
||||||
|
"'; true;",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
handleWebViewMessage = evt => {
|
||||||
|
const href = evt.nativeEvent.data;
|
||||||
|
if (href && href.startsWith('http')) {
|
||||||
|
Linking.openURL(href);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
buildWebViewSource = () => {
|
||||||
|
const { contentType, fileInfo } = this.props;
|
||||||
|
const localFileUri = this.localUriForFileInfo(fileInfo);
|
||||||
|
|
||||||
|
if (['text/markdown', 'text/md'].includes(contentType)) {
|
||||||
|
let fontdecl = '';
|
||||||
|
if (Platform.OS === 'android') {
|
||||||
|
fontdecl = `
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
src: url('file:///android_asset/fonts/Inter-Regular.otf');
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter;
|
||||||
|
src: url('file:///android_asset/fonts/Inter-Bold.otf');
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
const html = `
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, user-scalable=no"/>
|
||||||
|
<style type="text/css">
|
||||||
|
${fontdecl}
|
||||||
|
body { font-family: 'Inter', sans-serif; margin: 16px }
|
||||||
|
img { width: 100%; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="content"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
`;
|
||||||
|
|
||||||
|
return { html };
|
||||||
|
}
|
||||||
|
|
||||||
|
return { uri: localFileUri };
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
balance,
|
balance,
|
||||||
@@ -716,6 +977,7 @@ class FilePage extends React.PureComponent {
|
|||||||
contentType,
|
contentType,
|
||||||
tab,
|
tab,
|
||||||
rewardedContentClaimIds,
|
rewardedContentClaimIds,
|
||||||
|
isPlayerVisible,
|
||||||
isResolvingUri,
|
isResolvingUri,
|
||||||
blackListedOutpoints,
|
blackListedOutpoints,
|
||||||
myClaimUris,
|
myClaimUris,
|
||||||
@@ -723,8 +985,7 @@ class FilePage extends React.PureComponent {
|
|||||||
position,
|
position,
|
||||||
purchaseUri,
|
purchaseUri,
|
||||||
pushDrawerStack,
|
pushDrawerStack,
|
||||||
isSearchingRecommendContent,
|
setPlayerVisible,
|
||||||
recommendedContent,
|
|
||||||
thumbnail,
|
thumbnail,
|
||||||
title,
|
title,
|
||||||
viewCount,
|
viewCount,
|
||||||
@@ -737,6 +998,12 @@ class FilePage extends React.PureComponent {
|
|||||||
|
|
||||||
let innerContent = null;
|
let innerContent = null;
|
||||||
if ((isResolvingUri && !claim) || !claim) {
|
if ((isResolvingUri && !claim) || !claim) {
|
||||||
|
if (!isResolvingUri && !claim && !this.state.uriPushedToDrawerStack) {
|
||||||
|
this.setState({ uriPushedToDrawerStack: true }, () => {
|
||||||
|
pushDrawerStack(uri);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={filePageStyle.pageContainer}>
|
<View style={filePageStyle.pageContainer}>
|
||||||
<UriBar value={uri} navigation={navigation} />
|
<UriBar value={uri} navigation={navigation} />
|
||||||
@@ -805,6 +1072,17 @@ class FilePage extends React.PureComponent {
|
|||||||
tags = claim.value.tags;
|
tags = claim.value.tags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isResolvingUri && this.state.isRepost) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// in case we somehow get here without the uri pushed to the drawer stack
|
||||||
|
if (!isResolvingUri && !this.state.isRepost && !this.state.uriPushedToDrawerStack) {
|
||||||
|
this.setState({ uriPushedToDrawerStack: true }, () => {
|
||||||
|
pushDrawerStack(uri);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const completed = fileInfo && fileInfo.completed;
|
const completed = fileInfo && fileInfo.completed;
|
||||||
const isRewardContent = rewardedContentClaimIds.includes(claim.claim_id);
|
const isRewardContent = rewardedContentClaimIds.includes(claim.claim_id);
|
||||||
const description = metadata.description ? metadata.description : null;
|
const description = metadata.description ? metadata.description : null;
|
||||||
@@ -852,25 +1130,9 @@ class FilePage extends React.PureComponent {
|
|||||||
const localFileUri = this.localUriForFileInfo(fileInfo);
|
const localFileUri = this.localUriForFileInfo(fileInfo);
|
||||||
const unsupported = !isPlayable && !canOpen;
|
const unsupported = !isPlayable && !canOpen;
|
||||||
|
|
||||||
if (
|
|
||||||
!this.state.autoDownloadStarted &&
|
|
||||||
claim &&
|
|
||||||
costInfo &&
|
|
||||||
((isPlayable && costInfo.cost === 0) || (this.state.uriVars && this.state.uriVars.download === 'true'))
|
|
||||||
) {
|
|
||||||
this.setState({ autoDownloadStarted: true }, () => {
|
|
||||||
if (!isPlayable) {
|
|
||||||
this.checkStoragePermissionForDownload();
|
|
||||||
} else {
|
|
||||||
purchaseUri(claim.permanent_url, costInfo, !isPlayable);
|
|
||||||
}
|
|
||||||
NativeModules.UtilityModule.checkDownloads();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.state.downloadPressed && canOpen && !this.state.autoOpened) {
|
if (this.state.downloadPressed && canOpen && !this.state.autoOpened) {
|
||||||
// automatically open a web viewable or image file after the download button is pressed
|
// automatically open a web viewable or image file after the download button is pressed
|
||||||
this.setState({ autoOpened: true }, () => this.openFile(localFileUri, mediaType));
|
this.setState({ autoOpened: true }, () => this.openFile(localFileUri, mediaType, contentType));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isChannel) {
|
if (isChannel) {
|
||||||
@@ -881,9 +1143,20 @@ class FilePage extends React.PureComponent {
|
|||||||
<View style={filePageStyle.pageContainer}>
|
<View style={filePageStyle.pageContainer}>
|
||||||
{!this.state.fullscreenMode && <UriBar value={uri} navigation={navigation} />}
|
{!this.state.fullscreenMode && <UriBar value={uri} navigation={navigation} />}
|
||||||
{innerContent}
|
{innerContent}
|
||||||
|
|
||||||
{this.state.showWebView && isWebViewable && (
|
{this.state.showWebView && isWebViewable && (
|
||||||
<WebView allowFileAccess source={{ uri: localFileUri }} style={filePageStyle.viewer} />
|
<WebView
|
||||||
|
ref={ref => {
|
||||||
|
this.webView = ref;
|
||||||
|
}}
|
||||||
|
allowFileAccess
|
||||||
|
javaScriptEnabled
|
||||||
|
originWhiteList={['*']}
|
||||||
|
source={this.buildWebViewSource()}
|
||||||
|
style={filePageStyle.viewer}
|
||||||
|
onLoad={this.handleWebViewLoad}
|
||||||
|
injectedJavaScript={this.linkHandlerScript}
|
||||||
|
onMessage={this.handleWebViewMessage}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
{this.state.showImageViewer && (
|
{this.state.showImageViewer && (
|
||||||
<ImageViewer
|
<ImageViewer
|
||||||
@@ -942,7 +1215,7 @@ class FilePage extends React.PureComponent {
|
|||||||
<FileDownloadButton
|
<FileDownloadButton
|
||||||
uri={claim && claim.permanent_url ? claim.permanent_url : uri}
|
uri={claim && claim.permanent_url ? claim.permanent_url : uri}
|
||||||
style={filePageStyle.downloadButton}
|
style={filePageStyle.downloadButton}
|
||||||
openFile={() => this.openFile(localFileUri, mediaType)}
|
openFile={() => this.openFile(localFileUri, mediaType, contentType)}
|
||||||
isPlayable={isPlayable}
|
isPlayable={isPlayable}
|
||||||
isViewable={isViewable}
|
isViewable={isViewable}
|
||||||
onFileActionPress={this.onFileDownloadButtonPressed}
|
onFileActionPress={this.onFileDownloadButtonPressed}
|
||||||
@@ -950,7 +1223,12 @@ class FilePage extends React.PureComponent {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{!fileInfo && (
|
{!fileInfo && (
|
||||||
<FilePrice uri={uri} style={filePageStyle.filePriceContainer} textStyle={filePageStyle.filePriceText} />
|
<FilePrice
|
||||||
|
uri={claim && claim.permanent_url ? claim.permanent_url : uri}
|
||||||
|
style={filePageStyle.filePriceContainer}
|
||||||
|
textStyle={filePageStyle.filePriceText}
|
||||||
|
iconStyle={filePageStyle.filePriceIcon}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<TouchableOpacity style={filePageStyle.backButton} onPress={this.onBackButtonPressed}>
|
<TouchableOpacity style={filePageStyle.backButton} onPress={this.onBackButtonPressed}>
|
||||||
@@ -973,7 +1251,9 @@ class FilePage extends React.PureComponent {
|
|||||||
{!innerContent &&
|
{!innerContent &&
|
||||||
(this.state.streamingMode || (canLoadMedia && fileInfo && isPlayable)) &&
|
(this.state.streamingMode || (canLoadMedia && fileInfo && isPlayable)) &&
|
||||||
this.state.fullscreenMode && <View style={fsPlayerBgStyle} />}
|
this.state.fullscreenMode && <View style={fsPlayerBgStyle} />}
|
||||||
{!innerContent && (this.state.streamingMode || (canLoadMedia && fileInfo && isPlayable)) && (
|
{isPlayerVisible &&
|
||||||
|
!innerContent &&
|
||||||
|
(this.state.streamingMode || (canLoadMedia && fileInfo && isPlayable)) && (
|
||||||
<MediaPlayer
|
<MediaPlayer
|
||||||
claim={claim}
|
claim={claim}
|
||||||
assignPlayer={ref => {
|
assignPlayer={ref => {
|
||||||
@@ -1042,29 +1322,40 @@ class FilePage extends React.PureComponent {
|
|||||||
<Text style={filePageStyle.largeButtonText}>{__('Tip')}</Text>
|
<Text style={filePageStyle.largeButtonText}>{__('Tip')}</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|
||||||
{!canEdit && !isPlayable && (
|
{!canEdit && (
|
||||||
<View style={filePageStyle.sharedLargeButton}>
|
<View style={filePageStyle.sharedLargeButton}>
|
||||||
{!fileInfo ||
|
{!this.state.downloadPressed &&
|
||||||
(fileInfo.written_bytes <= 0 && !completed && (
|
(!fileInfo || !fileInfo.download_path || (fileInfo.written_bytes <= 0 && !completed)) && (
|
||||||
<TouchableOpacity style={filePageStyle.innerLargeButton} onPress={this.onDownloadPressed}>
|
<TouchableOpacity style={filePageStyle.innerLargeButton} onPress={this.onDownloadPressed}>
|
||||||
<Icon name={'download'} size={16} style={filePageStyle.largeButtonIcon} />
|
<Icon name={'download'} size={16} style={filePageStyle.largeButtonIcon} />
|
||||||
<Text style={filePageStyle.largeButtonText}>{__('Download')}</Text>
|
<Text style={filePageStyle.largeButtonText}>{__('Download')}</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
))}
|
)}
|
||||||
|
|
||||||
|
{this.state.downloadPressed && (!fileInfo || fileInfo.written_bytes === 0) && (
|
||||||
|
<ActivityIndicator size={'small'} color={Colors.NextLbryGreen} />
|
||||||
|
)}
|
||||||
|
|
||||||
{!completed &&
|
{!completed &&
|
||||||
fileInfo &&
|
fileInfo &&
|
||||||
!fileInfo.stopped &&
|
|
||||||
fileInfo.written_bytes > 0 &&
|
fileInfo.written_bytes > 0 &&
|
||||||
fileInfo.written_bytes < fileInfo.total_bytes &&
|
fileInfo.written_bytes < fileInfo.total_bytes &&
|
||||||
!this.state.stopDownloadConfirmed && (
|
!this.state.stopDownloadConfirmed && (
|
||||||
<TouchableOpacity style={filePageStyle.innerLargeButton} onPress={this.onStopDownloadPressed}>
|
<TouchableOpacity style={filePageStyle.innerLargeButton} onPress={this.onStopDownloadPressed}>
|
||||||
<Icon name={'stop'} size={16} style={filePageStyle.largeButtonIcon} />
|
<ProgressCircle
|
||||||
|
percent={(fileInfo.written_bytes / fileInfo.total_bytes) * 100}
|
||||||
|
radius={9}
|
||||||
|
borderWidth={2}
|
||||||
|
shadowColor={Colors.ActionGrey}
|
||||||
|
color={Colors.NextLbryGreen}
|
||||||
|
>
|
||||||
|
<Icon name={'stop'} size={6} style={filePageStyle.largeButtonIcon} />
|
||||||
|
</ProgressCircle>
|
||||||
<Text style={filePageStyle.largeButtonText}>{__('Stop')}</Text>
|
<Text style={filePageStyle.largeButtonText}>{__('Stop')}</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{completed && fileInfo && fileInfo.written_bytes >= fileInfo.total_bytes && (
|
{completed && fileInfo && (
|
||||||
<TouchableOpacity style={filePageStyle.innerLargeButton} onPress={this.onOpenFilePressed}>
|
<TouchableOpacity style={filePageStyle.innerLargeButton} onPress={this.onOpenFilePressed}>
|
||||||
<Icon name={'folder-open'} size={16} style={filePageStyle.largeButtonIcon} />
|
<Icon name={'folder-open'} size={16} style={filePageStyle.largeButtonIcon} />
|
||||||
<Text style={filePageStyle.largeButtonText}>{__('Open')}</Text>
|
<Text style={filePageStyle.largeButtonText}>{__('Open')}</Text>
|
||||||
@@ -1114,6 +1405,7 @@ class FilePage extends React.PureComponent {
|
|||||||
null,
|
null,
|
||||||
false,
|
false,
|
||||||
fullChannelUri,
|
fullChannelUri,
|
||||||
|
setPlayerVisible,
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -1132,14 +1424,6 @@ class FilePage extends React.PureComponent {
|
|||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
<View style={filePageStyle.subscriptionRow}>
|
<View style={filePageStyle.subscriptionRow}>
|
||||||
{false && ((isPlayable && !fileInfo) || (isPlayable && fileInfo && !fileInfo.download_path)) && (
|
|
||||||
<Button
|
|
||||||
style={[filePageStyle.actionButton, filePageStyle.saveFileButton]}
|
|
||||||
theme={'light'}
|
|
||||||
icon={'download'}
|
|
||||||
onPress={this.onSaveFilePressed}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{channelName && (
|
{channelName && (
|
||||||
<SubscribeButton
|
<SubscribeButton
|
||||||
style={filePageStyle.actionButton}
|
style={filePageStyle.actionButton}
|
||||||
@@ -1182,7 +1466,13 @@ class FilePage extends React.PureComponent {
|
|||||||
<View onLayout={this.setRelatedContentPosition} />
|
<View onLayout={this.setRelatedContentPosition} />
|
||||||
|
|
||||||
{this.state.showRecommended && (
|
{this.state.showRecommended && (
|
||||||
<RelatedContent navigation={navigation} title={title} uri={fullUri} fullUri={fullUri} />
|
<RelatedContent
|
||||||
|
navigation={navigation}
|
||||||
|
claimId={claim.claim_id}
|
||||||
|
title={title}
|
||||||
|
uri={fullUri}
|
||||||
|
fullUri={fullUri}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
import { connect } from 'react-redux';
|
||||||
|
import { selectMyChannelClaims, selectFetchingMyChannels, doFetchChannelListMine, doToast } from 'lbry-redux';
|
||||||
|
import {
|
||||||
|
selectReferralReward,
|
||||||
|
selectUserInvitesRemaining,
|
||||||
|
selectUserInviteNewIsPending,
|
||||||
|
selectUserInviteNewErrorMessage,
|
||||||
|
selectUserInviteReferralLink,
|
||||||
|
selectUserInviteReferralCode,
|
||||||
|
selectUserInvitees,
|
||||||
|
selectUserInviteStatusIsPending,
|
||||||
|
doFetchInviteStatus,
|
||||||
|
doUserInviteNew,
|
||||||
|
} from 'lbryinc';
|
||||||
|
import { doPushDrawerStack, doPopDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||||
|
import { doUpdateChannelFormState, doClearChannelFormState } from 'redux/actions/form';
|
||||||
|
import { selectDrawerStack } from 'redux/selectors/drawer';
|
||||||
|
import { selectChannelFormState, selectHasChannelFormState } from 'redux/selectors/form';
|
||||||
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
|
import InvitesPage from './view';
|
||||||
|
|
||||||
|
const select = state => ({
|
||||||
|
channels: selectMyChannelClaims(state),
|
||||||
|
fetchingChannels: selectFetchingMyChannels(state),
|
||||||
|
fetchingInvitees: selectUserInviteStatusIsPending(state),
|
||||||
|
errorMessage: selectUserInviteNewErrorMessage(state),
|
||||||
|
invitesRemaining: selectUserInvitesRemaining(state),
|
||||||
|
referralCode: selectUserInviteReferralCode(state),
|
||||||
|
isPending: selectUserInviteNewIsPending(state),
|
||||||
|
invitees: selectUserInvitees(state),
|
||||||
|
referralReward: selectReferralReward(state),
|
||||||
|
});
|
||||||
|
|
||||||
|
const perform = dispatch => ({
|
||||||
|
fetchChannelListMine: () => dispatch(doFetchChannelListMine(1, 99999, true)),
|
||||||
|
fetchInviteStatus: () => dispatch(doFetchInviteStatus()),
|
||||||
|
inviteNew: email => dispatch(doUserInviteNew(email)),
|
||||||
|
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_INVITES)),
|
||||||
|
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||||
|
notify: data => dispatch(doToast(data)),
|
||||||
|
});
|
||||||
|
|
||||||
|
export default connect(
|
||||||
|
select,
|
||||||
|
perform,
|
||||||
|
)(InvitesPage);
|
||||||
@@ -0,0 +1,244 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { Lbry, parseURI } from 'lbry-redux';
|
||||||
|
import {
|
||||||
|
ActivityIndicator,
|
||||||
|
Clipboard,
|
||||||
|
NativeModules,
|
||||||
|
ScrollView,
|
||||||
|
Text,
|
||||||
|
TextInput,
|
||||||
|
TouchableOpacity,
|
||||||
|
View,
|
||||||
|
} from 'react-native';
|
||||||
|
import Colors from 'styles/colors';
|
||||||
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||||
|
import Link from 'component/link';
|
||||||
|
import Button from 'component/button';
|
||||||
|
import ChannelSelector from 'component/channelSelector';
|
||||||
|
import PageHeader from 'component/pageHeader';
|
||||||
|
import RewardCard from 'component/rewardCard';
|
||||||
|
import RewardEnrolment from 'component/rewardEnrolment';
|
||||||
|
import UriBar from 'component/uriBar';
|
||||||
|
import invitesStyle from 'styles/invites';
|
||||||
|
import { fetchReferralCode, logPublish } from 'utils/helper';
|
||||||
|
|
||||||
|
class InvitesPage extends React.PureComponent {
|
||||||
|
state = {
|
||||||
|
channelName: null,
|
||||||
|
email: null,
|
||||||
|
inviteLink: null,
|
||||||
|
selectedChannel: null,
|
||||||
|
};
|
||||||
|
|
||||||
|
componentWillMount() {
|
||||||
|
const { navigation } = this.props;
|
||||||
|
// this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
if (this.didFocusListener) {
|
||||||
|
this.didFocusListener.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onComponentFocused = () => {
|
||||||
|
const { fetchChannelListMine, fetchInviteStatus, pushDrawerStack, navigation, setPlayerVisible, user } = this.props;
|
||||||
|
|
||||||
|
pushDrawerStack();
|
||||||
|
setPlayerVisible();
|
||||||
|
NativeModules.Firebase.setCurrentScreen('Invites').then(result => {
|
||||||
|
fetchReferralCode(
|
||||||
|
response => {
|
||||||
|
if (response && response.length > 0) {
|
||||||
|
// only need to use the first referral code.
|
||||||
|
// inviteLink will be updated after channels are loaded (if the user has created at least one channel)
|
||||||
|
this.setState({ inviteLink: `https://lbry.tv/$/invite/${response[0]}` });
|
||||||
|
}
|
||||||
|
fetchChannelListMine();
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
fetchChannelListMine();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
fetchInviteStatus();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
this.onComponentFocused();
|
||||||
|
}
|
||||||
|
|
||||||
|
handleChannelChange = channelName => {
|
||||||
|
const { channels = [] } = this.props;
|
||||||
|
if (channels && channels.length > 0) {
|
||||||
|
const filtered = channels.filter(c => c.name === channelName);
|
||||||
|
if (filtered.length > 0) {
|
||||||
|
const channel = filtered[0];
|
||||||
|
logPublish(channel);
|
||||||
|
this.setState({ channelName, inviteLink: this.getLinkForChannel(channel) });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
getLinkForChannel = channel => {
|
||||||
|
const parsedUrl = channel.canonical_url ? parseURI(channel.canonical_url) : parseURI(channel.permanent_url);
|
||||||
|
const { claimId, claimName } = parsedUrl;
|
||||||
|
return `https://lbry.tv/$/invite/${claimName}:${claimId}`;
|
||||||
|
};
|
||||||
|
|
||||||
|
handleInviteEmailChange = text => {
|
||||||
|
this.setState({ email: text });
|
||||||
|
};
|
||||||
|
|
||||||
|
handleInvitePress = () => {
|
||||||
|
const { inviteNew, notify } = this.props;
|
||||||
|
const { email } = this.state;
|
||||||
|
if (!email || email.indexOf('@') === -1) {
|
||||||
|
return notify({
|
||||||
|
message: __('Please enter a valid email address to send an invite to.'),
|
||||||
|
isError: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
inviteNew(email);
|
||||||
|
};
|
||||||
|
|
||||||
|
componentWillReceiveProps(nextProps) {
|
||||||
|
const { isPending: prevPending, notify } = this.props;
|
||||||
|
const { channels = [], isPending, errorMessage } = nextProps;
|
||||||
|
const { email } = this.state;
|
||||||
|
|
||||||
|
if (!this.state.channelName && channels && channels.length > 0) {
|
||||||
|
const firstChannel = channels[0];
|
||||||
|
logPublish(firstChannel);
|
||||||
|
this.setState({ channelName: firstChannel.name, inviteLink: this.getLinkForChannel(firstChannel) });
|
||||||
|
}
|
||||||
|
|
||||||
|
if (prevPending && !isPending) {
|
||||||
|
if (errorMessage && errorMessage.trim().length > 0) {
|
||||||
|
notify({ message: errorMessage, isError: true });
|
||||||
|
} else {
|
||||||
|
notify({ message: __(`${email} was invited to the LBRY party!`) });
|
||||||
|
this.setState({ email: null });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
handleInviteLinkPress = () => {
|
||||||
|
const { notify } = this.props;
|
||||||
|
Clipboard.setString(this.state.inviteLink);
|
||||||
|
notify({
|
||||||
|
message: __('Invite link copied'),
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { fetchingInvitees, user, navigation, notify, isPending, invitees } = this.props;
|
||||||
|
const { email, inviteLink } = this.state;
|
||||||
|
const hasInvitees = invitees && invitees.length > 0;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={invitesStyle.container}>
|
||||||
|
<UriBar navigation={navigation} />
|
||||||
|
|
||||||
|
<ScrollView style={invitesStyle.scrollContainer}>
|
||||||
|
<TouchableOpacity style={invitesStyle.rewardDriverCard} onPress={() => navigation.navigate('Rewards')}>
|
||||||
|
<Icon name="award" size={16} style={invitesStyle.rewardDriverIcon} />
|
||||||
|
<Text style={invitesStyle.rewardDriverText}>{__('Earn rewards for inviting your friends.')}</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
|
||||||
|
<View style={invitesStyle.card}>
|
||||||
|
<Text style={invitesStyle.title}>{__('Invite Link')}</Text>
|
||||||
|
<Text style={invitesStyle.text}>
|
||||||
|
{__('Share this link with friends (or enemies) and get 20 LBC when they join lbry.tv')}
|
||||||
|
</Text>
|
||||||
|
|
||||||
|
<Text style={invitesStyle.subTitle}>{__('Your invite link')}</Text>
|
||||||
|
<View style={invitesStyle.row}>
|
||||||
|
<Text selectable numberOfLines={1} style={invitesStyle.inviteLink} onPress={this.handleInviteLinkPress}>
|
||||||
|
{this.state.inviteLink}
|
||||||
|
</Text>
|
||||||
|
<Button icon={'clipboard'} style={invitesStyle.button} onPress={this.handleInviteLinkPress} />
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<Text style={invitesStyle.customizeTitle}>{__('Customize invite link')}</Text>
|
||||||
|
<ChannelSelector
|
||||||
|
showAnonymous={false}
|
||||||
|
channelName={this.state.channelName}
|
||||||
|
onChannelChange={this.handleChannelChange}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={invitesStyle.card}>
|
||||||
|
<Text style={invitesStyle.title}>{__('Invite by Email')}</Text>
|
||||||
|
<Text style={invitesStyle.text}>
|
||||||
|
{__('Invite someone you know by email and earn 20 LBC when they join lbry.tv.')}
|
||||||
|
</Text>
|
||||||
|
|
||||||
|
<TextInput
|
||||||
|
style={invitesStyle.emailInput}
|
||||||
|
editable={!isPending}
|
||||||
|
value={this.state.email}
|
||||||
|
onChangeText={this.handleInviteEmailChange}
|
||||||
|
placeholder={__('imaginary@friend.com')}
|
||||||
|
underlineColorAndroid={Colors.NextLbryGreen}
|
||||||
|
/>
|
||||||
|
<View style={invitesStyle.rightRow}>
|
||||||
|
{isPending && (
|
||||||
|
<ActivityIndicator size={'small'} color={Colors.NextLbryGreen} style={invitesStyle.loading} />
|
||||||
|
)}
|
||||||
|
<Button
|
||||||
|
disabled={!email || email.indexOf('@') === -1 || isPending}
|
||||||
|
style={invitesStyle.button}
|
||||||
|
text={__('Invite')}
|
||||||
|
onPress={this.handleInvitePress}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={[invitesStyle.card, invitesStyle.lastCard]}>
|
||||||
|
<View style={invitesStyle.titleRow}>
|
||||||
|
<Text style={invitesStyle.titleCol}>{__('Invite History')}</Text>
|
||||||
|
{fetchingInvitees && <ActivityIndicator size={'small'} color={Colors.NextLbryGreen} />}
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<Text style={invitesStyle.text}>
|
||||||
|
{__(
|
||||||
|
'Earn 20 LBC for inviting a friend, an enemy, a frenemy, or an enefriend. Everyone needs content freedom.',
|
||||||
|
)}
|
||||||
|
</Text>
|
||||||
|
|
||||||
|
<View style={invitesStyle.invitees}>
|
||||||
|
{hasInvitees && (
|
||||||
|
<View style={invitesStyle.inviteesHeader}>
|
||||||
|
<Text style={invitesStyle.emailHeader} numberOfLines={1}>
|
||||||
|
{__('Email')}
|
||||||
|
</Text>
|
||||||
|
<Text style={invitesStyle.rewardHeader} numberOfLines={1}>
|
||||||
|
{__('Reward')}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
{hasInvitees &&
|
||||||
|
invitees.map(invitee => (
|
||||||
|
<View key={invitee.email} style={invitesStyle.inviteeItem}>
|
||||||
|
<Text style={invitesStyle.inviteeEmail} numberOfLines={1}>
|
||||||
|
{invitee.email}
|
||||||
|
</Text>
|
||||||
|
<Text style={invitesStyle.rewardStatus} numberOfLines={1}>
|
||||||
|
{invitee.invite_reward_claimed && __('Claimed')}
|
||||||
|
{!invitee.invite_reward_claimed &&
|
||||||
|
(invitee.invite_reward_claimable ? __('Claimable') : __('Unclaimable'))}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
))}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</ScrollView>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default InvitesPage;
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import { connect } from 'react-redux';
|
||||||
|
import { makeSelectContentPositionForUri, selectBalance } from 'lbry-redux';
|
||||||
|
import { doClaimEligiblePurchaseRewards, makeSelectViewCountForUri, selectRewardContentClaimIds } from 'lbryinc';
|
||||||
|
import { doSetPlayerVisible } from 'redux/actions/drawer';
|
||||||
|
import { makeSelectPlayerVisible } from 'redux/selectors/drawer';
|
||||||
|
import { doToggleFullscreenMode } from 'redux/actions/settings';
|
||||||
|
import LiteFilePage from './view';
|
||||||
|
|
||||||
|
const select = (state, props) => {
|
||||||
|
const { uri, fullUri } = props.navigation.state.params;
|
||||||
|
const contentUri = fullUri || uri;
|
||||||
|
const selectProps = { uri: contentUri };
|
||||||
|
return {
|
||||||
|
balance: selectBalance(state),
|
||||||
|
isPlayerVisible: makeSelectPlayerVisible(uri)(state), // use navigation uri for this selector
|
||||||
|
position: makeSelectContentPositionForUri(contentUri)(state),
|
||||||
|
viewCount: makeSelectViewCountForUri(contentUri)(state),
|
||||||
|
rewardedContentClaimIds: selectRewardContentClaimIds(state),
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const perform = dispatch => ({
|
||||||
|
claimEligibleRewards: () => dispatch(doClaimEligiblePurchaseRewards()),
|
||||||
|
setPlayerVisible: (visible, uri) => dispatch(doSetPlayerVisible(visible, uri)),
|
||||||
|
toggleFullscreenMode: mode => dispatch(doToggleFullscreenMode(mode)),
|
||||||
|
});
|
||||||
|
|
||||||
|
export default connect(select, perform)(LiteFilePage);
|
||||||
@@ -0,0 +1,289 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { Lbry, formatCredits, normalizeURI, parseURI, parseQueryParams } from 'lbry-redux';
|
||||||
|
import { Lbryio } from 'lbryinc';
|
||||||
|
import {
|
||||||
|
ActivityIndicator,
|
||||||
|
Alert,
|
||||||
|
DeviceEventEmitter,
|
||||||
|
Dimensions,
|
||||||
|
Image,
|
||||||
|
Linking,
|
||||||
|
NativeModules,
|
||||||
|
Platform,
|
||||||
|
ScrollView,
|
||||||
|
StatusBar,
|
||||||
|
StyleSheet,
|
||||||
|
Text,
|
||||||
|
TextInput,
|
||||||
|
TouchableOpacity,
|
||||||
|
TouchableWithoutFeedback,
|
||||||
|
View,
|
||||||
|
} from 'react-native';
|
||||||
|
import UriBar from 'component/uriBar';
|
||||||
|
import Link from 'component/link';
|
||||||
|
import MediaPlayer from 'component/mediaPlayer';
|
||||||
|
import RelatedContent from 'component/relatedContent';
|
||||||
|
import filePageStyle from 'styles/filePage';
|
||||||
|
import { decode, formatLbryUrlForWeb, navigateToUri } from 'utils/helper';
|
||||||
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||||
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
|
import uriBarStyle from 'styles/uriBar';
|
||||||
|
import { NavigationActions, StackActions } from 'react-navigation';
|
||||||
|
|
||||||
|
// This page will only be used for playing audio / video content from a remote stream URL
|
||||||
|
class LiteFilePage extends React.PureComponent {
|
||||||
|
playerBackground = null;
|
||||||
|
|
||||||
|
scrollView = null;
|
||||||
|
|
||||||
|
player = null;
|
||||||
|
|
||||||
|
state = {
|
||||||
|
channelName: null,
|
||||||
|
channelUrl: null,
|
||||||
|
title: null,
|
||||||
|
fullscreenMode: false,
|
||||||
|
playerHeight: null,
|
||||||
|
isLandscape: false,
|
||||||
|
sdkReady: false, // TODO: progressively enable features (e.g. tip) when sdk is ready
|
||||||
|
showRecommended: false,
|
||||||
|
viewCount: 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
checkOrientation = () => {
|
||||||
|
if (this.state.fullscreenMode) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const screenDimension = Dimensions.get('window');
|
||||||
|
const screenWidth = screenDimension.width;
|
||||||
|
const screenHeight = screenDimension.height;
|
||||||
|
const isLandscape = screenWidth > screenHeight;
|
||||||
|
this.setState({ isLandscape });
|
||||||
|
|
||||||
|
if (!this.playerBackground) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isLandscape) {
|
||||||
|
this.playerBackground.setNativeProps({
|
||||||
|
height: screenHeight - StyleSheet.flatten(uriBarStyle.uriContainer).height,
|
||||||
|
});
|
||||||
|
} else if (this.state.playerBgHeight > 0) {
|
||||||
|
this.playerBackground.setNativeProps({ height: this.state.playerBgHeight });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
handleFullscreenToggle = isFullscreen => {
|
||||||
|
const { toggleFullscreenMode } = this.props;
|
||||||
|
toggleFullscreenMode(isFullscreen);
|
||||||
|
|
||||||
|
if (isFullscreen) {
|
||||||
|
// fullscreen, so change orientation to landscape mode
|
||||||
|
NativeModules.ScreenOrientation.lockOrientationLandscape();
|
||||||
|
|
||||||
|
// hide the navigation bar (on devices that have the soft navigation bar)
|
||||||
|
NativeModules.UtilityModule.hideNavigationBar();
|
||||||
|
} else {
|
||||||
|
// Switch back to portrait mode when the media is not fullscreen
|
||||||
|
NativeModules.ScreenOrientation.lockOrientationPortrait();
|
||||||
|
|
||||||
|
// show the navigation bar (on devices that have the soft navigation bar)
|
||||||
|
NativeModules.UtilityModule.showNavigationBar();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setState({ fullscreenMode: isFullscreen });
|
||||||
|
StatusBar.setHidden(isFullscreen);
|
||||||
|
};
|
||||||
|
|
||||||
|
getStreamUrl = url => {
|
||||||
|
const { claimName, claimId } = parseURI(url);
|
||||||
|
return `https://player.lbry.tv/content/claims/${claimName}/${claimId}/stream`;
|
||||||
|
};
|
||||||
|
|
||||||
|
handleSharePress = url => {
|
||||||
|
const shareUrl = Constants.SHARE_BASE_URL + formatLbryUrlForWeb(url);
|
||||||
|
NativeModules.UtilityModule.shareUrl(shareUrl);
|
||||||
|
};
|
||||||
|
|
||||||
|
handleOpenUrl = url => {
|
||||||
|
const { navigation } = this.props;
|
||||||
|
Alert.alert(
|
||||||
|
__('Stop watching?'),
|
||||||
|
'The LBRY service is still loading stuff in the background. Would you like to continue?',
|
||||||
|
[
|
||||||
|
{ text: __('No') },
|
||||||
|
{
|
||||||
|
text: __('Yes'),
|
||||||
|
onPress: () => {
|
||||||
|
const resetAction = StackActions.reset({
|
||||||
|
index: 0,
|
||||||
|
actions: [NavigationActions.navigate({ routeName: 'Splash', params: { resetUrl: url } })],
|
||||||
|
});
|
||||||
|
navigation.dispatch(resetAction);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
componentDidUpdate() {
|
||||||
|
const { navigation } = this.props;
|
||||||
|
const { uri } = navigation.state.params;
|
||||||
|
|
||||||
|
if (!this.state.title) {
|
||||||
|
const params = parseQueryParams(uri);
|
||||||
|
const { channelUrl, contentTitle } = params;
|
||||||
|
const channelName = channelUrl ? parseURI(decode(channelUrl)).claimName : null;
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
title: decode(contentTitle),
|
||||||
|
channelUrl,
|
||||||
|
channelName,
|
||||||
|
showRecommended: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { navigation, rewardedContentClaimIds } = this.props;
|
||||||
|
const { channelName, channelUrl, title, sdkReady, viewCount } = this.state;
|
||||||
|
const { uri } = navigation.state.params;
|
||||||
|
const { claimName, claimId } = parseURI(uri);
|
||||||
|
const isRewardContent = rewardedContentClaimIds.includes(claimId);
|
||||||
|
|
||||||
|
const playerBgStyle = [filePageStyle.playerBackground, filePageStyle.containedPlayerBackground];
|
||||||
|
const fsPlayerBgStyle = [filePageStyle.playerBackground, filePageStyle.fullscreenPlayerBackground];
|
||||||
|
|
||||||
|
const playerStyle = [
|
||||||
|
filePageStyle.player,
|
||||||
|
this.state.isLandscape
|
||||||
|
? filePageStyle.containedPlayerLandscape
|
||||||
|
: this.state.fullscreenMode
|
||||||
|
? filePageStyle.fullscreenPlayer
|
||||||
|
: filePageStyle.containedPlayer,
|
||||||
|
];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={filePageStyle.pageContainer}>
|
||||||
|
{!this.state.fullscreenMode && <UriBar value={uri.split('?')[0]} navigation={navigation} />}
|
||||||
|
|
||||||
|
<View
|
||||||
|
style={this.state.fullscreenMode ? filePageStyle.innerPageContainerFsMode : filePageStyle.innerPageContainer}
|
||||||
|
onLayout={this.checkOrientation}
|
||||||
|
>
|
||||||
|
<TouchableOpacity activeOpacity={0.5} style={filePageStyle.mediaContainer} />
|
||||||
|
|
||||||
|
<View
|
||||||
|
style={playerBgStyle}
|
||||||
|
ref={ref => {
|
||||||
|
this.playerBackground = ref;
|
||||||
|
}}
|
||||||
|
onLayout={evt => {
|
||||||
|
if (!this.state.playerBgHeight) {
|
||||||
|
this.setState({ playerBgHeight: evt.nativeEvent.layout.height });
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{this.state.fullscreenMode && <View style={fsPlayerBgStyle} />}
|
||||||
|
<MediaPlayer
|
||||||
|
assignPlayer={ref => {
|
||||||
|
this.player = ref;
|
||||||
|
}}
|
||||||
|
uri={uri}
|
||||||
|
source={this.getStreamUrl(uri)}
|
||||||
|
style={playerStyle}
|
||||||
|
autoPlay
|
||||||
|
onFullscreenToggled={this.handleFullscreenToggle}
|
||||||
|
onLayout={evt => {
|
||||||
|
if (!this.state.playerHeight) {
|
||||||
|
this.setState({ playerHeight: evt.nativeEvent.layout.height });
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
style={filePageStyle.scrollContainer}
|
||||||
|
contentContainerStyle={filePageStyle.scrollContent}
|
||||||
|
keyboardShouldPersistTaps={'handled'}
|
||||||
|
ref={ref => {
|
||||||
|
this.scrollView = ref;
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<TouchableWithoutFeedback
|
||||||
|
style={filePageStyle.titleTouch}
|
||||||
|
onPress={() => this.setState({ showDescription: !this.state.showDescription })}
|
||||||
|
>
|
||||||
|
<View style={filePageStyle.titleArea}>
|
||||||
|
<View style={filePageStyle.titleRow}>
|
||||||
|
<Text style={filePageStyle.title} selectable>
|
||||||
|
{title}
|
||||||
|
</Text>
|
||||||
|
{isRewardContent && <Icon name="award" style={filePageStyle.rewardIcon} size={16} />}
|
||||||
|
</View>
|
||||||
|
<Text style={filePageStyle.viewCount}>
|
||||||
|
{viewCount === 1 && __('%view% view', { view: viewCount })}
|
||||||
|
{viewCount > 1 && __('%view% views', { view: viewCount })}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</TouchableWithoutFeedback>
|
||||||
|
|
||||||
|
<View style={filePageStyle.largeButtonsRow}>
|
||||||
|
<TouchableOpacity style={filePageStyle.largeButton} onPress={() => this.handleSharePress(uri)}>
|
||||||
|
<Icon name={'share-alt'} size={16} style={filePageStyle.largeButtonIcon} />
|
||||||
|
<Text style={filePageStyle.largeButtonText}>{__('Share')}</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
|
||||||
|
{sdkReady && (
|
||||||
|
<TouchableOpacity
|
||||||
|
style={filePageStyle.largeButton}
|
||||||
|
onPress={() => this.setState({ showTipView: true })}
|
||||||
|
>
|
||||||
|
<Icon name={'gift'} size={16} style={filePageStyle.largeButtonIcon} />
|
||||||
|
<Text style={filePageStyle.largeButtonText}>{__('Tip')}</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={filePageStyle.channelRow}>
|
||||||
|
<View style={filePageStyle.publishInfo}>
|
||||||
|
{channelName && (
|
||||||
|
<Link
|
||||||
|
style={filePageStyle.channelName}
|
||||||
|
selectable
|
||||||
|
text={channelName}
|
||||||
|
numberOfLines={1}
|
||||||
|
ellipsizeMode={'tail'}
|
||||||
|
onPress={() => this.handleOpenUrl(channelUrl)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{!channelName && (
|
||||||
|
<Text style={filePageStyle.anonChannelName} selectable ellipsizeMode={'tail'}>
|
||||||
|
{__('Anonymous')}
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View onLayout={this.setRelatedContentPosition} />
|
||||||
|
|
||||||
|
{this.state.showRecommended && (
|
||||||
|
<RelatedContent
|
||||||
|
navigation={navigation}
|
||||||
|
claimId={claimId}
|
||||||
|
claimName={claimName}
|
||||||
|
title={title}
|
||||||
|
urlOpenHandler={this.handleOpenUrl}
|
||||||
|
uri={uri}
|
||||||
|
fullUri={uri}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</ScrollView>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default LiteFilePage;
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import {
|
import {
|
||||||
doPublish,
|
doPublish,
|
||||||
|
doFetchClaimListMine,
|
||||||
doResolveUri,
|
doResolveUri,
|
||||||
doToast,
|
doToast,
|
||||||
doUpdatePublishForm,
|
doUpdatePublishForm,
|
||||||
@@ -27,6 +28,7 @@ const select = state => ({
|
|||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
notify: data => dispatch(doToast(data)),
|
notify: data => dispatch(doToast(data)),
|
||||||
clearPublishFormState: () => dispatch(doClearPublishFormState()),
|
clearPublishFormState: () => dispatch(doClearPublishFormState()),
|
||||||
|
fetchMyClaims: () => dispatch(doFetchClaimListMine()),
|
||||||
pendingPublishSuccess: pendingClaim => dispatch(doPendingPublishSuccess(pendingClaim)),
|
pendingPublishSuccess: pendingClaim => dispatch(doPendingPublishSuccess(pendingClaim)),
|
||||||
updatePublishForm: value => dispatch(doUpdatePublishForm(value)),
|
updatePublishForm: value => dispatch(doUpdatePublishForm(value)),
|
||||||
updatePublishFormState: data => dispatch(doUpdatePublishFormState(data)),
|
updatePublishFormState: data => dispatch(doUpdatePublishFormState(data)),
|
||||||
@@ -39,5 +41,5 @@ const perform = dispatch => ({
|
|||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
select,
|
select,
|
||||||
perform
|
perform,
|
||||||
)(PublishPage);
|
)(PublishPage);
|
||||||
+128
-32
@@ -16,6 +16,7 @@ import {
|
|||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import { FlatGrid } from 'react-native-super-grid';
|
import { FlatGrid } from 'react-native-super-grid';
|
||||||
import {
|
import {
|
||||||
|
Lbry,
|
||||||
isNameValid,
|
isNameValid,
|
||||||
batchActions,
|
batchActions,
|
||||||
buildURI,
|
buildURI,
|
||||||
@@ -46,7 +47,7 @@ import Tag from 'component/tag';
|
|||||||
import TagSearch from 'component/tagSearch';
|
import TagSearch from 'component/tagSearch';
|
||||||
import UriBar from 'component/uriBar';
|
import UriBar from 'component/uriBar';
|
||||||
import publishStyle from 'styles/publish';
|
import publishStyle from 'styles/publish';
|
||||||
import { navigateToUri, logPublish, uploadImageAsset } from 'utils/helper';
|
import { navigateToUri, navigateBack, logPublish, uploadImageAsset } from 'utils/helper';
|
||||||
|
|
||||||
const languages = {
|
const languages = {
|
||||||
en: 'English',
|
en: 'English',
|
||||||
@@ -139,6 +140,9 @@ class PublishPage extends React.PureComponent {
|
|||||||
|
|
||||||
// other
|
// other
|
||||||
publishStarted: false,
|
publishStarted: false,
|
||||||
|
storagePermissionRequired: false,
|
||||||
|
hasReturnedBack: false,
|
||||||
|
returnUrl: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
didFocusListener;
|
didFocusListener;
|
||||||
@@ -160,6 +164,8 @@ class PublishPage extends React.PureComponent {
|
|||||||
DeviceEventEmitter.removeListener('onAllGalleryThumbnailsChecked', this.handleAllGalleryThumbnailsChecked);
|
DeviceEventEmitter.removeListener('onAllGalleryThumbnailsChecked', this.handleAllGalleryThumbnailsChecked);
|
||||||
DeviceEventEmitter.removeListener('onDocumentPickerFilePicked', this.onFilePicked);
|
DeviceEventEmitter.removeListener('onDocumentPickerFilePicked', this.onFilePicked);
|
||||||
DeviceEventEmitter.removeListener('onDocumentPickerCanceled', this.onPickerCanceled);
|
DeviceEventEmitter.removeListener('onDocumentPickerCanceled', this.onPickerCanceled);
|
||||||
|
DeviceEventEmitter.removeListener('onStoragePermissionGranted', this.handleStoragePermissionGranted);
|
||||||
|
DeviceEventEmitter.removeListener('onStoragePermissionRefused', this.handleStoragePermissionRefused);
|
||||||
}
|
}
|
||||||
|
|
||||||
handleGalleryThumbnailChecked = evt => {
|
handleGalleryThumbnailChecked = evt => {
|
||||||
@@ -182,28 +188,57 @@ class PublishPage extends React.PureComponent {
|
|||||||
this.setState({ ...publishFormState, advancedMode });
|
this.setState({ ...publishFormState, advancedMode });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
checkStoragePermission = () => {
|
||||||
|
// check if we the permission to write to external storage has been granted
|
||||||
|
NativeModules.UtilityModule.canReadWriteStorage().then(canReadWrite => {
|
||||||
|
if (!canReadWrite) {
|
||||||
|
// request permission
|
||||||
|
NativeModules.UtilityModule.requestStoragePermission();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
loadVideos = () => {
|
||||||
|
this.setState(
|
||||||
|
{
|
||||||
|
loadingVideos: true,
|
||||||
|
storagePermissionRequired: false,
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
NativeModules.Gallery.getVideos().then(videos => this.setState({ videos, loadingVideos: false }));
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
onComponentFocused = () => {
|
onComponentFocused = () => {
|
||||||
const { balance, hasFormState, pushDrawerStack, setPlayerVisible, navigation } = this.props;
|
const { balance, fetchMyClaims, hasFormState, pushDrawerStack, setPlayerVisible, navigation } = this.props;
|
||||||
NativeModules.Firebase.setCurrentScreen('Publish').then(result => {
|
NativeModules.Firebase.setCurrentScreen('Publish').then(result => {
|
||||||
pushDrawerStack(Constants.DRAWER_ROUTE_PUBLISH, navigation.state.params ? navigation.state.params : null);
|
pushDrawerStack(Constants.DRAWER_ROUTE_PUBLISH, navigation.state.params ? navigation.state.params : null);
|
||||||
setPlayerVisible();
|
setPlayerVisible();
|
||||||
|
|
||||||
|
DeviceEventEmitter.addListener('onStoragePermissionGranted', this.handleStoragePermissionGranted);
|
||||||
|
DeviceEventEmitter.addListener('onStoragePermissionRefused', this.handleStoragePermissionRefused);
|
||||||
|
|
||||||
NativeModules.Gallery.canUseCamera().then(canUseCamera => this.setState({ canUseCamera }));
|
NativeModules.Gallery.canUseCamera().then(canUseCamera => this.setState({ canUseCamera }));
|
||||||
NativeModules.Gallery.getThumbnailPath().then(thumbnailPath => this.setState({ thumbnailPath }));
|
NativeModules.Gallery.getThumbnailPath().then(thumbnailPath => this.setState({ thumbnailPath }));
|
||||||
this.setState(
|
fetchMyClaims();
|
||||||
{
|
|
||||||
loadingVideos: true,
|
NativeModules.UtilityModule.canReadWriteStorage().then(canReadWrite => {
|
||||||
},
|
if (!canReadWrite) {
|
||||||
() => {
|
this.setState({ storagePermissionRequired: true }, () =>
|
||||||
NativeModules.Gallery.getVideos().then(videos => this.setState({ videos, loadingVideos: false }));
|
NativeModules.UtilityModule.requestStoragePermission(),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
// Can only load videos when the storage permission is granted
|
||||||
|
this.loadVideos();
|
||||||
}
|
}
|
||||||
);
|
});
|
||||||
|
|
||||||
// Check if this is an edit action
|
// Check if this is an edit action
|
||||||
let isEditMode = false,
|
let isEditMode = false,
|
||||||
vanityUrlSet = false;
|
vanityUrlSet = false;
|
||||||
if (navigation.state.params) {
|
if (navigation.state.params) {
|
||||||
const { displayForm, editMode, claimToEdit, vanityUrl } = navigation.state.params;
|
const { displayForm, editMode, claimToEdit, vanityUrl, returnUrl } = navigation.state.params;
|
||||||
if (editMode) {
|
if (editMode) {
|
||||||
this.prepareEdit(claimToEdit);
|
this.prepareEdit(claimToEdit);
|
||||||
isEditMode = true;
|
isEditMode = true;
|
||||||
@@ -217,6 +252,7 @@ class PublishPage extends React.PureComponent {
|
|||||||
vanityUrl: claimName,
|
vanityUrl: claimName,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
this.setState({ returnUrl });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isEditMode && hasFormState) {
|
if (!isEditMode && hasFormState) {
|
||||||
@@ -288,7 +324,7 @@ class PublishPage extends React.PureComponent {
|
|||||||
this.handleChannelChange(channelName);
|
this.handleChannelChange(channelName);
|
||||||
}
|
}
|
||||||
pushDrawerStack(Constants.DRAWER_ROUTE_PUBLISH_FORM);
|
pushDrawerStack(Constants.DRAWER_ROUTE_PUBLISH_FORM);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -324,7 +360,7 @@ class PublishPage extends React.PureComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
handlePublishPressed = () => {
|
handlePublishPressed = () => {
|
||||||
const { balance, notify, publish, updatePublishForm } = this.props;
|
const { balance, myClaims, notify, publish, updatePublishForm } = this.props;
|
||||||
const {
|
const {
|
||||||
editMode,
|
editMode,
|
||||||
bid,
|
bid,
|
||||||
@@ -356,18 +392,34 @@ class PublishPage extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!title || title.trim().length === 0) {
|
if (!title || title.trim().length === 0) {
|
||||||
notify({ message: __('Please provide a title') });
|
notify({ message: __('Please provide a title'), isError: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!name) {
|
if (!name) {
|
||||||
notify({ message: __('Please specify an address where people can find your content.') });
|
notify({ message: __('Please specify an address where people can find your content.'), isError: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isNameValid(name, false)) {
|
||||||
|
notify({ message: __('Your content address contains invalid characters.'), isError: true });
|
||||||
|
return;
|
||||||
|
} else if (!editMode && myClaims && myClaims.length > 0) {
|
||||||
|
if (myClaims.some(claim => claim.name.toLowerCase() === name.trim().toLowerCase())) {
|
||||||
|
notify({
|
||||||
|
message: __('You have already published to the specified content address. Please enter a new address.'),
|
||||||
|
isError: true,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!currentMedia && !editMode) {
|
if (!currentMedia && !editMode) {
|
||||||
// sanity check. normally shouldn't happen
|
// sanity check. normally shouldn't happen
|
||||||
notify({ message: __('No file selected. Please select a video or take a photo before publishing.') });
|
notify({
|
||||||
|
message: __('No file selected. Please select a video or take a photo before publishing.'),
|
||||||
|
isError: true,
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -423,7 +475,15 @@ class PublishPage extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
const { currentRoute: prevRoute, drawerStack: prevDrawerStack, notify, updatePublishFormState } = this.props;
|
const {
|
||||||
|
currentRoute: prevRoute,
|
||||||
|
drawerStack: prevDrawerStack,
|
||||||
|
popDrawerStack,
|
||||||
|
setPlayerVisible,
|
||||||
|
navigation,
|
||||||
|
notify,
|
||||||
|
updatePublishFormState,
|
||||||
|
} = this.props;
|
||||||
const { currentRoute, drawerStack, publishFormValues } = nextProps;
|
const { currentRoute, drawerStack, publishFormValues } = nextProps;
|
||||||
|
|
||||||
if (Constants.DRAWER_ROUTE_PUBLISH === currentRoute && currentRoute !== prevRoute) {
|
if (Constants.DRAWER_ROUTE_PUBLISH === currentRoute && currentRoute !== prevRoute) {
|
||||||
@@ -437,6 +497,11 @@ class PublishPage extends React.PureComponent {
|
|||||||
) {
|
) {
|
||||||
// navigated back from the form
|
// navigated back from the form
|
||||||
this.showSelector();
|
this.showSelector();
|
||||||
|
if (!this.state.hasReturnedBack && this.state.returnUrl) {
|
||||||
|
this.setState({ hasReturnedBack: true }, () => {
|
||||||
|
navigateBack(navigation, drawerStack, popDrawerStack, setPlayerVisible);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -456,7 +521,7 @@ class PublishPage extends React.PureComponent {
|
|||||||
() => {
|
() => {
|
||||||
this.handleNameChange(this.state.name);
|
this.handleNameChange(this.state.name);
|
||||||
pushDrawerStack(Constants.DRAWER_ROUTE_PUBLISH_FORM);
|
pushDrawerStack(Constants.DRAWER_ROUTE_PUBLISH_FORM);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -510,7 +575,7 @@ class PublishPage extends React.PureComponent {
|
|||||||
clearPublishFormState();
|
clearPublishFormState();
|
||||||
// reset thumbnail
|
// reset thumbnail
|
||||||
updatePublishForm({ thumbnail: null });
|
updatePublishForm({ thumbnail: null });
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -537,7 +602,7 @@ class PublishPage extends React.PureComponent {
|
|||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
NativeModules.UtilityModule.openDocumentPicker('*/*');
|
NativeModules.UtilityModule.openDocumentPicker('*/*');
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -583,12 +648,12 @@ class PublishPage extends React.PureComponent {
|
|||||||
() => {
|
() => {
|
||||||
// upload a new thumbnail
|
// upload a new thumbnail
|
||||||
uploadImageAsset(fileUrl, this.handleThumbnailUploadSuccess, this.handleThumbnailUploadFailure);
|
uploadImageAsset(fileUrl, this.handleThumbnailUploadSuccess, this.handleThumbnailUploadFailure);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// could not determine the file path
|
// could not determine the file path
|
||||||
notify({ message: __('The path could not be determined. Please try a different file.') });
|
notify({ message: __('The path could not be determined. Please try a different file.'), isError: true });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -634,7 +699,7 @@ class PublishPage extends React.PureComponent {
|
|||||||
videoRecordingMode: false,
|
videoRecordingMode: false,
|
||||||
recordingVideo: false,
|
recordingVideo: false,
|
||||||
},
|
},
|
||||||
() => pushDrawerStack(Constants.DRAWER_ROUTE_PUBLISH_FORM)
|
() => pushDrawerStack(Constants.DRAWER_ROUTE_PUBLISH_FORM),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -658,7 +723,7 @@ class PublishPage extends React.PureComponent {
|
|||||||
showCameraOverlay: false,
|
showCameraOverlay: false,
|
||||||
videoRecordingMode: false,
|
videoRecordingMode: false,
|
||||||
},
|
},
|
||||||
() => pushDrawerStack(Constants.DRAWER_ROUTE_PUBLISH)
|
() => pushDrawerStack(Constants.DRAWER_ROUTE_PUBLISH),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -777,8 +842,8 @@ class PublishPage extends React.PureComponent {
|
|||||||
uploadImageAsset(
|
uploadImageAsset(
|
||||||
this.getFilePathFromUri(uri),
|
this.getFilePathFromUri(uri),
|
||||||
this.handleThumbnailUploadSuccess,
|
this.handleThumbnailUploadSuccess,
|
||||||
this.handleThumbnailUploadFailure
|
this.handleThumbnailUploadFailure,
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else if (mediaType === 'image' || mediaType === 'video') {
|
} else if (mediaType === 'image' || mediaType === 'video') {
|
||||||
@@ -791,7 +856,7 @@ class PublishPage extends React.PureComponent {
|
|||||||
this.setState({ currentThumbnailUri: `file://${path}`, updatingThumbnailUri: false });
|
this.setState({ currentThumbnailUri: `file://${path}`, updatingThumbnailUri: false });
|
||||||
if (!this.state.uploadedThumbnailUri) {
|
if (!this.state.uploadedThumbnailUri) {
|
||||||
this.setState({ uploadThumbnailStarted: true }, () =>
|
this.setState({ uploadThumbnailStarted: true }, () =>
|
||||||
uploadImageAsset(path, this.handleThumbnailUploadSuccess, this.handleThumbnailUploadFailure)
|
uploadImageAsset(path, this.handleThumbnailUploadSuccess, this.handleThumbnailUploadFailure),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -817,7 +882,7 @@ class PublishPage extends React.PureComponent {
|
|||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
this.handleNameChange(this.state.name);
|
this.handleNameChange(this.state.name);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -881,10 +946,33 @@ class PublishPage extends React.PureComponent {
|
|||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
NativeModules.UtilityModule.openDocumentPicker('image/*');
|
NativeModules.UtilityModule.openDocumentPicker('image/*');
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
handleStoragePermissionGranted = () => {
|
||||||
|
// update the configured download folder
|
||||||
|
this.loadVideos();
|
||||||
|
NativeModules.UtilityModule.getDownloadDirectory().then(downloadDirectory => {
|
||||||
|
Lbry.settings_set({
|
||||||
|
key: 'download_dir',
|
||||||
|
value: downloadDirectory,
|
||||||
|
})
|
||||||
|
.then(() => {})
|
||||||
|
.catch(() => {});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
handleStoragePermissionRefused = () => {
|
||||||
|
const { notify } = this.props;
|
||||||
|
notify({
|
||||||
|
message: __(
|
||||||
|
'Content from your device cannot be published because the permission to read storage was not granted.',
|
||||||
|
),
|
||||||
|
isError: true,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { balance, navigation, notify, publishFormValues } = this.props;
|
const { balance, navigation, notify, publishFormValues } = this.props;
|
||||||
const {
|
const {
|
||||||
@@ -894,6 +982,7 @@ class PublishPage extends React.PureComponent {
|
|||||||
currentPhase,
|
currentPhase,
|
||||||
checkedThumbnails,
|
checkedThumbnails,
|
||||||
loadingVideos,
|
loadingVideos,
|
||||||
|
storagePermissionRequired,
|
||||||
thumbnailPath,
|
thumbnailPath,
|
||||||
videos,
|
videos,
|
||||||
} = this.state;
|
} = this.state;
|
||||||
@@ -935,13 +1024,20 @@ class PublishPage extends React.PureComponent {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
{(loadingVideos || !allThumbnailsChecked) && (
|
{storagePermissionRequired && (
|
||||||
|
<View style={publishStyle.relativeCentered}>
|
||||||
|
<Text style={publishStyle.noVideos}>
|
||||||
|
{__('The storage permission is required to be able to display and publish your videos.')}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
{!storagePermissionRequired && (loadingVideos || !allThumbnailsChecked) && (
|
||||||
<View style={publishStyle.loadingView}>
|
<View style={publishStyle.loadingView}>
|
||||||
<ActivityIndicator size="small" color={Colors.NextLbryGreen} />
|
<ActivityIndicator size="small" color={Colors.NextLbryGreen} />
|
||||||
<Text style={publishStyle.loadingText}>{__('Please wait while we load your videos...')}</Text>
|
<Text style={publishStyle.loadingText}>{__('Please wait while we load your videos...')}</Text>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
{!loadingVideos && (!videos || videos.length === 0) && (
|
{!storagePermissionRequired && !loadingVideos && (!videos || videos.length === 0) && (
|
||||||
<View style={publishStyle.relativeCentered}>
|
<View style={publishStyle.relativeCentered}>
|
||||||
<Text style={publishStyle.noVideos}>
|
<Text style={publishStyle.noVideos}>
|
||||||
{__('We could not find any videos on your device. Take a photo or record a video to get started.')}
|
{__('We could not find any videos on your device. Take a photo or record a video to get started.')}
|
||||||
@@ -1112,7 +1208,7 @@ class PublishPage extends React.PureComponent {
|
|||||||
{__('The address where people can find your content (ex. lbry://myvideo). ')}
|
{__('The address where people can find your content (ex. lbry://myvideo). ')}
|
||||||
{this.state.editMode &&
|
{this.state.editMode &&
|
||||||
__(
|
__(
|
||||||
'You cannot change this address while editing your content. If you wish to use a new address, please republish the content.'
|
'You cannot change this address while editing your content. If you wish to use a new address, please republish the content.',
|
||||||
)}
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
@@ -1262,7 +1358,7 @@ class PublishPage extends React.PureComponent {
|
|||||||
</View>
|
</View>
|
||||||
<Text style={publishStyle.successText}>
|
<Text style={publishStyle.successText}>
|
||||||
{__(
|
{__(
|
||||||
'Your content will be live in a few minutes. In the mean time, feel free to publish more content or explore the app.'
|
'Your content will be live in a few minutes. In the mean time, feel free to publish more content or explore the app.',
|
||||||
)}
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -11,6 +11,10 @@ import RewardEnrolment from 'component/rewardEnrolment';
|
|||||||
import UriBar from 'component/uriBar';
|
import UriBar from 'component/uriBar';
|
||||||
import rewardStyle from 'styles/reward';
|
import rewardStyle from 'styles/reward';
|
||||||
|
|
||||||
|
const FILTER_ALL = 'all';
|
||||||
|
const FILTER_AVAILABLE = 'available';
|
||||||
|
const FILTER_CLAIMED = 'claimed';
|
||||||
|
|
||||||
class RewardsPage extends React.PureComponent {
|
class RewardsPage extends React.PureComponent {
|
||||||
state = {
|
state = {
|
||||||
isEmailVerified: false,
|
isEmailVerified: false,
|
||||||
@@ -19,6 +23,7 @@ class RewardsPage extends React.PureComponent {
|
|||||||
verifyRequestStarted: false,
|
verifyRequestStarted: false,
|
||||||
revealVerification: true,
|
revealVerification: true,
|
||||||
firstRewardClaimed: false,
|
firstRewardClaimed: false,
|
||||||
|
currentFilter: FILTER_AVAILABLE,
|
||||||
};
|
};
|
||||||
|
|
||||||
scrollView = null;
|
scrollView = null;
|
||||||
@@ -182,8 +187,13 @@ class RewardsPage extends React.PureComponent {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
setFilter = filter => {
|
||||||
|
this.setState({ currentFilter: filter });
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { user, navigation } = this.props;
|
const { user, navigation } = this.props;
|
||||||
|
const { currentFilter } = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={rewardStyle.container}>
|
<View style={rewardStyle.container}>
|
||||||
@@ -197,8 +207,29 @@ class RewardsPage extends React.PureComponent {
|
|||||||
style={rewardStyle.scrollContainer}
|
style={rewardStyle.scrollContainer}
|
||||||
contentContainerStyle={rewardStyle.scrollContentContainer}
|
contentContainerStyle={rewardStyle.scrollContentContainer}
|
||||||
>
|
>
|
||||||
{this.renderUnclaimedRewards()}
|
<View style={rewardStyle.filterHeader}>
|
||||||
{this.renderClaimedRewards()}
|
<Link
|
||||||
|
style={[rewardStyle.filterLink, currentFilter === FILTER_ALL ? rewardStyle.activeFilterLink : null]}
|
||||||
|
text={__('All')}
|
||||||
|
onPress={() => this.setFilter(FILTER_ALL)}
|
||||||
|
/>
|
||||||
|
<Link
|
||||||
|
style={[
|
||||||
|
rewardStyle.filterLink,
|
||||||
|
currentFilter === FILTER_AVAILABLE ? rewardStyle.activeFilterLink : null,
|
||||||
|
]}
|
||||||
|
text={__('Available')}
|
||||||
|
onPress={() => this.setFilter(FILTER_AVAILABLE)}
|
||||||
|
/>
|
||||||
|
<Link
|
||||||
|
style={[rewardStyle.filterLink, currentFilter === FILTER_CLAIMED ? rewardStyle.activeFilterLink : null]}
|
||||||
|
text={__('Claimed')}
|
||||||
|
onPress={() => this.setFilter(FILTER_CLAIMED)}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{(currentFilter === FILTER_AVAILABLE || currentFilter === FILTER_ALL) && this.renderUnclaimedRewards()}
|
||||||
|
{(currentFilter === FILTER_CLAIMED || currentFilter === FILTER_ALL) && this.renderClaimedRewards()}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -2,8 +2,10 @@ import { connect } from 'react-redux';
|
|||||||
import {
|
import {
|
||||||
doClaimSearch,
|
doClaimSearch,
|
||||||
doResolveUris,
|
doResolveUris,
|
||||||
doSearch,
|
doResolvedSearch,
|
||||||
doUpdateSearchQuery,
|
doUpdateSearchQuery,
|
||||||
|
makeSelectResolvedSearchResults,
|
||||||
|
makeSelectResolvedSearchResultsLastPageReached,
|
||||||
makeSelectSearchUris,
|
makeSelectSearchUris,
|
||||||
selectClaimSearchByQuery,
|
selectClaimSearchByQuery,
|
||||||
selectIsSearching,
|
selectIsSearching,
|
||||||
@@ -13,25 +15,33 @@ import {
|
|||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||||
import { selectCurrentRoute } from 'redux/selectors/drawer';
|
import { selectCurrentRoute } from 'redux/selectors/drawer';
|
||||||
|
import { selectShowNsfw } from 'redux/selectors/settings';
|
||||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import SearchPage from './view';
|
import SearchPage from './view';
|
||||||
|
|
||||||
const numSearchResults = 25;
|
|
||||||
|
|
||||||
const select = state => ({
|
const select = state => ({
|
||||||
claimSearchByQuery: selectClaimSearchByQuery(state),
|
claimSearchByQuery: selectClaimSearchByQuery(state),
|
||||||
currentRoute: selectCurrentRoute(state),
|
currentRoute: selectCurrentRoute(state),
|
||||||
isSearching: selectIsSearching(state),
|
isSearching: selectIsSearching(state),
|
||||||
query: selectSearchValue(state),
|
query: selectSearchValue(state),
|
||||||
resolvingUris: selectResolvingUris(state),
|
resolvingUris: selectResolvingUris(state),
|
||||||
uris: makeSelectSearchUris(makeSelectQueryWithOptions(null, numSearchResults)(state))(state),
|
showNsfwContent: selectShowNsfw(state),
|
||||||
|
uris: makeSelectSearchUris(
|
||||||
|
makeSelectQueryWithOptions(null, { size: Constants.DEFAULT_PAGE_SIZE, isBackgroundSearch: false })(state),
|
||||||
|
)(state),
|
||||||
|
results: makeSelectResolvedSearchResults(
|
||||||
|
makeSelectQueryWithOptions(null, { size: Constants.DEFAULT_PAGE_SIZE, isBackgroundSearch: false })(state),
|
||||||
|
)(state),
|
||||||
|
lastPageReached: makeSelectResolvedSearchResultsLastPageReached(
|
||||||
|
makeSelectQueryWithOptions(null, { size: Constants.DEFAULT_PAGE_SIZE, isBackgroundSearch: false })(state),
|
||||||
|
)(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
search: query => dispatch(doSearch(query, numSearchResults, null, false, false)),
|
search: (query, from, nsfw) => dispatch(doResolvedSearch(query, Constants.DEFAULT_PAGE_SIZE, from, false, {}, nsfw)),
|
||||||
claimSearch: options => dispatch(doClaimSearch(options)),
|
claimSearch: options => dispatch(doClaimSearch(options)),
|
||||||
updateSearchQuery: query => dispatch(doUpdateSearchQuery(query)),
|
updateSearchQuery: query => dispatch(doUpdateSearchQuery(query)),
|
||||||
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_SEARCH)),
|
pushDrawerStack: (routeName, params) => dispatch(doPushDrawerStack(routeName, params)),
|
||||||
resolveUris: uris => dispatch(doResolveUris(uris)),
|
resolveUris: uris => dispatch(doResolveUris(uris)),
|
||||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||||
});
|
});
|
||||||
|
|||||||
+80
-49
@@ -15,18 +15,23 @@ import Colors from 'styles/colors';
|
|||||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import PageHeader from 'component/pageHeader';
|
import PageHeader from 'component/pageHeader';
|
||||||
import FileListItem from 'component/fileListItem';
|
import FileListItem from 'component/fileListItem';
|
||||||
|
import ClaimResultItem from 'component/claimResultItem';
|
||||||
import FloatingWalletBalance from 'component/floatingWalletBalance';
|
import FloatingWalletBalance from 'component/floatingWalletBalance';
|
||||||
import UriBar from 'component/uriBar';
|
import UriBar from 'component/uriBar';
|
||||||
import searchStyle from 'styles/search';
|
import searchStyle from 'styles/search';
|
||||||
|
|
||||||
|
const softLimit = 500;
|
||||||
|
|
||||||
class SearchPage extends React.PureComponent {
|
class SearchPage extends React.PureComponent {
|
||||||
state = {
|
state = {
|
||||||
currentQuery: null,
|
currentQuery: null,
|
||||||
|
currentFrom: 0,
|
||||||
currentUri: null,
|
currentUri: null,
|
||||||
showTagResult: false,
|
showTagResult: false,
|
||||||
claimSearchRun: false,
|
claimSearchRun: false,
|
||||||
claimSearchOptions: null,
|
claimSearchOptions: null,
|
||||||
resultsResolved: false,
|
resultsResolved: false,
|
||||||
|
tagResultDisplayed: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
static navigationOptions = {
|
static navigationOptions = {
|
||||||
@@ -47,21 +52,23 @@ class SearchPage extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onComponentFocused = () => {
|
onComponentFocused = () => {
|
||||||
const { pushDrawerStack, setPlayerVisible, query, search } = this.props;
|
const { pushDrawerStack, setPlayerVisible, navigation, query, search, showNsfwContent } = this.props;
|
||||||
pushDrawerStack();
|
|
||||||
setPlayerVisible();
|
setPlayerVisible();
|
||||||
|
pushDrawerStack(Constants.DRAWER_ROUTE_SEARCH, navigation.state.params ? navigation.state.params : null);
|
||||||
NativeModules.Firebase.setCurrentScreen('Search').then(result => {
|
NativeModules.Firebase.setCurrentScreen('Search').then(result => {
|
||||||
const searchQuery = query || this.getSearchQuery();
|
const searchQuery = query || this.getSearchQuery();
|
||||||
if (searchQuery && searchQuery.trim().length > 0) {
|
if (searchQuery && searchQuery.trim().length > 0) {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
currentFrom: 0,
|
||||||
currentQuery: searchQuery,
|
currentQuery: searchQuery,
|
||||||
currentUri: isURIValid(searchQuery) ? normalizeURI(searchQuery) : null,
|
currentUri: isURIValid(searchQuery) ? normalizeURI(searchQuery) : null,
|
||||||
claimSearchOptions: null,
|
claimSearchOptions: null,
|
||||||
claimSearchRun: false,
|
claimSearchRun: false,
|
||||||
showTagResult: false,
|
showTagResult: false,
|
||||||
resultsResolved: false,
|
resultsResolved: false,
|
||||||
|
tagResultDisplayed: false,
|
||||||
});
|
});
|
||||||
search(searchQuery);
|
search(searchQuery, 0, showNsfwContent);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -71,8 +78,8 @@ class SearchPage extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
const { currentRoute, query } = nextProps;
|
const { currentRoute, query, isSearching } = nextProps;
|
||||||
const { currentRoute: prevRoute, search } = this.props;
|
const { currentRoute: prevRoute, search, isSearching: prevIsSearching, showNsfwContent } = this.props;
|
||||||
|
|
||||||
if (Constants.DRAWER_ROUTE_SEARCH === currentRoute && currentRoute !== prevRoute) {
|
if (Constants.DRAWER_ROUTE_SEARCH === currentRoute && currentRoute !== prevRoute) {
|
||||||
this.onComponentFocused();
|
this.onComponentFocused();
|
||||||
@@ -80,16 +87,18 @@ class SearchPage extends React.PureComponent {
|
|||||||
|
|
||||||
if (query && query.trim().length > 0 && query !== this.state.currentQuery) {
|
if (query && query.trim().length > 0 && query !== this.state.currentQuery) {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
currentFrom: 0,
|
||||||
currentQuery: query,
|
currentQuery: query,
|
||||||
currentUri: isURIValid(query) ? normalizeURI(query) : null,
|
currentUri: isURIValid(query) ? normalizeURI(query) : null,
|
||||||
resultsResolved: false,
|
resultsResolved: false,
|
||||||
|
tagResultDisplayed: false,
|
||||||
});
|
});
|
||||||
search(query);
|
search(query, 0, showNsfwContent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
allContentResolved() {
|
allContentResolved(props) {
|
||||||
const { uris, resolvingUris } = this.props;
|
const { uris, resolvingUris } = props;
|
||||||
if (!this.state.resultsResolved) {
|
if (!this.state.resultsResolved) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -104,19 +113,17 @@ class SearchPage extends React.PureComponent {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldComponentUpdate() {
|
/* shouldComponentUpdate(nextProps) {
|
||||||
const { isSearching, uris } = this.props;
|
const { isSearching, uris } = this.props;
|
||||||
return (isSearching && (!uris || uris.length === 0)) || (!isSearching && this.allContentResolved());
|
return (isSearching && (!uris || uris.length === 0)) || (!isSearching && this.allContentResolved(this.props));
|
||||||
}
|
} */
|
||||||
|
|
||||||
componentDidUpdate() {
|
componentDidUpdate() {
|
||||||
const { isSearching, resolveUris, uris } = this.props;
|
const { claimSearchByQuery } = this.props;
|
||||||
if (!isSearching && !this.state.resultsResolved) {
|
if (this.state.claimSearchRun && this.state.claimSearchOptions && !this.state.tagResultDisplayed) {
|
||||||
this.setState({ resultsResolved: true }, () => {
|
const claimSearchKey = createNormalizedClaimSearchKey(this.state.claimSearchOptions);
|
||||||
if (uris && uris.length > 0) {
|
const claimSearchUris = claimSearchByQuery[claimSearchKey];
|
||||||
resolveUris(uris);
|
this.setState({ showTagResult: claimSearchUris && claimSearchUris.length > 0, tagResultDisplayed: true });
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,14 +136,18 @@ class SearchPage extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleSearchSubmitted = keywords => {
|
handleSearchSubmitted = keywords => {
|
||||||
const { search } = this.props;
|
const { search, showNsfwContent } = this.props;
|
||||||
this.setState({
|
this.setState({
|
||||||
currentUri: isURIValid(keywords) ? normalizeURI(keywords) : null,
|
currentUri: isURIValid(keywords) ? normalizeURI(keywords) : null,
|
||||||
|
currentFrom: 0,
|
||||||
|
currentQuery: keywords,
|
||||||
claimSearchOptions: null,
|
claimSearchOptions: null,
|
||||||
claimSearchRun: false,
|
claimSearchRun: false,
|
||||||
showTagResult: false,
|
showTagResult: false,
|
||||||
|
resultsResolved: false,
|
||||||
|
tagResultDisplayed: false,
|
||||||
});
|
});
|
||||||
search(keywords);
|
search(keywords, 0, showNsfwContent);
|
||||||
};
|
};
|
||||||
|
|
||||||
listEmptyComponent = () => {
|
listEmptyComponent = () => {
|
||||||
@@ -150,27 +161,20 @@ class SearchPage extends React.PureComponent {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
listHeaderComponent = showTagResult => {
|
listHeaderComponent = (showTagResult, query) => {
|
||||||
const { navigation, claimSearch, claimSearchByQuery } = this.props;
|
const { navigation, claimSearch } = this.props;
|
||||||
const { currentUri } = this.state;
|
const { currentUri } = this.state;
|
||||||
const query = this.getSearchQuery();
|
|
||||||
|
|
||||||
const canBeTag = query && query.trim().length > 0 && isURIValid(query);
|
const canBeTag = query && query.trim().length > 0 && isURIValid(query);
|
||||||
if (canBeTag && !this.state.claimSearchRun) {
|
if (canBeTag && !this.state.claimSearchRun) {
|
||||||
const options = {
|
const options = {
|
||||||
any_tags: [query],
|
any_tags: [query.toLowerCase()],
|
||||||
page: 1,
|
page: 1,
|
||||||
no_totals: true,
|
no_totals: true,
|
||||||
};
|
};
|
||||||
this.setState({ claimSearchOptions: options, claimSearchRun: true }, () => claimSearch(options));
|
this.setState({ claimSearchOptions: options, claimSearchRun: true }, () => claimSearch(options));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if (this.state.claimSearchRun && this.state.claimSearchOptions) {
|
|
||||||
const claimSearchKey = createNormalizedClaimSearchKey(this.state.claimSearchOptions);
|
|
||||||
const claimSearchUris = claimSearchByQuery[claimSearchKey];
|
|
||||||
this.setState({ showTagResult: claimSearchUris && claimSearchUris.length > 0 });
|
|
||||||
} */
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
<FileListItem uri={currentUri} featuredResult style={searchStyle.featuredResultItem} navigation={navigation} />
|
<FileListItem uri={currentUri} featuredResult style={searchStyle.featuredResultItem} navigation={navigation} />
|
||||||
@@ -189,36 +193,63 @@ class SearchPage extends React.PureComponent {
|
|||||||
navigation.navigate({ routeName: Constants.DRAWER_ROUTE_TAG, key: `tagPage`, params: { tag: tag.toLowerCase() } });
|
navigation.navigate({ routeName: Constants.DRAWER_ROUTE_TAG, key: `tagPage`, params: { tag: tag.toLowerCase() } });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
handleVerticalEndReached = () => {
|
||||||
|
// fetch more results
|
||||||
|
const { lastPageReached, results, search, showNsfwContent, isSearching } = this.props;
|
||||||
|
if (lastPageReached || (results && results.length > softLimit)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isSearching) {
|
||||||
|
const from = results ? results.length : 0;
|
||||||
|
this.setState({ currentFrom: from }, () => {
|
||||||
|
search(this.state.currentQuery, from, showNsfwContent);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { isSearching, navigation, query, uris } = this.props;
|
const { isSearching, navigation, query, results } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={searchStyle.container}>
|
<View style={searchStyle.container}>
|
||||||
<UriBar value={query} navigation={navigation} onSearchSubmitted={this.handleSearchSubmitted} />
|
<UriBar value={query} navigation={navigation} onSearchSubmitted={this.handleSearchSubmitted} />
|
||||||
|
|
||||||
{isSearching && (
|
{isSearching && this.state.currentFrom === 0 && (
|
||||||
<View style={searchStyle.busyContainer}>
|
<View style={searchStyle.busyContainer}>
|
||||||
<ActivityIndicator size="large" color={Colors.NextLbryGreen} style={searchStyle.loading} />
|
<ActivityIndicator size="large" color={Colors.NextLbryGreen} style={searchStyle.loading} />
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{!isSearching && (
|
<FlatList
|
||||||
<FlatList
|
extraData={this.state}
|
||||||
extraData={this.state}
|
style={searchStyle.scrollContainer}
|
||||||
style={searchStyle.scrollContainer}
|
contentContainerStyle={searchStyle.scrollPadding}
|
||||||
contentContainerStyle={searchStyle.scrollPadding}
|
keyboardShouldPersistTaps={'handled'}
|
||||||
keyboardShouldPersistTaps={'handled'}
|
data={results}
|
||||||
data={uris}
|
keyExtractor={(item, index) => item.claimId}
|
||||||
keyExtractor={(item, index) => item}
|
initialNumToRender={10}
|
||||||
initialNumToRender={8}
|
maxToRenderPerBatch={20}
|
||||||
maxToRenderPerBatch={20}
|
onEndReached={this.handleVerticalEndReached}
|
||||||
removeClippedSubviews
|
onEndReachedThreshold={0.2}
|
||||||
ListEmptyComponent={!isSearching ? this.listEmptyComponent() : null}
|
removeClippedSubviews
|
||||||
ListHeaderComponent={this.state.currentUri ? this.listHeaderComponent(this.state.showTagResult) : null}
|
ListEmptyComponent={!isSearching ? this.listEmptyComponent() : null}
|
||||||
renderItem={({ item }) => (
|
ListHeaderComponent={this.listHeaderComponent(this.state.showTagResult, this.state.currentQuery)}
|
||||||
<FileListItem key={item} uri={item} style={searchStyle.resultItem} batchResolve navigation={navigation} />
|
renderItem={({ item }) => (
|
||||||
)}
|
<ClaimResultItem
|
||||||
/>
|
key={item.claimId}
|
||||||
|
uri={item ? normalizeURI(`${item.name}#${item.claimId}`) : null}
|
||||||
|
result={item}
|
||||||
|
style={searchStyle.resultItem}
|
||||||
|
navigation={navigation}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{this.state.currentFrom > 0 && isSearching && (
|
||||||
|
<View style={searchStyle.moreLoading}>
|
||||||
|
<ActivityIndicator size="small" color={Colors.NextLbryGreen} />
|
||||||
|
</View>
|
||||||
)}
|
)}
|
||||||
<FloatingWalletBalance navigation={navigation} />
|
<FloatingWalletBalance navigation={navigation} />
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ const select = state => ({
|
|||||||
backgroundPlayEnabled: makeSelectClientSetting(SETTINGS.BACKGROUND_PLAY_ENABLED)(state),
|
backgroundPlayEnabled: makeSelectClientSetting(SETTINGS.BACKGROUND_PLAY_ENABLED)(state),
|
||||||
currentRoute: selectCurrentRoute(state),
|
currentRoute: selectCurrentRoute(state),
|
||||||
drawerStack: selectDrawerStack(state),
|
drawerStack: selectDrawerStack(state),
|
||||||
|
enableDht: makeSelectClientSetting(Constants.SETTING_DHT_ENABLED)(state),
|
||||||
keepDaemonRunning: makeSelectClientSetting(SETTINGS.KEEP_DAEMON_RUNNING)(state),
|
keepDaemonRunning: makeSelectClientSetting(SETTINGS.KEEP_DAEMON_RUNNING)(state),
|
||||||
language: makeSelectClientSetting(SETTINGS.LANGUAGE)(state),
|
language: makeSelectClientSetting(SETTINGS.LANGUAGE)(state),
|
||||||
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_NSFW)(state),
|
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_NSFW)(state),
|
||||||
@@ -29,7 +30,4 @@ const perform = dispatch => ({
|
|||||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(select, perform)(SettingsPage);
|
||||||
select,
|
|
||||||
perform
|
|
||||||
)(SettingsPage);
|
|
||||||
@@ -11,16 +11,27 @@ import settingsStyle from 'styles/settings';
|
|||||||
|
|
||||||
const languageOptions = [
|
const languageOptions = [
|
||||||
{ code: 'default', name: 'Use device language' },
|
{ code: 'default', name: 'Use device language' },
|
||||||
|
{ code: 'jv', name: 'Basa Jawa' },
|
||||||
|
{ code: 'da', name: 'Danish' },
|
||||||
|
{ code: 'nl', name: 'Dutch' },
|
||||||
{ code: 'en', name: 'English' },
|
{ code: 'en', name: 'English' },
|
||||||
|
{ code: 'et', name: 'Estonian' },
|
||||||
|
{ code: 'fr', name: 'French' },
|
||||||
{ code: 'gu', name: 'Gujarati' },
|
{ code: 'gu', name: 'Gujarati' },
|
||||||
{ code: 'hi', name: 'Hindi' },
|
{ code: 'hi', name: 'Hindi' },
|
||||||
{ code: 'id', name: 'Indonesian' },
|
{ code: 'id', name: 'Indonesian' },
|
||||||
{ code: 'it', name: 'Italian' },
|
{ code: 'it', name: 'Italian' },
|
||||||
|
{ code: 'kn', name: 'Kannada' },
|
||||||
{ code: 'ms', name: 'Malay' },
|
{ code: 'ms', name: 'Malay' },
|
||||||
{ code: 'tr', name: 'Turkish' },
|
{ code: 'mr', name: 'Marathi' },
|
||||||
{ code: 'pl', name: 'Polish' },
|
{ code: 'pl', name: 'Polish' },
|
||||||
{ code: 'pt', name: 'Portuguese' },
|
{ code: 'pt', name: 'Portuguese' },
|
||||||
|
{ code: 'ro', name: 'Romanian' },
|
||||||
|
{ code: 'ru', name: 'Russian' },
|
||||||
|
{ code: 'sk', name: 'Slovak' },
|
||||||
{ code: 'es', name: 'Spanish' },
|
{ code: 'es', name: 'Spanish' },
|
||||||
|
{ code: 'tr', name: 'Turkish' },
|
||||||
|
{ code: 'uk', name: 'Ukrainian' },
|
||||||
];
|
];
|
||||||
|
|
||||||
class SettingsPage extends React.PureComponent {
|
class SettingsPage extends React.PureComponent {
|
||||||
@@ -140,6 +151,7 @@ class SettingsPage extends React.PureComponent {
|
|||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
backgroundPlayEnabled,
|
backgroundPlayEnabled,
|
||||||
|
enableDht,
|
||||||
keepDaemonRunning,
|
keepDaemonRunning,
|
||||||
receiveSubscriptionNotifications,
|
receiveSubscriptionNotifications,
|
||||||
receiveRewardNotifications,
|
receiveRewardNotifications,
|
||||||
@@ -157,6 +169,7 @@ class SettingsPage extends React.PureComponent {
|
|||||||
const actualReceiveRewardNotifications = this.getBooleanSetting(receiveRewardNotifications, true);
|
const actualReceiveRewardNotifications = this.getBooleanSetting(receiveRewardNotifications, true);
|
||||||
const actualReceiveInterestsNotifications = this.getBooleanSetting(receiveInterestsNotifications, true);
|
const actualReceiveInterestsNotifications = this.getBooleanSetting(receiveInterestsNotifications, true);
|
||||||
const actualReceiveCreatorNotifications = this.getBooleanSetting(receiveCreatorNotifications, true);
|
const actualReceiveCreatorNotifications = this.getBooleanSetting(receiveCreatorNotifications, true);
|
||||||
|
const actualEnableDht = this.getBooleanSetting(enableDht, false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={settingsStyle.container}>
|
<View style={settingsStyle.container}>
|
||||||
@@ -294,7 +307,7 @@ class SettingsPage extends React.PureComponent {
|
|||||||
</Text>
|
</Text>
|
||||||
<Text style={settingsStyle.description}>
|
<Text style={settingsStyle.description}>
|
||||||
{__(
|
{__(
|
||||||
'Enable this option for quicker app launch and to keep the synchronisation with the blockchain up to date.'
|
'Enable this option for quicker app launch and to keep the synchronisation with the blockchain up to date.',
|
||||||
)}
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
@@ -310,6 +323,23 @@ class SettingsPage extends React.PureComponent {
|
|||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
<View style={settingsStyle.row}>
|
||||||
|
<View style={settingsStyle.switchText}>
|
||||||
|
<Text style={settingsStyle.label}>{__('Participate in the data network')}</Text>
|
||||||
|
<Text style={settingsStyle.description}>
|
||||||
|
{__('Enable DHT (this will take effect upon app and background service restart)')}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View style={settingsStyle.switchContainer}>
|
||||||
|
<Switch
|
||||||
|
value={actualEnableDht}
|
||||||
|
onValueChange={value => {
|
||||||
|
this.setNativeBooleanSetting(Constants.SETTING_DHT_ENABLED, value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,32 +2,38 @@ import { connect } from 'react-redux';
|
|||||||
import { SETTINGS, doBalanceSubscribe, doUpdateBlockHeight, doPopulateSharedUserState, doToast } from 'lbry-redux';
|
import { SETTINGS, doBalanceSubscribe, doUpdateBlockHeight, doPopulateSharedUserState, doToast } from 'lbry-redux';
|
||||||
import {
|
import {
|
||||||
doAuthenticate,
|
doAuthenticate,
|
||||||
|
doInstallNew,
|
||||||
|
doInstallNewWithParams,
|
||||||
doBlackListedOutpointsSubscribe,
|
doBlackListedOutpointsSubscribe,
|
||||||
doFilteredOutpointsSubscribe,
|
doFilteredOutpointsSubscribe,
|
||||||
doCheckSubscriptionsInit,
|
|
||||||
doFetchMySubscriptions,
|
doFetchMySubscriptions,
|
||||||
doFetchRewardedContent,
|
doFetchRewardedContent,
|
||||||
doGetSync,
|
doGetSync,
|
||||||
doUserEmailToVerify,
|
doUserEmailToVerify,
|
||||||
doUserEmailVerify,
|
doUserEmailVerify,
|
||||||
doUserEmailVerifyFailure,
|
doUserEmailVerifyFailure,
|
||||||
|
selectAuthenticationIsPending,
|
||||||
selectUser,
|
selectUser,
|
||||||
selectEmailToVerify,
|
selectEmailToVerify,
|
||||||
} from 'lbryinc';
|
} from 'lbryinc';
|
||||||
import { doSetClientSetting } from 'redux/actions/settings';
|
import { doSetClientSetting } from 'redux/actions/settings';
|
||||||
|
import { selectLastRouteInStack } from 'redux/selectors/drawer';
|
||||||
import SplashScreen from './view';
|
import SplashScreen from './view';
|
||||||
|
|
||||||
const select = state => ({
|
const select = state => ({
|
||||||
|
authIsPending: selectAuthenticationIsPending(state),
|
||||||
user: selectUser(state),
|
user: selectUser(state),
|
||||||
emailToVerify: selectEmailToVerify(state),
|
emailToVerify: selectEmailToVerify(state),
|
||||||
|
lastRouteInStack: selectLastRouteInStack(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
authenticate: (appVersion, os, firebaseToken) => dispatch(doAuthenticate(appVersion, os, firebaseToken)),
|
authenticate: (appVersion, os, firebaseToken) => dispatch(doAuthenticate(appVersion, os, firebaseToken)),
|
||||||
|
installNewWithParams: (appVersion, installationId, nodeId, lbrynetVersion, os, platform, firebaseToken) =>
|
||||||
|
dispatch(doInstallNewWithParams(appVersion, installationId, nodeId, lbrynetVersion, os, platform, firebaseToken)),
|
||||||
balanceSubscribe: () => dispatch(doBalanceSubscribe()),
|
balanceSubscribe: () => dispatch(doBalanceSubscribe()),
|
||||||
blacklistedOutpointsSubscribe: () => dispatch(doBlackListedOutpointsSubscribe()),
|
blacklistedOutpointsSubscribe: () => dispatch(doBlackListedOutpointsSubscribe()),
|
||||||
filteredOutpointsSubscribe: () => dispatch(doFilteredOutpointsSubscribe()),
|
filteredOutpointsSubscribe: () => dispatch(doFilteredOutpointsSubscribe()),
|
||||||
checkSubscriptionsInit: () => dispatch(doCheckSubscriptionsInit()),
|
|
||||||
fetchRewardedContent: () => dispatch(doFetchRewardedContent()),
|
fetchRewardedContent: () => dispatch(doFetchRewardedContent()),
|
||||||
fetchSubscriptions: callback => dispatch(doFetchMySubscriptions(callback)),
|
fetchSubscriptions: callback => dispatch(doFetchMySubscriptions(callback)),
|
||||||
getSync: (password, callback) => dispatch(doGetSync(password, callback)),
|
getSync: (password, callback) => dispatch(doGetSync(password, callback)),
|
||||||
@@ -40,7 +46,4 @@ const perform = dispatch => ({
|
|||||||
verifyUserEmailFailure: error => dispatch(doUserEmailVerifyFailure(error)),
|
verifyUserEmailFailure: error => dispatch(doUserEmailVerifyFailure(error)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(select, perform)(SplashScreen);
|
||||||
select,
|
|
||||||
perform
|
|
||||||
)(SplashScreen);
|
|
||||||
+153
-72
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Lbry, doPreferenceGet } from 'lbry-redux';
|
import { Lbry, doPreferenceGet, isURIValid } from 'lbry-redux';
|
||||||
import { Lbryio } from 'lbryinc';
|
import { Lbryio } from 'lbryinc';
|
||||||
import { ActivityIndicator, DeviceEventEmitter, Linking, NativeModules, Platform, Text, View } from 'react-native';
|
import { ActivityIndicator, DeviceEventEmitter, Linking, NativeModules, Platform, Text, View } from 'react-native';
|
||||||
import { NavigationActions, StackActions } from 'react-navigation';
|
import { NavigationActions, StackActions } from 'react-navigation';
|
||||||
@@ -11,7 +11,7 @@ import Button from 'component/button';
|
|||||||
import ProgressBar from 'component/progressBar';
|
import ProgressBar from 'component/progressBar';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
import Constants, { DrawerRoutes, InnerDrawerRoutes } from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import splashStyle from 'styles/splash';
|
import splashStyle from 'styles/splash';
|
||||||
import RNFS from 'react-native-fs';
|
import RNFS from 'react-native-fs';
|
||||||
|
|
||||||
@@ -24,8 +24,10 @@ class SplashScreen extends React.PureComponent {
|
|||||||
|
|
||||||
state = {
|
state = {
|
||||||
accountUnlockFailed: false,
|
accountUnlockFailed: false,
|
||||||
|
appVersion: null,
|
||||||
daemonReady: false,
|
daemonReady: false,
|
||||||
details: __('Starting up'),
|
details: __('Starting up'),
|
||||||
|
firebaseToken: null,
|
||||||
message: __('Connecting'),
|
message: __('Connecting'),
|
||||||
isRunning: false,
|
isRunning: false,
|
||||||
isLagging: false,
|
isLagging: false,
|
||||||
@@ -34,16 +36,61 @@ class SplashScreen extends React.PureComponent {
|
|||||||
headersDownloadProgress: 0,
|
headersDownloadProgress: 0,
|
||||||
shouldAuthenticate: false,
|
shouldAuthenticate: false,
|
||||||
subscriptionsFetched: false,
|
subscriptionsFetched: false,
|
||||||
|
liteMode: false,
|
||||||
|
liteModeParams: {},
|
||||||
|
};
|
||||||
|
|
||||||
|
initLiteMode = () => {
|
||||||
|
NativeModules.UtilityModule.getLbrynetDirectory().then(path => {
|
||||||
|
NativeModules.UtilityModule.getPlatform().then(platform => {
|
||||||
|
RNFS.readFile(`${path}/install_id`, 'utf8')
|
||||||
|
.then(installIdContent => {
|
||||||
|
// node_id is actually optional (won't be present if dht is disabled)
|
||||||
|
// RNFS.readFile(`${path}/node_id`, 'utf8').then(nodeIdContent => {
|
||||||
|
// TODO: Load proper lbrynetVersion value
|
||||||
|
this.setState(
|
||||||
|
{
|
||||||
|
liteModeParams: {
|
||||||
|
installationId: installIdContent,
|
||||||
|
nodeId: null,
|
||||||
|
lbrynetVersion: '0.62.0',
|
||||||
|
platform,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
() => this.updateStatus(),
|
||||||
|
);
|
||||||
|
// }).catch((err) => { console.log(err); console.log('node_id not found.'); this.lbryConnect() });
|
||||||
|
})
|
||||||
|
.catch(() => this.lbryConnect());
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
updateStatus() {
|
updateStatus() {
|
||||||
Lbry.status().then(status => {
|
const { authenticate } = this.props;
|
||||||
this._updateStatusCallback(status);
|
const { liteMode } = this.state;
|
||||||
});
|
|
||||||
|
if (liteMode) {
|
||||||
|
// authenticate immediately
|
||||||
|
NativeModules.VersionInfo.getAppVersion().then(appVersion => {
|
||||||
|
this.setState({ appVersion, shouldAuthenticate: true });
|
||||||
|
NativeModules.Firebase.getMessagingToken()
|
||||||
|
.then(firebaseToken => {
|
||||||
|
this.setState({ firebaseToken }, () => authenticate(appVersion, Platform.OS, firebaseToken, false));
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
authenticate(appVersion, Platform.OS, null, false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Lbry.status().then(status => {
|
||||||
|
this._updateStatusCallback(status);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
navigateToMain = () => {
|
navigateToMain = () => {
|
||||||
const { navigation, notify, verifyUserEmail, verifyUserEmailFailure } = this.props;
|
const { lastRouteInStack, navigation, notify, verifyUserEmail, verifyUserEmailFailure } = this.props;
|
||||||
const resetAction = StackActions.reset({
|
const resetAction = StackActions.reset({
|
||||||
index: 0,
|
index: 0,
|
||||||
actions: [NavigationActions.navigate({ routeName: 'Main' })],
|
actions: [NavigationActions.navigate({ routeName: 'Main' })],
|
||||||
@@ -55,48 +102,54 @@ class SplashScreen extends React.PureComponent {
|
|||||||
? navigation.state.params.launchUrl
|
? navigation.state.params.launchUrl
|
||||||
: this.state.launchUrl;
|
: this.state.launchUrl;
|
||||||
if (launchUrl) {
|
if (launchUrl) {
|
||||||
if (launchUrl.startsWith('lbry://?verify=')) {
|
navigateToUri(navigation, transformUrl(launchUrl));
|
||||||
let verification = {};
|
} else if (lastRouteInStack) {
|
||||||
try {
|
// no launch url, check if there's a last route in stack to navigate to.
|
||||||
verification = JSON.parse(atob(launchUrl.substring(15)));
|
const { route, params } = lastRouteInStack;
|
||||||
} catch (error) {
|
if (route) {
|
||||||
console.log(error);
|
if (DrawerRoutes.includes(route)) {
|
||||||
|
navigation.navigate({ routeName: route, params });
|
||||||
|
} else if (!InnerDrawerRoutes.includes(route) && isURIValid(route)) {
|
||||||
|
navigateToUri(navigation, route);
|
||||||
}
|
}
|
||||||
if (verification.token && verification.recaptcha) {
|
|
||||||
AsyncStorage.setItem(Constants.KEY_SHOULD_VERIFY_EMAIL, 'true');
|
|
||||||
try {
|
|
||||||
verifyUserEmail(verification.token, verification.recaptcha);
|
|
||||||
} catch (error) {
|
|
||||||
const message = __('Invalid Verification Token');
|
|
||||||
verifyUserEmailFailure(message);
|
|
||||||
notify({ message });
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
notify({
|
|
||||||
message: __('Invalid Verification URI'),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
navigateToUri(navigation, transformUrl(launchUrl));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// splash screen is done at this point, next page to be displayed will be user-interactable
|
||||||
|
NativeModules.Firebase.logLaunchTiming();
|
||||||
};
|
};
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
const { emailToVerify, getSync, setEmailToVerify, verifyUserEmail, verifyUserEmailFailure } = this.props;
|
const { getSync, installNewWithParams } = this.props;
|
||||||
const { daemonReady, shouldAuthenticate } = this.state;
|
const { daemonReady, shouldAuthenticate, liteMode, liteModeParams, appVersion, firebaseToken } = this.state;
|
||||||
const { user } = nextProps;
|
const { user } = nextProps;
|
||||||
|
|
||||||
if (daemonReady && shouldAuthenticate && user && user.id) {
|
if (liteMode && user && user.id) {
|
||||||
|
this.navigateToLiteMode();
|
||||||
|
} else if (daemonReady && shouldAuthenticate && user && user.id) {
|
||||||
this.setState({ shouldAuthenticate: false }, () => {
|
this.setState({ shouldAuthenticate: false }, () => {
|
||||||
|
// call install new after successful authentication
|
||||||
|
if (liteMode) {
|
||||||
|
const { installationId, nodeId, lbrynetVersion, platform } = liteModeParams;
|
||||||
|
installNewWithParams(
|
||||||
|
appVersion,
|
||||||
|
installationId,
|
||||||
|
nodeId,
|
||||||
|
lbrynetVersion,
|
||||||
|
Platform.OS,
|
||||||
|
platform,
|
||||||
|
firebaseToken,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// user is authenticated, navigate to the main view
|
// user is authenticated, navigate to the main view
|
||||||
if (user.has_verified_email) {
|
if (user.has_verified_email) {
|
||||||
NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(walletPassword => {
|
NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(walletPassword => {
|
||||||
getSync(walletPassword, () => {
|
getSync(walletPassword, () => {
|
||||||
this.getUserSettings();
|
this.getUserSettings();
|
||||||
this.navigateToMain();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
this.navigateToMain();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,6 +158,21 @@ class SplashScreen extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
navigateToLiteMode = () => {
|
||||||
|
const { navigation } = this.props;
|
||||||
|
const { launchUrl } = this.state;
|
||||||
|
const resetAction = StackActions.reset({
|
||||||
|
index: 0,
|
||||||
|
actions: [
|
||||||
|
NavigationActions.navigate({
|
||||||
|
routeName: Constants.DRAWER_ROUTE_LITE_FILE,
|
||||||
|
params: { uri: launchUrl },
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
});
|
||||||
|
navigation.dispatch(resetAction);
|
||||||
|
};
|
||||||
|
|
||||||
getUserSettings = () => {
|
getUserSettings = () => {
|
||||||
const { populateSharedUserState } = this.props;
|
const { populateSharedUserState } = this.props;
|
||||||
|
|
||||||
@@ -130,39 +198,38 @@ class SplashScreen extends React.PureComponent {
|
|||||||
authenticate,
|
authenticate,
|
||||||
balanceSubscribe,
|
balanceSubscribe,
|
||||||
blacklistedOutpointsSubscribe,
|
blacklistedOutpointsSubscribe,
|
||||||
checkSubscriptionsInit,
|
|
||||||
filteredOutpointsSubscribe,
|
filteredOutpointsSubscribe,
|
||||||
getSync,
|
getSync,
|
||||||
updateBlockHeight,
|
updateBlockHeight,
|
||||||
user,
|
user,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
Lbry.resolve({ urls: 'lbry://one' }).then(() => {
|
// Lbry.resolve({ urls: 'lbry://one' }).then(() => {
|
||||||
// Leave the splash screen
|
// Leave the splash screen
|
||||||
balanceSubscribe();
|
balanceSubscribe();
|
||||||
blacklistedOutpointsSubscribe();
|
blacklistedOutpointsSubscribe();
|
||||||
filteredOutpointsSubscribe();
|
filteredOutpointsSubscribe();
|
||||||
checkSubscriptionsInit();
|
|
||||||
|
|
||||||
if (user && user.id && user.has_verified_email) {
|
if (user && user.id && user.has_verified_email) {
|
||||||
// user already authenticated
|
// user already authenticated
|
||||||
NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(walletPassword => {
|
NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(walletPassword => {
|
||||||
getSync(walletPassword, () => {
|
getSync(walletPassword, () => {
|
||||||
this.getUserSettings();
|
this.getUserSettings();
|
||||||
this.navigateToMain();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
} else {
|
});
|
||||||
NativeModules.VersionInfo.getAppVersion().then(appVersion => {
|
this.navigateToMain();
|
||||||
this.setState({ shouldAuthenticate: true });
|
} else {
|
||||||
|
NativeModules.VersionInfo.getAppVersion().then(appVersion => {
|
||||||
|
this.setState({ shouldAuthenticate: true }, () => {
|
||||||
NativeModules.Firebase.getMessagingToken()
|
NativeModules.Firebase.getMessagingToken()
|
||||||
.then(firebaseToken => {
|
.then(firebaseToken => {
|
||||||
authenticate(appVersion, Platform.OS, firebaseToken);
|
authenticate(appVersion, Platform.OS, firebaseToken);
|
||||||
})
|
})
|
||||||
.catch(() => authenticate(appVersion, Platform.OS));
|
.catch(() => authenticate(appVersion, Platform.OS));
|
||||||
});
|
});
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
|
// });
|
||||||
};
|
};
|
||||||
|
|
||||||
handleAccountUnlockFailed() {
|
handleAccountUnlockFailed() {
|
||||||
@@ -200,8 +267,8 @@ class SplashScreen extends React.PureComponent {
|
|||||||
Lbry.wallet_unlock({ password: password || '' }).then(unlocked => {
|
Lbry.wallet_unlock({ password: password || '' }).then(unlocked => {
|
||||||
if (unlocked) {
|
if (unlocked) {
|
||||||
this.setState({
|
this.setState({
|
||||||
message: __('Testing network'),
|
message: __('Authenticating'),
|
||||||
details: __('Waiting for name resolution'),
|
details: __('Waiting for authentication'),
|
||||||
});
|
});
|
||||||
this.finishSplashScreen();
|
this.finishSplashScreen();
|
||||||
} else {
|
} else {
|
||||||
@@ -210,8 +277,8 @@ class SplashScreen extends React.PureComponent {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.setState({
|
this.setState({
|
||||||
message: __('Testing network'),
|
message: __('Authenticating'),
|
||||||
details: __('Waiting for name resolution'),
|
details: __('Waiting for authentication'),
|
||||||
});
|
});
|
||||||
this.finishSplashScreen();
|
this.finishSplashScreen();
|
||||||
}
|
}
|
||||||
@@ -271,32 +338,30 @@ class SplashScreen extends React.PureComponent {
|
|||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
NativeModules.Firebase.track('app_launch', null);
|
NativeModules.Firebase.track('app_launch', null);
|
||||||
NativeModules.Firebase.setCurrentScreen('Splash');
|
NativeModules.Firebase.setCurrentScreen('Splash');
|
||||||
|
const { navigation } = this.props;
|
||||||
|
const { resetUrl } = navigation.state.params;
|
||||||
|
const isResetUrlSet = !!resetUrl;
|
||||||
|
|
||||||
this.props.fetchRewardedContent();
|
this.props.fetchRewardedContent();
|
||||||
Linking.getInitialURL().then(url => {
|
Linking.getInitialURL().then(url => {
|
||||||
|
let liteMode;
|
||||||
if (url) {
|
if (url) {
|
||||||
this.setState({ launchUrl: url });
|
liteMode = !isResetUrlSet && url.indexOf('liteMode=1') > -1;
|
||||||
|
this.setState({ launchUrl: resetUrl || url, liteMode });
|
||||||
}
|
}
|
||||||
|
|
||||||
NativeModules.UtilityModule.getNotificationLaunchTarget().then(target => {
|
NativeModules.UtilityModule.getNotificationLaunchTarget().then(target => {
|
||||||
if (target) {
|
if (target) {
|
||||||
this.setState({ launchUrl: target });
|
liteMode = !isResetUrlSet && target.indexOf('liteMode=1') > -1;
|
||||||
|
this.setState({ launchUrl: resetUrl || target, liteMode });
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only connect after checking initial launch url / notification launch target
|
// Only connect after checking initial launch url / notification launch target
|
||||||
Lbry.connect()
|
if (liteMode) {
|
||||||
.then(() => {
|
this.initLiteMode();
|
||||||
this.updateStatus();
|
} else {
|
||||||
})
|
this.lbryConnect();
|
||||||
.catch(e => {
|
}
|
||||||
this.setState({
|
|
||||||
isLagging: true,
|
|
||||||
message: __('Connection Failure'),
|
|
||||||
details: __(
|
|
||||||
'We could not establish a connection to the SDK. Your data connection may be preventing LBRY from connecting. Contact hello@lbry.com if you think this is a software bug.',
|
|
||||||
),
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -311,12 +376,28 @@ class SplashScreen extends React.PureComponent {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lbryConnect = () => {
|
||||||
|
Lbry.connect()
|
||||||
|
.then(() => {
|
||||||
|
this.updateStatus();
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
this.setState({
|
||||||
|
isLagging: true,
|
||||||
|
message: __('Connection Failure'),
|
||||||
|
details: __(
|
||||||
|
'We could not establish a connection to the SDK. Your data connection may be preventing LBRY from connecting. Contact hello@lbry.com if you think this is a software bug.',
|
||||||
|
),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
handleContinueAnywayPressed = () => {
|
handleContinueAnywayPressed = () => {
|
||||||
this.setState(
|
this.setState(
|
||||||
{
|
{
|
||||||
accountUnlockFailed: false,
|
accountUnlockFailed: false,
|
||||||
message: __('Testing network'),
|
message: __('Authenticating'),
|
||||||
details: __('Waiting for name resolution'),
|
details: __('Waiting for authentication'),
|
||||||
},
|
},
|
||||||
() => this.finishSplashScreen(),
|
() => this.finishSplashScreen(),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -7,13 +7,13 @@ import {
|
|||||||
selectSubscriptionClaims,
|
selectSubscriptionClaims,
|
||||||
selectSubscriptions,
|
selectSubscriptions,
|
||||||
selectIsFetchingSubscriptions,
|
selectIsFetchingSubscriptions,
|
||||||
selectIsFetchingSuggested,
|
|
||||||
selectSuggestedChannels,
|
selectSuggestedChannels,
|
||||||
selectUnreadSubscriptions,
|
selectUnreadSubscriptions,
|
||||||
selectViewMode,
|
selectViewMode,
|
||||||
selectFirstRunCompleted,
|
selectFirstRunCompleted,
|
||||||
selectShowSuggestedSubs,
|
selectShowSuggestedSubs,
|
||||||
} from 'lbryinc';
|
} from 'lbryinc';
|
||||||
|
import { doToast, selectFetchingClaimSearch } from 'lbry-redux';
|
||||||
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||||
import { doSetClientSetting, doSetTimeItem } from 'redux/actions/settings';
|
import { doSetClientSetting, doSetTimeItem } from 'redux/actions/settings';
|
||||||
import { makeSelectClientSetting, selectTimeItem } from 'redux/selectors/settings';
|
import { makeSelectClientSetting, selectTimeItem } from 'redux/selectors/settings';
|
||||||
@@ -24,7 +24,7 @@ import SubscriptionsPage from './view';
|
|||||||
const select = state => ({
|
const select = state => ({
|
||||||
currentRoute: selectCurrentRoute(state),
|
currentRoute: selectCurrentRoute(state),
|
||||||
loading: selectIsFetchingSubscriptions(state),
|
loading: selectIsFetchingSubscriptions(state),
|
||||||
loadingSuggested: selectIsFetchingSuggested(state),
|
loadingSuggested: selectFetchingClaimSearch(state),
|
||||||
subscribedChannels: selectSubscriptions(state),
|
subscribedChannels: selectSubscriptions(state),
|
||||||
suggestedChannels: selectSuggestedChannels(state),
|
suggestedChannels: selectSuggestedChannels(state),
|
||||||
subscriptionsViewMode: makeSelectClientSetting(Constants.SETTING_SUBSCRIPTIONS_VIEW_MODE)(state),
|
subscriptionsViewMode: makeSelectClientSetting(Constants.SETTING_SUBSCRIPTIONS_VIEW_MODE)(state),
|
||||||
@@ -41,6 +41,7 @@ const perform = dispatch => ({
|
|||||||
doFetchMySubscriptions: () => dispatch(doFetchMySubscriptions()),
|
doFetchMySubscriptions: () => dispatch(doFetchMySubscriptions()),
|
||||||
doFetchRecommendedSubscriptions: () => dispatch(doFetchRecommendedSubscriptions()),
|
doFetchRecommendedSubscriptions: () => dispatch(doFetchRecommendedSubscriptions()),
|
||||||
doSetViewMode: viewMode => dispatch(doSetViewMode(viewMode)),
|
doSetViewMode: viewMode => dispatch(doSetViewMode(viewMode)),
|
||||||
|
notify: data => dispatch(doToast(data)),
|
||||||
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_SUBSCRIPTIONS)),
|
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_SUBSCRIPTIONS)),
|
||||||
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
||||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||||
@@ -49,5 +50,5 @@ const perform = dispatch => ({
|
|||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
select,
|
select,
|
||||||
perform
|
perform,
|
||||||
)(SubscriptionsPage);
|
)(SubscriptionsPage);
|
||||||
@@ -28,6 +28,7 @@ import ModalPicker from 'component/modalPicker';
|
|||||||
import ModalSuggestedSubscriptions from 'component/modalSuggestedSubscriptions';
|
import ModalSuggestedSubscriptions from 'component/modalSuggestedSubscriptions';
|
||||||
import SubscribedChannelList from 'component/subscribedChannelList';
|
import SubscribedChannelList from 'component/subscribedChannelList';
|
||||||
import SuggestedSubscriptions from 'component/suggestedSubscriptions';
|
import SuggestedSubscriptions from 'component/suggestedSubscriptions';
|
||||||
|
import SuggestedSubscriptionsGrid from 'component/suggestedSubscriptionsGrid';
|
||||||
import UriBar from 'component/uriBar';
|
import UriBar from 'component/uriBar';
|
||||||
|
|
||||||
class SubscriptionsPage extends React.PureComponent {
|
class SubscriptionsPage extends React.PureComponent {
|
||||||
@@ -56,6 +57,7 @@ class SubscriptionsPage extends React.PureComponent {
|
|||||||
|
|
||||||
onComponentFocused = () => {
|
onComponentFocused = () => {
|
||||||
const {
|
const {
|
||||||
|
currentRoute,
|
||||||
doFetchMySubscriptions,
|
doFetchMySubscriptions,
|
||||||
doFetchRecommendedSubscriptions,
|
doFetchRecommendedSubscriptions,
|
||||||
doSetViewMode,
|
doSetViewMode,
|
||||||
@@ -64,12 +66,13 @@ class SubscriptionsPage extends React.PureComponent {
|
|||||||
subscriptionsViewMode,
|
subscriptionsViewMode,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
pushDrawerStack();
|
if (currentRoute === Constants.DRAWER_ROUTE_SUBSCRIPTIONS) {
|
||||||
|
pushDrawerStack();
|
||||||
|
}
|
||||||
setPlayerVisible();
|
setPlayerVisible();
|
||||||
NativeModules.Firebase.setCurrentScreen('Subscriptions');
|
NativeModules.Firebase.setCurrentScreen('Subscriptions');
|
||||||
|
|
||||||
doFetchMySubscriptions();
|
doFetchMySubscriptions();
|
||||||
doFetchRecommendedSubscriptions();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@@ -90,6 +93,15 @@ class SubscriptionsPage extends React.PureComponent {
|
|||||||
this.setState({ currentSortByItem: item, orderBy: getOrderBy(item), showSortPicker: false });
|
this.setState({ currentSortByItem: item, orderBy: getOrderBy(item), showSortPicker: false });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
shouldComponentUpdate(nextProps, nextState) {
|
||||||
|
const { showModalSuggestedSubs: prevShowModalSuggestedSubs } = this.state;
|
||||||
|
const { showModalSuggestedSubs } = this.state;
|
||||||
|
if (prevShowModalSuggestedSubs && showModalSuggestedSubs) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
handleTimeItemSelected = item => {
|
handleTimeItemSelected = item => {
|
||||||
const { setTimeItem } = this.props;
|
const { setTimeItem } = this.props;
|
||||||
setTimeItem(item);
|
setTimeItem(item);
|
||||||
@@ -115,7 +127,10 @@ class SubscriptionsPage extends React.PureComponent {
|
|||||||
unsubscribeShortChannelUrls = () => {
|
unsubscribeShortChannelUrls = () => {
|
||||||
// this should only have to happen once
|
// this should only have to happen once
|
||||||
const { subscribedChannels, channelUnsubscribe } = this.props;
|
const { subscribedChannels, channelUnsubscribe } = this.props;
|
||||||
const badSubs = subscribedChannels.filter(sub => sub.uri.split('#')[1].length < 5);
|
const badSubs = subscribedChannels.filter(sub => {
|
||||||
|
const parts = sub.uri.split('#');
|
||||||
|
return parts.length === 1 || parts[1].length < 5;
|
||||||
|
});
|
||||||
if (badSubs.length > 0) {
|
if (badSubs.length > 0) {
|
||||||
badSubs.forEach(sub => channelUnsubscribe(sub));
|
badSubs.forEach(sub => channelUnsubscribe(sub));
|
||||||
}
|
}
|
||||||
@@ -135,6 +150,7 @@ class SubscriptionsPage extends React.PureComponent {
|
|||||||
timeItem,
|
timeItem,
|
||||||
unreadSubscriptions,
|
unreadSubscriptions,
|
||||||
navigation,
|
navigation,
|
||||||
|
notify,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const { currentSortByItem, filteredChannels, showModalSuggestedSubs, showSortPicker, showTimePicker } = this.state;
|
const { currentSortByItem, filteredChannels, showModalSuggestedSubs, showSortPicker, showTimePicker } = this.state;
|
||||||
|
|
||||||
@@ -161,7 +177,11 @@ class SubscriptionsPage extends React.PureComponent {
|
|||||||
<View style={subscriptionsStyle.container}>
|
<View style={subscriptionsStyle.container}>
|
||||||
<UriBar navigation={navigation} belowOverlay={this.state.showSortPicker} />
|
<UriBar navigation={navigation} belowOverlay={this.state.showSortPicker} />
|
||||||
<View style={subscriptionsStyle.titleRow}>
|
<View style={subscriptionsStyle.titleRow}>
|
||||||
<Text style={subscriptionsStyle.pageTitle}>{__('Channels you follow')}</Text>
|
<Text style={subscriptionsStyle.pageTitle}>
|
||||||
|
{hasSubscriptions && !this.state.showingSuggestedSubs
|
||||||
|
? __('Channels you follow')
|
||||||
|
: __('Find Channels to follow')}
|
||||||
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
{!this.state.showingSuggestedSubs && hasSubscriptions && (
|
{!this.state.showingSuggestedSubs && hasSubscriptions && (
|
||||||
<View style={subscriptionsStyle.pickerRow}>
|
<View style={subscriptionsStyle.pickerRow}>
|
||||||
@@ -187,7 +207,7 @@ class SubscriptionsPage extends React.PureComponent {
|
|||||||
|
|
||||||
<Link
|
<Link
|
||||||
style={subscriptionsStyle.suggestedLink}
|
style={subscriptionsStyle.suggestedLink}
|
||||||
text={__('Suggested')}
|
text={__('Discover')}
|
||||||
onPress={() => this.setState({ showModalSuggestedSubs: true })}
|
onPress={() => this.setState({ showModalSuggestedSubs: true })}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
@@ -217,39 +237,40 @@ class SubscriptionsPage extends React.PureComponent {
|
|||||||
|
|
||||||
{this.state.showingSuggestedSubs && (
|
{this.state.showingSuggestedSubs && (
|
||||||
<View style={subscriptionsStyle.suggestedSubsContainer}>
|
<View style={subscriptionsStyle.suggestedSubsContainer}>
|
||||||
{!hasSubscriptions && (
|
<View style={subscriptionsStyle.infoArea}>
|
||||||
<View style={subscriptionsStyle.infoArea}>
|
<Text style={subscriptionsStyle.infoText}>
|
||||||
<Text style={subscriptionsStyle.infoText}>
|
{__(
|
||||||
{__('You are not subscribed to any channels at the moment.')}
|
'LBRY works better if you follow at least 5 creators you like. Sign in to show creators you follow if you already have an account.',
|
||||||
</Text>
|
)}
|
||||||
</View>
|
</Text>
|
||||||
)}
|
</View>
|
||||||
|
|
||||||
{hasSubscriptions && (
|
<View style={subscriptionsStyle.mainSuggested}>
|
||||||
<View style={subscriptionsStyle.infoArea}>
|
<SuggestedSubscriptionsGrid navigation={navigation} />
|
||||||
<Text style={subscriptionsStyle.infoText}>
|
</View>
|
||||||
You are currently subscribed to {numberOfSubscriptions} channel{numberOfSubscriptions > 1 ? 's' : ''}.
|
|
||||||
</Text>
|
<Button
|
||||||
<Button
|
style={subscriptionsStyle.suggestedDoneButton}
|
||||||
style={subscriptionsStyle.button}
|
text={
|
||||||
text={__('View my subscriptions')}
|
numberOfSubscriptions < 5
|
||||||
onPress={() => this.setState({ showingSuggestedSubs: false })}
|
? __('%remaining% more...', { remaining: 5 - numberOfSubscriptions })
|
||||||
/>
|
: __('Done')
|
||||||
</View>
|
}
|
||||||
)}
|
onPress={() => {
|
||||||
|
if (!hasSubscriptions) {
|
||||||
|
notify({ message: __('Tap on any channel to follow') });
|
||||||
|
} else {
|
||||||
|
this.setState({ showingSuggestedSubs: false });
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
{loadingSuggested && (
|
{loadingSuggested && (
|
||||||
<View style={subscriptionsStyle.centered}>
|
<ActivityIndicator size="small" color={Colors.White} style={subscriptionsStyle.suggestedLoading} />
|
||||||
<ActivityIndicator size="large" colors={Colors.NextLbryGreen} style={subscriptionsStyle.loading} />
|
|
||||||
</View>
|
|
||||||
)}
|
)}
|
||||||
{!loadingSuggested && <SuggestedSubscriptions navigation={navigation} />}
|
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{!showSortPicker && !showTimePicker && !showModalSuggestedSubs && (
|
|
||||||
<FloatingWalletBalance navigation={navigation} />
|
|
||||||
)}
|
|
||||||
{showSortPicker && (
|
{showSortPicker && (
|
||||||
<ModalPicker
|
<ModalPicker
|
||||||
title={__('Sort content by')}
|
title={__('Sort content by')}
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ class PhoneVerifyPage extends React.PureComponent {
|
|||||||
codeVerifyStarted: false,
|
codeVerifyStarted: false,
|
||||||
codeVerifySuccessful: false,
|
codeVerifySuccessful: false,
|
||||||
countryCode: null,
|
countryCode: null,
|
||||||
|
countryPickerVisible: false,
|
||||||
newPhoneAdded: false,
|
newPhoneAdded: false,
|
||||||
number: null,
|
number: null,
|
||||||
phoneVerifyFailed: false,
|
phoneVerifyFailed: false,
|
||||||
@@ -125,15 +126,15 @@ class PhoneVerifyPage extends React.PureComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onPressFlag = () => {
|
onPressFlag = () => {
|
||||||
if (this.picker) {
|
this.setState({ countryPickerVisible: true });
|
||||||
this.picker.openModal();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
selectCountry(country) {
|
selectCountry = country => {
|
||||||
this.phoneInput.selectCountry(country.cca2.toLowerCase());
|
this.phoneInput.selectCountry(country.cca2.toLowerCase());
|
||||||
this.setState({ cca2: country.cca2 });
|
this.setState({ cca2: country.cca2, countryPickerVisible: false }, () => {
|
||||||
}
|
this.phoneInput.focus();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
handleChangeText = text => {
|
handleChangeText = text => {
|
||||||
this.setState({ verificationCode: text });
|
this.setState({ verificationCode: text });
|
||||||
@@ -233,17 +234,17 @@ class PhoneVerifyPage extends React.PureComponent {
|
|||||||
</View>
|
</View>
|
||||||
|
|
||||||
<CountryPicker
|
<CountryPicker
|
||||||
ref={picker => {
|
countryCode={this.state.cca2}
|
||||||
this.picker = picker;
|
withAlphaFilter
|
||||||
}}
|
withFilter
|
||||||
cca2={this.state.cca2}
|
withFlag
|
||||||
filterable
|
withFlagButton={false}
|
||||||
onChange={value => this.selectCountry(value)}
|
withCallingCode
|
||||||
showCallingCode
|
withModal
|
||||||
|
onSelect={this.selectCountry}
|
||||||
translation="eng"
|
translation="eng"
|
||||||
>
|
modalProps={{ visible: this.state.countryPickerVisible }}
|
||||||
<View />
|
/>
|
||||||
</CountryPicker>
|
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { NativeModules, ScrollView, Text, View } from 'react-native';
|
|||||||
import TransactionListRecent from 'component/transactionListRecent';
|
import TransactionListRecent from 'component/transactionListRecent';
|
||||||
import WalletAddress from 'component/walletAddress';
|
import WalletAddress from 'component/walletAddress';
|
||||||
import WalletBalance from 'component/walletBalance';
|
import WalletBalance from 'component/walletBalance';
|
||||||
|
import WalletBalanceExtra from 'component/walletBalanceExtra';
|
||||||
import WalletSend from 'component/walletSend';
|
import WalletSend from 'component/walletSend';
|
||||||
import WalletRewardsDriver from 'component/walletRewardsDriver';
|
import WalletRewardsDriver from 'component/walletRewardsDriver';
|
||||||
import WalletSignIn from 'component/walletSignIn';
|
import WalletSignIn from 'component/walletSignIn';
|
||||||
@@ -90,6 +91,7 @@ class WalletPage extends React.PureComponent {
|
|||||||
>
|
>
|
||||||
{!rewardsNotInterested && (!balance || balance === 0) && <WalletRewardsDriver navigation={navigation} />}
|
{!rewardsNotInterested && (!balance || balance === 0) && <WalletRewardsDriver navigation={navigation} />}
|
||||||
<WalletBalance />
|
<WalletBalance />
|
||||||
|
<WalletBalanceExtra />
|
||||||
<WalletAddress />
|
<WalletAddress />
|
||||||
<WalletSend />
|
<WalletSend />
|
||||||
<TransactionListRecent navigation={navigation} />
|
<TransactionListRecent navigation={navigation} />
|
||||||
|
|||||||
@@ -1,18 +1,28 @@
|
|||||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
|
|
||||||
export const doPushDrawerStack = (routeName, params) => dispatch =>
|
export const doPushDrawerStack = (routeName, params) => dispatch => {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: Constants.ACTION_PUSH_DRAWER_STACK,
|
type: Constants.ACTION_PUSH_DRAWER_STACK,
|
||||||
data: { routeName, params },
|
data: { routeName, params },
|
||||||
});
|
});
|
||||||
|
|
||||||
export const doPopDrawerStack = () => dispatch =>
|
if (window.persistor) {
|
||||||
|
window.persistor.flush();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const doPopDrawerStack = () => dispatch => {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: Constants.ACTION_POP_DRAWER_STACK,
|
type: Constants.ACTION_POP_DRAWER_STACK,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const doSetPlayerVisible = visible => dispatch =>
|
if (window.persistor) {
|
||||||
|
window.persistor.flush();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const doSetPlayerVisible = (visible, uri) => dispatch =>
|
||||||
dispatch({
|
dispatch({
|
||||||
type: Constants.ACTION_SET_PLAYER_VISIBLE,
|
type: Constants.ACTION_SET_PLAYER_VISIBLE,
|
||||||
data: { visible },
|
data: { visible, uri },
|
||||||
});
|
});
|
||||||
+18
-16
@@ -59,22 +59,24 @@ export function doCompleteDownload(uri, outpoint, fileInfo) {
|
|||||||
export function doStopDownloadingFile(uri, fileInfo) {
|
export function doStopDownloadingFile(uri, fileInfo) {
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
let params = { status: 'stop' };
|
let params = { status: 'stop' };
|
||||||
if (fileInfo.sd_hash) {
|
if (fileInfo) {
|
||||||
params.sd_hash = fileInfo.sd_hash;
|
if (fileInfo.sd_hash) {
|
||||||
}
|
params.sd_hash = fileInfo.sd_hash;
|
||||||
if (fileInfo.stream_hash) {
|
}
|
||||||
params.stream_hash = fileInfo.stream_hash;
|
if (fileInfo.stream_hash) {
|
||||||
}
|
params.stream_hash = fileInfo.stream_hash;
|
||||||
|
}
|
||||||
|
|
||||||
Lbry.file_set_status(params).then(() => {
|
Lbry.file_set_status(params).then(() => {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ACTIONS.DOWNLOADING_CANCELED,
|
type: ACTIONS.DOWNLOADING_CANCELED,
|
||||||
data: { uri, outpoint: fileInfo.outpoint },
|
data: { uri, outpoint: fileInfo.outpoint },
|
||||||
|
});
|
||||||
|
|
||||||
|
// Should also delete the file after the user stops downloading
|
||||||
|
dispatch(doDeleteFile(fileInfo.outpoint, uri));
|
||||||
});
|
});
|
||||||
|
}
|
||||||
// Should also delete the file after the user stops downloading
|
|
||||||
dispatch(doDeleteFile(fileInfo.outpoint, uri));
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,7 +97,7 @@ export function doDeleteFile(outpoint, deleteFromComputer, abandonClaim) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// If the file is for a claim we published then also abandon the claim
|
// If the file is for a claim we published then also abandon the claim
|
||||||
/*const myClaimsOutpoints = selectMyClaimsOutpoints(state);
|
/* const myClaimsOutpoints = selectMyClaimsOutpoints(state);
|
||||||
if (abandonClaim && myClaimsOutpoints.indexOf(outpoint) !== -1) {
|
if (abandonClaim && myClaimsOutpoints.indexOf(outpoint) !== -1) {
|
||||||
const byOutpoint = selectFileInfosByOutpoint(state);
|
const byOutpoint = selectFileInfosByOutpoint(state);
|
||||||
const fileInfo = byOutpoint[outpoint];
|
const fileInfo = byOutpoint[outpoint];
|
||||||
@@ -106,7 +108,7 @@ export function doDeleteFile(outpoint, deleteFromComputer, abandonClaim) {
|
|||||||
|
|
||||||
dispatch(doAbandonClaim(txid, nout));
|
dispatch(doAbandonClaim(txid, nout));
|
||||||
}
|
}
|
||||||
}*/
|
} */
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ACTIONS.FILE_DELETE,
|
type: ACTIONS.FILE_DELETE,
|
||||||
|
|||||||
@@ -2,15 +2,30 @@ import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
|||||||
|
|
||||||
const reducers = {};
|
const reducers = {};
|
||||||
const defaultState = {
|
const defaultState = {
|
||||||
stack: [{ route: Constants.DRAWER_ROUTE_DISCOVER, params: {} }], // Discover is always the first drawer route
|
stack: [{ route: Constants.DRAWER_ROUTE_SUBSCRIPTIONS, params: {} }], // Following is always the first drawer route
|
||||||
|
lastRouteInStack: {},
|
||||||
playerVisible: false,
|
playerVisible: false,
|
||||||
|
playerVisibleByUri: {},
|
||||||
currentRoute: null,
|
currentRoute: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
reducers[Constants.ACTION_SET_PLAYER_VISIBLE] = (state, action) =>
|
reducers[Constants.ACTION_SET_PLAYER_VISIBLE] = (state, action) => {
|
||||||
Object.assign({}, state, {
|
const { visible, uri } = action.data;
|
||||||
|
const playerVisibleByUri = Object.assign({}, state.playerVisibleByUri);
|
||||||
|
|
||||||
|
if (!uri) {
|
||||||
|
Object.keys(playerVisibleByUri).forEach(playerUri => {
|
||||||
|
playerVisibleByUri[playerUri] = visible;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
playerVisibleByUri[uri] = visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Object.assign({}, state, {
|
||||||
playerVisible: action.data.visible,
|
playerVisible: action.data.visible,
|
||||||
|
playerVisibleByUri,
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
reducers[Constants.ACTION_PUSH_DRAWER_STACK] = (state, action) => {
|
reducers[Constants.ACTION_PUSH_DRAWER_STACK] = (state, action) => {
|
||||||
const { routeName, params } = action.data;
|
const { routeName, params } = action.data;
|
||||||
@@ -27,24 +42,35 @@ reducers[Constants.ACTION_PUSH_DRAWER_STACK] = (state, action) => {
|
|||||||
if (lastRoute === Constants.DRAWER_ROUTE_PUBLISH_FORM && routeName === Constants.DRAWER_ROUTE_PUBLISH) {
|
if (lastRoute === Constants.DRAWER_ROUTE_PUBLISH_FORM && routeName === Constants.DRAWER_ROUTE_PUBLISH) {
|
||||||
canPushStack = false;
|
canPushStack = false;
|
||||||
}
|
}
|
||||||
|
if (routeName === Constants.DRAWER_ROUTE_SUBSCRIPTIONS && newStack.length === 1) {
|
||||||
|
canPushStack = false;
|
||||||
|
}
|
||||||
|
if (routeName === Constants.DRAWER_ROUTE_LITE_FILE) {
|
||||||
|
canPushStack = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
let lastRouteInStack;
|
||||||
if (canPushStack) {
|
if (canPushStack) {
|
||||||
newStack.push({ route: routeName, params });
|
newStack.push({ route: routeName, params });
|
||||||
|
lastRouteInStack = { route: routeName, params };
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
stack: newStack,
|
stack: newStack,
|
||||||
|
lastRouteInStack,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
reducers[Constants.ACTION_POP_DRAWER_STACK] = (state, action) => {
|
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
|
// 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);
|
const newStack = state.stack.length === 1 ? state.stack.slice() : state.stack.slice(0, state.stack.length - 1);
|
||||||
|
const lastRouteInStack = newStack && newStack.length > 0 ? newStack[newStack.length - 1] : null;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
stack: newStack,
|
stack: newStack,
|
||||||
|
lastRouteInStack,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -4,14 +4,25 @@ export const selectState = state => state.drawer || {};
|
|||||||
|
|
||||||
export const selectDrawerStack = createSelector(
|
export const selectDrawerStack = createSelector(
|
||||||
selectState,
|
selectState,
|
||||||
state => state.stack
|
state => state.stack,
|
||||||
);
|
);
|
||||||
|
|
||||||
export const selectIsPlayerVisible = createSelector(
|
export const selectIsPlayerVisible = createSelector(
|
||||||
selectState,
|
selectState,
|
||||||
state => state.playerVisible
|
state => state.playerVisible,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export const selectPlayerVisibleByUri = createSelector(
|
||||||
|
selectState,
|
||||||
|
state => state.playerVisibleByUri,
|
||||||
|
);
|
||||||
|
|
||||||
|
export const makeSelectPlayerVisible = uri =>
|
||||||
|
createSelector(
|
||||||
|
selectPlayerVisibleByUri,
|
||||||
|
byUri => (byUri ? byUri[uri] : false),
|
||||||
|
);
|
||||||
|
|
||||||
export const selectLastDrawerRoute = createSelector(
|
export const selectLastDrawerRoute = createSelector(
|
||||||
selectState,
|
selectState,
|
||||||
state => {
|
state => {
|
||||||
@@ -20,10 +31,15 @@ export const selectLastDrawerRoute = createSelector(
|
|||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
export const selectLastRouteInStack = createSelector(
|
||||||
|
selectState,
|
||||||
|
state => state.lastRouteInStack,
|
||||||
);
|
);
|
||||||
|
|
||||||
export const selectCurrentRoute = createSelector(
|
export const selectCurrentRoute = createSelector(
|
||||||
selectState,
|
selectState,
|
||||||
state => state.currentRoute
|
state => state.currentRoute,
|
||||||
);
|
);
|
||||||
+9
-9
@@ -32,14 +32,14 @@ const aboutStyle = StyleSheet.create({
|
|||||||
title: {
|
title: {
|
||||||
color: Colors.LbryGreen,
|
color: Colors.LbryGreen,
|
||||||
fontSize: 24,
|
fontSize: 24,
|
||||||
fontFamily: 'Inter-UI-SemiBold',
|
fontFamily: 'Inter-SemiBold',
|
||||||
marginTop: 16,
|
marginTop: 16,
|
||||||
marginLeft: 12,
|
marginLeft: 12,
|
||||||
marginRight: 12,
|
marginRight: 12,
|
||||||
marginBottom: 8,
|
marginBottom: 8,
|
||||||
},
|
},
|
||||||
paragraph: {
|
paragraph: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
lineHeight: 24,
|
lineHeight: 24,
|
||||||
marginLeft: 12,
|
marginLeft: 12,
|
||||||
@@ -53,13 +53,13 @@ const aboutStyle = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
link: {
|
link: {
|
||||||
color: Colors.LbryGreen,
|
color: Colors.LbryGreen,
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
marginBottom: 24,
|
marginBottom: 24,
|
||||||
},
|
},
|
||||||
listLink: {
|
listLink: {
|
||||||
color: Colors.LbryGreen,
|
color: Colors.LbryGreen,
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
alignSelf: 'flex-end',
|
alignSelf: 'flex-end',
|
||||||
},
|
},
|
||||||
@@ -67,30 +67,30 @@ const aboutStyle = StyleSheet.create({
|
|||||||
alignSelf: 'stretch',
|
alignSelf: 'stretch',
|
||||||
},
|
},
|
||||||
socialTitle: {
|
socialTitle: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
marginLeft: 12,
|
marginLeft: 12,
|
||||||
marginRight: 12,
|
marginRight: 12,
|
||||||
marginBottom: 8,
|
marginBottom: 8,
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
},
|
},
|
||||||
releaseInfoTitle: {
|
releaseInfoTitle: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
marginLeft: 12,
|
marginLeft: 12,
|
||||||
marginRight: 12,
|
marginRight: 12,
|
||||||
marginBottom: 12,
|
marginBottom: 12,
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
},
|
},
|
||||||
text: {
|
text: {
|
||||||
fontFamily: 'Inter-UI-SemiBold',
|
fontFamily: 'Inter-SemiBold',
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
},
|
},
|
||||||
valueText: {
|
valueText: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
textAlign: 'right',
|
textAlign: 'right',
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
},
|
},
|
||||||
lineValueText: {
|
lineValueText: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ const buttonStyle = StyleSheet.create({
|
|||||||
color: Colors.DarkGrey,
|
color: Colors.DarkGrey,
|
||||||
},
|
},
|
||||||
text: {
|
text: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
},
|
},
|
||||||
textWithIcon: {
|
textWithIcon: {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ const channelCreatorStyle = StyleSheet.create({
|
|||||||
backgroundColor: Colors.PageBackground,
|
backgroundColor: Colors.PageBackground,
|
||||||
},
|
},
|
||||||
channelPicker: {
|
channelPicker: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
height: 52,
|
height: 52,
|
||||||
width: '100%',
|
width: '100%',
|
||||||
@@ -27,7 +27,7 @@ const channelCreatorStyle = StyleSheet.create({
|
|||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
label: {
|
label: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
},
|
},
|
||||||
balance: {
|
balance: {
|
||||||
@@ -36,24 +36,24 @@ const channelCreatorStyle = StyleSheet.create({
|
|||||||
marginLeft: 24,
|
marginLeft: 24,
|
||||||
},
|
},
|
||||||
balanceText: {
|
balanceText: {
|
||||||
fontFamily: 'Inter-UI-SemiBold',
|
fontFamily: 'Inter-SemiBold',
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
marginLeft: 4,
|
marginLeft: 4,
|
||||||
},
|
},
|
||||||
channelNameInput: {
|
channelNameInput: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
paddingLeft: 20,
|
paddingLeft: 20,
|
||||||
},
|
},
|
||||||
bidAmountInput: {
|
bidAmountInput: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
marginLeft: 16,
|
marginLeft: 16,
|
||||||
textAlign: 'right',
|
textAlign: 'right',
|
||||||
width: 80,
|
width: 80,
|
||||||
},
|
},
|
||||||
helpText: {
|
helpText: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: Colors.DescriptionGrey,
|
color: Colors.DescriptionGrey,
|
||||||
},
|
},
|
||||||
@@ -68,7 +68,7 @@ const channelCreatorStyle = StyleSheet.create({
|
|||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
left: 4,
|
left: 4,
|
||||||
top: 13,
|
top: 13,
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
},
|
},
|
||||||
buttonContainer: {
|
buttonContainer: {
|
||||||
@@ -90,7 +90,7 @@ const channelCreatorStyle = StyleSheet.create({
|
|||||||
alignSelf: 'flex-end',
|
alignSelf: 'flex-end',
|
||||||
},
|
},
|
||||||
inlineError: {
|
inlineError: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: Colors.Red,
|
color: Colors.Red,
|
||||||
marginTop: 2,
|
marginTop: 2,
|
||||||
@@ -151,12 +151,12 @@ const channelCreatorStyle = StyleSheet.create({
|
|||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
channelListTitle: {
|
channelListTitle: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
marginBottom: 4,
|
marginBottom: 4,
|
||||||
},
|
},
|
||||||
channelListName: {
|
channelListName: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
},
|
},
|
||||||
channelListAvatar: {
|
channelListAvatar: {
|
||||||
@@ -189,13 +189,13 @@ const channelCreatorStyle = StyleSheet.create({
|
|||||||
marginBottom: 4,
|
marginBottom: 4,
|
||||||
},
|
},
|
||||||
textInputTitle: {
|
textInputTitle: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
marginBottom: -10,
|
marginBottom: -10,
|
||||||
marginLeft: 4,
|
marginLeft: 4,
|
||||||
},
|
},
|
||||||
inputText: {
|
inputText: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
},
|
},
|
||||||
toggleContainer: {
|
toggleContainer: {
|
||||||
@@ -209,7 +209,7 @@ const channelCreatorStyle = StyleSheet.create({
|
|||||||
marginRight: 16,
|
marginRight: 16,
|
||||||
},
|
},
|
||||||
cardTitle: {
|
cardTitle: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
marginBottom: 8,
|
marginBottom: 8,
|
||||||
},
|
},
|
||||||
@@ -243,7 +243,7 @@ const channelCreatorStyle = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
editIcon: {
|
editIcon: {
|
||||||
color: Colors.White,
|
color: Colors.White,
|
||||||
fontFamily: 'Inter-UI-SemiBold',
|
fontFamily: 'Inter-SemiBold',
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
},
|
},
|
||||||
uploadProgress: {
|
uploadProgress: {
|
||||||
@@ -262,7 +262,7 @@ const channelCreatorStyle = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
uploadText: {
|
uploadText: {
|
||||||
color: Colors.White,
|
color: Colors.White,
|
||||||
fontFamily: 'Inter-UI-SemiBold',
|
fontFamily: 'Inter-SemiBold',
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
marginLeft: 4,
|
marginLeft: 4,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const channelIconStyle = StyleSheet.create({
|
|||||||
alignSelf: 'flex-start',
|
alignSelf: 'flex-start',
|
||||||
},
|
},
|
||||||
placeholderText: {
|
placeholderText: {
|
||||||
fontFamily: 'Inter-UI-SemiBold',
|
fontFamily: 'Inter-SemiBold',
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
},
|
},
|
||||||
thumbnailContainer: {
|
thumbnailContainer: {
|
||||||
@@ -39,14 +39,14 @@ const channelIconStyle = StyleSheet.create({
|
|||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
width: 80,
|
width: 80,
|
||||||
marginTop: 4,
|
marginTop: 4,
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
},
|
},
|
||||||
autothumbCharacter: {
|
autothumbCharacter: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 48,
|
fontSize: 48,
|
||||||
color: Colors.White,
|
color: Colors.White,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const channelPageStyle = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
color: Colors.LbryGreen,
|
color: Colors.LbryGreen,
|
||||||
fontFamily: 'Inter-UI-SemiBold',
|
fontFamily: 'Inter-SemiBold',
|
||||||
fontSize: 30,
|
fontSize: 30,
|
||||||
margin: 16,
|
margin: 16,
|
||||||
},
|
},
|
||||||
@@ -34,7 +34,7 @@ const channelPageStyle = StyleSheet.create({
|
|||||||
padding: 24,
|
padding: 24,
|
||||||
},
|
},
|
||||||
infoText: {
|
infoText: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
},
|
},
|
||||||
@@ -62,7 +62,7 @@ const channelPageStyle = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
channelName: {
|
channelName: {
|
||||||
color: Colors.White,
|
color: Colors.White,
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
padding: 2,
|
padding: 2,
|
||||||
backgroundColor: '#000000aa',
|
backgroundColor: '#000000aa',
|
||||||
@@ -98,7 +98,7 @@ const channelPageStyle = StyleSheet.create({
|
|||||||
justifyContent: 'flex-end',
|
justifyContent: 'flex-end',
|
||||||
},
|
},
|
||||||
tabTitle: {
|
tabTitle: {
|
||||||
fontFamily: 'Inter-UI-SemiBold',
|
fontFamily: 'Inter-SemiBold',
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: Colors.White,
|
color: Colors.White,
|
||||||
},
|
},
|
||||||
@@ -131,12 +131,12 @@ const channelPageStyle = StyleSheet.create({
|
|||||||
padding: 24,
|
padding: 24,
|
||||||
},
|
},
|
||||||
aboutTitle: {
|
aboutTitle: {
|
||||||
fontFamily: 'Inter-UI-SemiBold',
|
fontFamily: 'Inter-SemiBold',
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
lineHeight: 24,
|
lineHeight: 24,
|
||||||
},
|
},
|
||||||
aboutText: {
|
aboutText: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
lineHeight: 24,
|
lineHeight: 24,
|
||||||
},
|
},
|
||||||
@@ -182,7 +182,7 @@ const channelPageStyle = StyleSheet.create({
|
|||||||
marginRight: 8,
|
marginRight: 8,
|
||||||
},
|
},
|
||||||
followerCount: {
|
followerCount: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: Colors.White,
|
color: Colors.White,
|
||||||
marginTop: 2,
|
marginTop: 2,
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ const channelSelectorStyle = StyleSheet.create({
|
|||||||
flex: 1,
|
flex: 1,
|
||||||
},
|
},
|
||||||
channelPicker: {
|
channelPicker: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
height: 52,
|
height: 52,
|
||||||
width: '100%',
|
width: '100%',
|
||||||
},
|
},
|
||||||
channelPickerItem: {
|
channelPickerItem: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
},
|
},
|
||||||
bidRow: {
|
bidRow: {
|
||||||
@@ -21,7 +21,7 @@ const channelSelectorStyle = StyleSheet.create({
|
|||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
label: {
|
label: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
},
|
},
|
||||||
balance: {
|
balance: {
|
||||||
@@ -30,24 +30,24 @@ const channelSelectorStyle = StyleSheet.create({
|
|||||||
marginLeft: 24,
|
marginLeft: 24,
|
||||||
},
|
},
|
||||||
balanceText: {
|
balanceText: {
|
||||||
fontFamily: 'Inter-UI-SemiBold',
|
fontFamily: 'Inter-SemiBold',
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
marginLeft: 4,
|
marginLeft: 4,
|
||||||
},
|
},
|
||||||
channelNameInput: {
|
channelNameInput: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
paddingLeft: 20,
|
paddingLeft: 20,
|
||||||
},
|
},
|
||||||
bidAmountInput: {
|
bidAmountInput: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
marginLeft: 16,
|
marginLeft: 16,
|
||||||
textAlign: 'right',
|
textAlign: 'right',
|
||||||
width: 80,
|
width: 80,
|
||||||
},
|
},
|
||||||
helpText: {
|
helpText: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
},
|
},
|
||||||
createChannelContainer: {
|
createChannelContainer: {
|
||||||
@@ -59,7 +59,7 @@ const channelSelectorStyle = StyleSheet.create({
|
|||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
left: 4,
|
left: 4,
|
||||||
top: 13,
|
top: 13,
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
},
|
},
|
||||||
buttonContainer: {
|
buttonContainer: {
|
||||||
@@ -80,7 +80,7 @@ const channelSelectorStyle = StyleSheet.create({
|
|||||||
backgroundColor: Colors.NextLbryGreen,
|
backgroundColor: Colors.NextLbryGreen,
|
||||||
},
|
},
|
||||||
inlineError: {
|
inlineError: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-Regular',
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: Colors.Red,
|
color: Colors.Red,
|
||||||
marginTop: 2,
|
marginTop: 2,
|
||||||
|
|||||||
Loaded 100 of 132 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user