Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
817fdf38a6 | ||
|
|
e137e8f76c | ||
|
|
ab84327659 |
No files matched your search
@@ -10,7 +10,6 @@
|
||||
"__": true
|
||||
},
|
||||
"rules": {
|
||||
"no-console": 2,
|
||||
"no-multi-spaces": 0,
|
||||
"new-cap": 0,
|
||||
"prefer-promise-reject-errors": 0,
|
||||
|
||||
+1
-63
@@ -1,66 +1,4 @@
|
||||
# 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/
|
||||
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
|
||||
.vagrant
|
||||
android/app/build/*
|
||||
android/bin
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
[submodule "android"]
|
||||
path = android
|
||||
url = https://github.com/lbryio/lbry-android
|
||||
@@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017-2020 LBRY Inc
|
||||
Copyright (c) 2017-2019 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:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# LBRY React Native
|
||||
# LBRY Android
|
||||
[](https://ci.lbry.tech/lbry/lbry-android/commits/master)
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
<img src="https://spee.ch/8/lbry-android.png" alt="LBRY Android Screenshot" width="384px" />
|
||||
|
||||
@@ -12,41 +12,10 @@ The minimum supported Android version is 5.0 Lollipop. There are two ways to ins
|
||||
1. Direct APK install available at [http://build.lbry.io/android/latest.apk](http://build.lbry.io/android/latest.apk). You will need to enable installation from third-party sources on your device in order to install from this source.
|
||||
|
||||
## Usage
|
||||
The app can be launched by opening **LBRY** from the device's app drawer or via the shortcut on the home screen if that was created upon installation.
|
||||
The app can be launched by opening **LBRY Browser** from the device's app drawer or via the shortcut on the home screen if that was created upon installation.
|
||||
|
||||
## Running from Source
|
||||
### 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.
|
||||
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.
|
||||
|
||||
## Contributing
|
||||
Contributions to this project are welcome, encouraged, and compensated. For more details, see https://lbry.io/faq/contributing
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
/**
|
||||
* @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 />);
|
||||
});
|
||||
-1
Submodule android deleted from b7b6c05bd3.
@@ -1,2 +0,0 @@
|
||||
#!/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,7 +1,3 @@
|
||||
if (__DEV__) {
|
||||
import('./reactotron').then(() => console.log('Reactotron Configured'));
|
||||
}
|
||||
|
||||
import LBRYApp from './src/index';
|
||||
|
||||
export default LBRYApp;
|
||||
@@ -1,53 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,24 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,782 +0,0 @@
|
||||
// !$*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 */;
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,129 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,15 +0,0 @@
|
||||
/**
|
||||
* 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
|
||||
@@ -1,42 +0,0 @@
|
||||
/**
|
||||
* 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
|
||||
@@ -1,42 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,38 +0,0 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,16 +0,0 @@
|
||||
/**
|
||||
* 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]));
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,72 +0,0 @@
|
||||
/**
|
||||
* 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
@@ -1,53 +0,0 @@
|
||||
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
|
||||
@@ -1,308 +0,0 @@
|
||||
{
|
||||
"Please wait while we get some things ready...": "Please wait while we get some things ready...",
|
||||
"Welcome to LBRY.": "Welcome to LBRY.",
|
||||
"LBRY is a community-controlled content platform where you can find and publish videos, music, books, and more.": "LBRY is a community-controlled content platform where you can find and publish videos, music, books, and more.",
|
||||
"Continue": "Continue",
|
||||
"Setup account": "Setup account",
|
||||
"A lbry.tv account allows you to earn rewards, backup your wallet, and keep everything in sync.": "A lbry.tv account allows you to earn rewards, backup your wallet, and keep everything in sync.",
|
||||
"This information is disclosed only to LBRY, Inc. and not to the LBRY network.": "This information is disclosed only to LBRY, Inc. and not to the LBRY network.",
|
||||
"No, thanks": "No, thanks",
|
||||
"Use LBRY": "Use LBRY",
|
||||
"Are you sure?": "Are you sure?",
|
||||
"Without an account, you will not receive rewards, sync and backup services, or security updates.": "Without an account, you will not receive rewards, sync and backup services, or security updates.",
|
||||
"I understand that by uninstalling LBRY I will lose any balances or published content with no recovery option if it is not backed up manually (see wallet page)": "I understand that by uninstalling LBRY I will lose any balances or published content with no recovery option if it is not backed up manually (see wallet page)",
|
||||
"Starting up": "Starting up",
|
||||
"Connecting": "Connecting",
|
||||
"Testing network": "Testing network",
|
||||
"Waiting for name resolution": "Waiting for name resolution",
|
||||
"Search movies, music, and more": "Search movies, music, and more",
|
||||
"Your Tags": "Your Tags",
|
||||
"Trending": "Trending",
|
||||
"Customize": "Customize",
|
||||
"Sign In": "Sign In",
|
||||
"SIGN IN": "SIGN IN",
|
||||
"Find content": "Find content",
|
||||
"Subscriptions": "Subscriptions",
|
||||
"All Content": "All Content",
|
||||
"Your content": "Your content",
|
||||
"Channels": "Channels",
|
||||
"Library": "Library",
|
||||
"Publishes": "Publishes",
|
||||
"New Publish": "New Publish",
|
||||
"Wallet": "Wallet",
|
||||
"Rewards": "Rewards",
|
||||
"Settings": "Settings",
|
||||
"About": "About",
|
||||
"All tags you follow": "All tags you follow",
|
||||
"More tags you follow": "More tags you follow",
|
||||
"FREE": "FREE",
|
||||
"more": "more",
|
||||
"You have not created a channel.\nStart now by creating a new channel!": "You have not created a channel.\nStart now by creating a new channel!",
|
||||
"Create a channel": "Create a channel",
|
||||
"CONTENT": "CONTENT",
|
||||
"ABOUT": "ABOUT",
|
||||
"Follow": "Follow",
|
||||
"No content to display at this time. Please check back later.": "No content to display at this time. Please check back later.",
|
||||
"New": "New",
|
||||
"Share": "Share",
|
||||
"Tip": "Tip",
|
||||
"Report": "Report",
|
||||
"Fetching cost info...": "Fetching cost info...",
|
||||
"Play": "Play",
|
||||
"Connecting...": "Connecting...",
|
||||
"Related Content": "Related Content",
|
||||
"Loading...": "Loading...",
|
||||
"Content Freedom": "Content Freedom",
|
||||
"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.",
|
||||
"What is LBRY?": "What is LBRY?",
|
||||
"Android App Basics": "Android App Basics",
|
||||
"Frequently Asked Questions": "Frequently Asked Questions",
|
||||
"Get Social": "Get Social",
|
||||
"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.",
|
||||
"App info": "App info",
|
||||
"App version": "App version",
|
||||
"LBRY SDK": "LBRY SDK",
|
||||
"Platform": "Platform",
|
||||
"Installation ID": "Installation ID",
|
||||
"Logs": "Logs",
|
||||
"Send log": "Send log",
|
||||
"Account Recommended": "Account Recommended",
|
||||
"Without an account, you assume all responsibility for securing your wallet and LBRY data.": "Without an account, you assume all responsibility for securing your wallet and LBRY data.",
|
||||
"Skip Account": "Skip Account",
|
||||
"Sign Up": "Sign Up",
|
||||
"Blockchain Sync": "Blockchain Sync",
|
||||
"Catching up with the blockchain (%progress%%)": "Catching up with the blockchain (%progress%%)",
|
||||
"Network Loading": "Network Loading",
|
||||
"Initializing LBRY service": "Initializing LBRY service",
|
||||
"%amount% available credits": "%amount% available credits",
|
||||
"LBRY credits allow you to purchase content, publish content, and influence the network.": "LBRY credits allow you to purchase content, publish content, and influence the network.",
|
||||
"You get credits for free for providing an email address and taking other basic actions.": "You get credits for free for providing an email address and taking other basic actions.",
|
||||
"Learn more": "Learn more",
|
||||
"Not interested": "Not interested",
|
||||
"Get started": "Get started",
|
||||
"Get %amount% free credits after creating an account.": "Get %amount% free credits after creating an account.",
|
||||
"Balance": "Balance",
|
||||
"You currently have": "You currently have",
|
||||
"Receive Credits": "Receive Credits",
|
||||
"Use this wallet address to receive credits sent by another user (or yourself).": "Use this wallet address to receive credits sent by another user (or yourself).",
|
||||
"Get new address": "Get new address",
|
||||
"You can generate a new address at any time, and any previous addresses will continue to work. Using multiple addresses can be helpful for keeping track of incoming payments from multiple sources.": "You can generate a new address at any time, and any previous addresses will continue to work. Using multiple addresses can be helpful for keeping track of incoming payments from multiple sources.",
|
||||
"Send Credits": "Send Credits",
|
||||
"Recipient address": "Recipient address",
|
||||
"Amount": "Amount",
|
||||
"Send": "Send",
|
||||
"Recent Transactions": "Recent Transactions",
|
||||
"View All": "View All",
|
||||
"Looks like you don't have any recent transactions.": "Looks like you don't have any recent transactions.",
|
||||
"Wallet Sync": "Wallet Sync",
|
||||
"Sync status": "Sync status",
|
||||
"Off": "Off",
|
||||
"Manual backup": "Manual backup",
|
||||
"Sync FAQ": "Sync FAQ",
|
||||
"Fetching transactions...": "Fetching transactions...",
|
||||
"Anonymous": "Anonymous",
|
||||
"Delete": "Delete",
|
||||
"Title": "Title",
|
||||
"Channel": "Channel",
|
||||
"Deposit": "Deposit",
|
||||
"This LBC remains yours. It is a deposit to reserve the name and can be undone at any time.": "This LBC remains yours. It is a deposit to reserve the name and can be undone at any time.",
|
||||
"Show optional fields": "Show optional fields",
|
||||
"Cancel": "Cancel",
|
||||
"Create": "Create",
|
||||
"Channel creation requires credits.": "Channel creation requires credits.",
|
||||
"Tap here to get some for free.": "Tap here to get some for free.",
|
||||
"%balance% available": "%balance% available",
|
||||
"Bal: %balance%": "Bal: %balance%",
|
||||
"Send a tip": "Send a tip",
|
||||
"Record": "Record",
|
||||
"Take a photo": "Take a photo",
|
||||
"Upload a file": "Upload a file",
|
||||
"Please wait while we load your videos...": "Please wait while we load your videos...",
|
||||
"Description": "Description",
|
||||
"Tags": "Tags",
|
||||
"Price": "Price",
|
||||
"Your content will be free. Press the toggle to set a price.": "Your content will be free. Press the toggle to set a price.",
|
||||
"Content address": "Content address",
|
||||
"The address where people can find your content (ex. lbry://myvideo). ": "The address where people can find your content (ex. lbry://myvideo). ",
|
||||
"This LBC remains yours and the deposit can be undone at any time.": "This LBC remains yours and the deposit can be undone at any time.",
|
||||
"Show extra fields": "Show extra fields",
|
||||
"Publish": "Publish",
|
||||
"Publishing requires credits.": "Publishing requires credits.",
|
||||
"Search for more tags": "Search for more tags",
|
||||
"Mature tags": "Mature tags",
|
||||
"Publish anonymously": "Publish anonymously",
|
||||
"Create a channel...": "Create a channel...",
|
||||
"Uploading thumbnail...": "Uploading thumbnail...",
|
||||
"Channel name": "Channel name",
|
||||
"Deposit cannot be higher than your balance": "Deposit cannot be higher than your balance",
|
||||
"There are no results to display for \"%query%\". Please try a different search term.": "There are no results to display for \"%query%\". Please try a different search term.",
|
||||
"Nothing here. Publish something!": "Nothing here. Publish something!",
|
||||
"Explore content for this tag": "Explore content for this tag",
|
||||
"URL does not include name.": "URL does not include name.",
|
||||
"Loading decentralized data...": "Loading decentralized data...",
|
||||
"View": "View",
|
||||
"Additional Options": "Additional Options",
|
||||
"Language": "Language",
|
||||
"English": "English",
|
||||
"Chinese": "Chinese",
|
||||
"French": "French",
|
||||
"German": "German",
|
||||
"Japanese": "Japanese",
|
||||
"Russian": "Russian",
|
||||
"Spanish": "Spanish",
|
||||
"Indonesian": "Indonesian",
|
||||
"Italian": "Italian",
|
||||
"Dutch": "Dutch",
|
||||
"Turkish": "Turkish",
|
||||
"Polish": "Polish",
|
||||
"Malay": "Malay",
|
||||
"Portuguese": "Portuguese",
|
||||
"Vietnamese": "Vietnamese",
|
||||
"Thai": "Thai",
|
||||
"Arabic": "Arabic",
|
||||
"Czech": "Czech",
|
||||
"Croatian": "Croatian",
|
||||
"Cambodian": "Cambodian",
|
||||
"Korean": "Korean",
|
||||
"Norwegian": "Norwegian",
|
||||
"Romanian": "Romanian",
|
||||
"Hindi": "Hindi",
|
||||
"Greek": "Greek",
|
||||
"License": "License",
|
||||
"None": "None",
|
||||
"Public Domain": "Public Domain",
|
||||
"Copyrighted...": "Copyrighted...",
|
||||
"Other...": "Other...",
|
||||
"Hide extra fields": "Hide extra fields",
|
||||
"Download": "Download",
|
||||
"%progress%% complete": "%progress%% complete",
|
||||
"Email": "Email",
|
||||
"Please provide an email address.": "Please provide an email address.",
|
||||
"An email has been sent to": "An email has been sent to",
|
||||
"Please click the link in the message to complete signing in.": "Please click the link in the message to complete signing in.",
|
||||
"Resend": "Resend",
|
||||
"Edit": "Edit",
|
||||
"Your email address was successfully verified.": "Your email address was successfully verified.",
|
||||
"password": "password",
|
||||
"Please enter a password to secure your account and wallet.": "Please enter a password to secure your account and wallet.",
|
||||
"Retrieving your account information...": "Retrieving your account information...",
|
||||
"Please enter the password you used to secure your wallet.": "Please enter the password you used to secure your wallet.",
|
||||
"Note: for wallet security purposes, LBRY is unable to reset your password.": "Note: for wallet security purposes, LBRY is unable to reset your password.",
|
||||
"On": "On",
|
||||
"Connected email": "Connected email",
|
||||
"Address copied": "Address copied",
|
||||
"Unlocking account": "Unlocking account",
|
||||
"Decrypting wallet": "Decrypting wallet",
|
||||
"used": "used",
|
||||
"Stats": "Stats",
|
||||
"Channels you follow": "Channels you follow",
|
||||
"Suggested": "Suggested",
|
||||
"ALL": "ALL",
|
||||
"Customize your tags": "Customize your tags",
|
||||
"Done": "Done",
|
||||
"Unfollow": "Unfollow",
|
||||
"This content is Not Safe For Work. To view adult content, please change your Settings.": "This content is Not Safe For Work. To view adult content, please change your Settings.",
|
||||
"No views": "No views",
|
||||
"%view% views": "%view% views",
|
||||
"Content": "Content",
|
||||
"Enable background media playback": "Enable background media playback",
|
||||
"Enable this option to play audio or video in the background when the app is suspended.": "Enable this option to play audio or video in the background when the app is suspended.",
|
||||
"Choose language": "Choose language",
|
||||
"Use device language": "Use device language",
|
||||
"Gujarati": "Gujarati",
|
||||
"Show mature content": "Show mature content",
|
||||
"Notifications": "Notifications",
|
||||
"Choose the notifications you would like to receive.": "Choose the notifications you would like to receive.",
|
||||
"Content Interests": "Content Interests",
|
||||
"Search": "Search",
|
||||
"Show URL suggestions": "Show URL suggestions",
|
||||
"Other": "Other",
|
||||
"Keep the SDK background service running after closing the app": "Keep the SDK background service running after closing the app",
|
||||
"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.",
|
||||
"There's nothing here yet.\nPlease check back later.": "There's nothing here yet.\nPlease check back later.",
|
||||
"%follower% followers": "%follower% followers",
|
||||
"Are you sure you want to tip %amount% credits": "Are you sure you want to tip %amount% credits",
|
||||
"Send tip": "Send tip",
|
||||
"No": "No",
|
||||
"Yes": "Yes",
|
||||
"History": "History",
|
||||
"/wallet": "/wallet",
|
||||
"Are you sure you want to tip %amount% credit": "Are you sure you want to tip %amount% credit",
|
||||
"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.",
|
||||
"Never ask again": "Never ask again",
|
||||
"Maybe later": "Maybe later",
|
||||
"Rate app": "Rate app",
|
||||
"This will appear as a tip for %content%, which will boost its ability to be discovered while active.": "This will appear as a tip for %content%, which will boost its ability to be discovered while active.",
|
||||
"Learn more.": "Learn more.",
|
||||
"Send a tip to %channel%": "Send a tip to %channel%",
|
||||
"The transaction URL could not be opened": "The transaction URL could not be opened",
|
||||
"Show All": "Show All",
|
||||
"Fetching rewards...": "Fetching rewards...",
|
||||
"Custom Code": "Custom Code",
|
||||
"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",
|
||||
"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!",
|
||||
"%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
+1874
-3619
File diff suppressed because it is too large.
Load diff
+71
-88
@@ -1,90 +1,73 @@
|
||||
{
|
||||
"name": "LBRYApp",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"android": "react-native run-android",
|
||||
"ios": "react-native run-ios",
|
||||
"start": "react-native start",
|
||||
"test": "jest",
|
||||
"lint": "eslint .",
|
||||
"format": "prettier 'src/**/*.{js,json}' --write",
|
||||
"precommit": "lint-staged"
|
||||
},
|
||||
"dependencies": {
|
||||
"base-64": "^0.1.0",
|
||||
"@expo/vector-icons": "^8.1.0",
|
||||
"gfycat-style-urls": "^1.0.3",
|
||||
"lbry-redux": "lbryio/lbry-redux#f6e99498d2bc5b3f07e1e2b6f668a1a48de35047",
|
||||
"lbryinc": "lbryio/lbryinc#1fc104c2d29d1d3975234c3606e848eaa28e1b6e",
|
||||
"lodash": ">=4.17.11",
|
||||
"merge": ">=1.2.1",
|
||||
"moment": "^2.22.1",
|
||||
"react": "16.9.0",
|
||||
"react-native": "0.61.5",
|
||||
"@react-native-community/async-storage": "^1.5.1",
|
||||
"@react-native-community/masked-view": "^0.1.5",
|
||||
"react-native-camera": "^3.15.0",
|
||||
"react-native-country-picker-modal": "^1.10.0",
|
||||
"react-native-exception-handler": "2.10.8",
|
||||
"react-native-fast-image": "^7.0.2",
|
||||
"react-native-fs": "^2.16.6",
|
||||
"react-native-gesture-handler": "1.5.2",
|
||||
"react-native-image-zoom-viewer": "^2.2.5",
|
||||
"react-native-password-strength-meter": "^0.0.2",
|
||||
"react-native-phone-input": "lbryio/react-native-phone-input",
|
||||
"react-native-progress-circle": "2.1.0",
|
||||
"react-native-reanimated": "1.4.0",
|
||||
"react-native-safe-area-context": "^0.6.2",
|
||||
"react-native-screens": "^2.0.0",
|
||||
"react-native-snackbar": "2.0.4",
|
||||
"react-native-super-grid": "^3.0.4",
|
||||
"react-native-vector-icons": "^6.6.0",
|
||||
"react-native-video": "lbryio/react-native-video#7992ff945872f9bd00a3736d9ff1318f343abf47",
|
||||
"react-native-webview": "^8.0.2",
|
||||
"react-navigation": "^4.0.10",
|
||||
"react-navigation-drawer": "2.3.3",
|
||||
"react-navigation-redux-helpers": "^3.0.2",
|
||||
"react-navigation-tabs": "^2.7.0",
|
||||
"react-navigation-stack": "^1.10.3",
|
||||
"react-redux": "^5.0.3",
|
||||
"redux": "^4.0.4",
|
||||
"redux-persist": "^6.0.0",
|
||||
"redux-persist-filesystem-storage": "^2.1.0",
|
||||
"redux-persist-transform-compress": "^4.2.0",
|
||||
"redux-persist-transform-filter": "0.0.18",
|
||||
"redux-thunk": "^2.3.0",
|
||||
"rn-fetch-blob": "0.12.0",
|
||||
"seedrandom": "3.0.3",
|
||||
"showdown": "1.9.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.6.2",
|
||||
"babel-eslint": "10.0.2",
|
||||
"@babel/plugin-proposal-object-rest-spread": "^7.5.4",
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"babel-preset-stage-2": "^6.18.0",
|
||||
"babel-plugin-module-resolver": "^3.1.1",
|
||||
"eslint": "^6.5.1",
|
||||
"eslint-config-standard": "^12.0.0",
|
||||
"eslint-config-standard-jsx": "^6.0.2",
|
||||
"eslint-plugin-flowtype": "^2.46.1",
|
||||
"eslint-plugin-import": "^2.17.2",
|
||||
"eslint-plugin-node": "^8.0.1",
|
||||
"eslint-plugin-promise": "^4.1.1",
|
||||
"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"
|
||||
}
|
||||
"name": "LBRYApp",
|
||||
"version": "0.0.1",
|
||||
"private": "true",
|
||||
"scripts": {
|
||||
"start": "node node_modules/react-native/local-cli/cli.js start",
|
||||
"devtools": "react-devtools",
|
||||
"format": "prettier 'src/**/*.{js,json}' --write",
|
||||
"precommit": "lint-staged"
|
||||
},
|
||||
"dependencies": {
|
||||
"base-64": "^0.1.0",
|
||||
"@expo/vector-icons": "^8.1.0",
|
||||
"gfycat-style-urls": "^1.0.3",
|
||||
"lbry-redux": "lbryio/lbry-redux#9b11cfed62af7f0f8eb6fa3c88a1f8d2cce46afc",
|
||||
"lbryinc": "lbryio/lbryinc#9ffb883cc11e36d55a729c65b70c405a4a56d35e",
|
||||
"lodash": ">=4.17.11",
|
||||
"merge": ">=1.2.1",
|
||||
"moment": "^2.22.1",
|
||||
"react": "16.8.6",
|
||||
"react-native": "0.59.10",
|
||||
"@react-native-community/async-storage": "^1.5.1",
|
||||
"react-native-camera": "^2.11.1",
|
||||
"react-native-country-picker-modal": "^0.6.2",
|
||||
"react-native-exception-handler": "2.9.0",
|
||||
"react-native-fast-image": "^6.1.1",
|
||||
"react-native-fs": "^2.13.3",
|
||||
"react-native-gesture-handler": "1.3.0",
|
||||
"react-native-image-zoom-viewer": "^2.2.5",
|
||||
"react-native-password-strength-meter": "^0.0.2",
|
||||
"react-native-phone-input": "lbryio/react-native-phone-input",
|
||||
"react-native-reanimated": "1.2.0",
|
||||
"react-native-super-grid": "^3.0.4",
|
||||
"react-native-vector-icons": "^6.6.0",
|
||||
"react-native-video": "lbryio/react-native-video#exoplayer-lbry-android",
|
||||
"react-navigation": "^3.11.0",
|
||||
"react-navigation-drawer": "^1.4.0",
|
||||
"react-navigation-redux-helpers": "^3.0.2",
|
||||
"react-navigation-stack": "^1.8.1",
|
||||
"react-redux": "^5.0.3",
|
||||
"redux": "^4.0.4",
|
||||
"redux-persist": "^5.10.0",
|
||||
"redux-persist-filesystem-storage": "^1.3.2",
|
||||
"redux-persist-transform-compress": "^4.2.0",
|
||||
"redux-persist-transform-filter": "0.0.18",
|
||||
"redux-thunk": "^2.3.0",
|
||||
"rn-fetch-blob": "0.10.15",
|
||||
"seedrandom": "3.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.5.4",
|
||||
"babel-eslint": "10.0.2",
|
||||
"@babel/plugin-proposal-object-rest-spread": "^7.5.4",
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"babel-preset-stage-2": "^6.18.0",
|
||||
"babel-plugin-module-resolver": "^3.1.1",
|
||||
"eslint": "^5.16.0",
|
||||
"eslint-config-standard": "^12.0.0",
|
||||
"eslint-config-standard-jsx": "^6.0.2",
|
||||
"eslint-plugin-flowtype": "^2.46.1",
|
||||
"eslint-plugin-import": "^2.17.2",
|
||||
"eslint-plugin-node": "^8.0.1",
|
||||
"eslint-plugin-promise": "^4.1.1",
|
||||
"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.55.0",
|
||||
"prettier": "^1.11.1",
|
||||
"react-devtools": "^3.6.3"
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
import AsyncStorage from '@react-native-community/async-storage';
|
||||
import Reactotron from 'reactotron-react-native';
|
||||
import { reactotronRedux } from 'reactotron-redux';
|
||||
|
||||
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
|
||||
.configure() // controls connection & communication settings
|
||||
.useReactNative() // add all built-in react native plugins
|
||||
.use(reactotronRedux())
|
||||
.connect();
|
||||
|
||||
export default reactotron;
|
||||
+37
-107
@@ -5,9 +5,7 @@ import DiscoverPage from 'page/discover';
|
||||
import DownloadsPage from 'page/downloads';
|
||||
import DrawerContent from 'component/drawerContent';
|
||||
import FilePage from 'page/file';
|
||||
import LiteFilePage from 'page/liteFile';
|
||||
import FirstRunScreen from 'page/firstRun';
|
||||
import InvitesPage from 'page/invites';
|
||||
import PublishPage from 'page/publish';
|
||||
import PublishesPage from 'page/publishes';
|
||||
import RewardsPage from 'page/rewards';
|
||||
@@ -20,7 +18,7 @@ import SubscriptionsPage from 'page/subscriptions';
|
||||
import TransactionHistoryPage from 'page/transactionHistory';
|
||||
import VerificationScreen from 'page/verification';
|
||||
import WalletPage from 'page/wallet';
|
||||
import { NavigationActions, StackActions } from 'react-navigation';
|
||||
import { NavigationActions } from 'react-navigation';
|
||||
import { createDrawerNavigator } from 'react-navigation-drawer';
|
||||
import { createStackNavigator } from 'react-navigation-stack';
|
||||
import {
|
||||
@@ -31,7 +29,6 @@ import {
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
AppState,
|
||||
Alert,
|
||||
BackHandler,
|
||||
DeviceEventEmitter,
|
||||
Linking,
|
||||
@@ -41,15 +38,7 @@ import {
|
||||
ToastAndroid,
|
||||
} from 'react-native';
|
||||
import { selectDrawerStack } from 'redux/selectors/drawer';
|
||||
import {
|
||||
ACTIONS,
|
||||
SETTINGS,
|
||||
doDismissToast,
|
||||
doPopulateSharedUserState,
|
||||
doPreferenceGet,
|
||||
doToast,
|
||||
selectToast,
|
||||
} from 'lbry-redux';
|
||||
import { SETTINGS, doDismissToast, doPopulateSharedUserState, doPreferenceGet, doToast, selectToast } from 'lbry-redux';
|
||||
import {
|
||||
Lbryio,
|
||||
doGetSync,
|
||||
@@ -62,7 +51,6 @@ import {
|
||||
selectHashChanged,
|
||||
selectUser,
|
||||
} from 'lbryinc';
|
||||
import { doStartDownload, doUpdateDownload, doCompleteDownload } from 'redux/actions/file';
|
||||
import { makeSelectClientSetting, selectFullscreenMode } from 'redux/selectors/settings';
|
||||
import { decode as atob } from 'base-64';
|
||||
import { dispatchNavigateBack, dispatchNavigateToUri, transformUrl } from 'utils/helper';
|
||||
@@ -74,19 +62,27 @@ import NavigationButton from 'component/navigationButton';
|
||||
import discoverStyle from 'styles/discover';
|
||||
import searchStyle from 'styles/search';
|
||||
import SearchRightHeaderIcon from 'component/searchRightHeaderIcon';
|
||||
import Snackbar from 'react-native-snackbar';
|
||||
|
||||
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(
|
||||
{
|
||||
Subscriptions: {
|
||||
screen: SubscriptionsPage,
|
||||
navigationOptions: {
|
||||
title: 'Following',
|
||||
Discover: {
|
||||
screen: DiscoverPage,
|
||||
navigationOptions: ({ navigation }) => ({
|
||||
title: 'Explore',
|
||||
header: null,
|
||||
drawerIcon: ({ tintColor }) => <Icon name="heart" solid size={drawerIconSize} style={{ color: tintColor }} />,
|
||||
},
|
||||
}),
|
||||
},
|
||||
File: {
|
||||
screen: FilePage,
|
||||
@@ -110,7 +106,7 @@ const discoverStack = createStackNavigator(
|
||||
{
|
||||
headerMode: 'screen',
|
||||
transitionConfig: () => ({ screenInterpolator: () => null }),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
discoverStack.navigationOptions = ({ navigation }) => {
|
||||
@@ -144,7 +140,7 @@ const walletStack = createStackNavigator(
|
||||
{
|
||||
headerMode: 'screen',
|
||||
transitionConfig: () => ({ screenInterpolator: () => null }),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const drawerIconSize = 18;
|
||||
@@ -153,17 +149,10 @@ const drawer = createDrawerNavigator(
|
||||
DiscoverStack: {
|
||||
screen: discoverStack,
|
||||
navigationOptions: {
|
||||
title: 'Following',
|
||||
title: 'Explore',
|
||||
drawerIcon: ({ tintColor }) => <Icon name="home" size={drawerIconSize} style={{ color: tintColor }} />,
|
||||
},
|
||||
},
|
||||
Discover: {
|
||||
screen: DiscoverPage,
|
||||
navigationOptions: ({ navigation }) => ({
|
||||
title: 'Your Tags',
|
||||
header: null,
|
||||
}),
|
||||
},
|
||||
Trending: {
|
||||
screen: TrendingPage,
|
||||
navigationOptions: {
|
||||
@@ -171,6 +160,13 @@ const drawer = createDrawerNavigator(
|
||||
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: {
|
||||
screen: walletStack,
|
||||
navigationOptions: {
|
||||
@@ -204,12 +200,6 @@ const drawer = createDrawerNavigator(
|
||||
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: {
|
||||
screen: DownloadsPage,
|
||||
navigationOptions: {
|
||||
@@ -233,18 +223,17 @@ const drawer = createDrawerNavigator(
|
||||
},
|
||||
},
|
||||
{
|
||||
drawerWidth: 299,
|
||||
drawerWidth: 300,
|
||||
drawerBackgroundColor: 'transparent',
|
||||
headerMode: 'none',
|
||||
backBehavior: 'none',
|
||||
unmountInactiveRoutes: true,
|
||||
contentComponent: DrawerContent,
|
||||
overlayColor: 'rgba(0, 0, 0, 0.7)',
|
||||
contentOptions: {
|
||||
activeTintColor: Colors.LbryGreen,
|
||||
labelStyle: discoverStyle.menuText,
|
||||
},
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const mainStackNavigator = new createStackNavigator(
|
||||
@@ -270,16 +259,10 @@ const mainStackNavigator = new createStackNavigator(
|
||||
drawerLockMode: 'locked-closed',
|
||||
},
|
||||
},
|
||||
LiteFile: {
|
||||
screen: LiteFilePage,
|
||||
navigationOptions: {
|
||||
drawerLockMode: 'locked-closed',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
headerMode: 'none',
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
export const AppNavigator = mainStackNavigator;
|
||||
@@ -312,15 +295,13 @@ class AppWithNavigationState extends React.Component {
|
||||
'hardwareBackPress',
|
||||
function() {
|
||||
const { dispatch, nav, drawerStack } = this.props;
|
||||
console.log(nav);
|
||||
|
||||
if (drawerStack.length > 1) {
|
||||
dispatchNavigateBack(dispatch, nav, drawerStack);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}.bind(this),
|
||||
}.bind(this)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -329,11 +310,6 @@ class AppWithNavigationState extends React.Component {
|
||||
this.emailVerifyCheckInterval = setInterval(() => this.checkEmailVerification(), 5000);
|
||||
Linking.addEventListener('url', this._handleUrl);
|
||||
|
||||
DeviceEventEmitter.addListener('onDownloadAborted', this.handleDownloadAborted);
|
||||
DeviceEventEmitter.addListener('onDownloadStarted', this.handleDownloadStarted);
|
||||
DeviceEventEmitter.addListener('onDownloadUpdated', this.handleDownloadUpdated);
|
||||
DeviceEventEmitter.addListener('onDownloadCompleted', this.handleDownloadCompleted);
|
||||
|
||||
// call /sync/get with interval
|
||||
this.syncGetInterval = setInterval(() => {
|
||||
this.setState({ syncHashChanged: false }); // reset local state
|
||||
@@ -364,50 +340,11 @@ class AppWithNavigationState extends React.Component {
|
||||
},
|
||||
error => {
|
||||
/* failed */
|
||||
},
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
handleDownloadStarted = evt => {
|
||||
const { dispatch } = this.props;
|
||||
const { uri, outpoint, fileInfo } = evt;
|
||||
dispatch(doStartDownload(uri, outpoint, fileInfo));
|
||||
};
|
||||
|
||||
handleDownloadUpdated = evt => {
|
||||
const { dispatch } = this.props;
|
||||
const { uri, outpoint, fileInfo, progress } = evt;
|
||||
dispatch(doUpdateDownload(uri, outpoint, fileInfo, progress));
|
||||
};
|
||||
|
||||
handleDownloadCompleted = evt => {
|
||||
const { dispatch } = this.props;
|
||||
const { uri, outpoint, fileInfo } = evt;
|
||||
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() {
|
||||
DeviceEventEmitter.removeListener('onDownloadAborted', this.handleDownloadAborted);
|
||||
DeviceEventEmitter.removeListener('onDownloadStarted', this.handleDownloadStarted);
|
||||
DeviceEventEmitter.removeListener('onDownloadUpdated', this.handleDownloadUpdated);
|
||||
DeviceEventEmitter.removeListener('onDownloadCompleted', this.handleDownloadCompleted);
|
||||
|
||||
AppState.removeEventListener('change', this._handleAppStateChange);
|
||||
BackHandler.removeEventListener('hardwareBackPress');
|
||||
Linking.removeEventListener('url', this._handleUrl);
|
||||
@@ -427,7 +364,7 @@ class AppWithNavigationState extends React.Component {
|
||||
this.setState({ verifyPending: false });
|
||||
|
||||
NativeModules.Firebase.track('email_verified', { email: user.primary_email });
|
||||
Snackbar.show({ title: __('Your email address was successfully verified.'), duration: Snackbar.LENGTH_LONG });
|
||||
ToastAndroid.show(__('Your email address was successfully verified.'), ToastAndroid.LONG);
|
||||
|
||||
// get user settings after email verification
|
||||
this.getUserSettings();
|
||||
@@ -444,7 +381,7 @@ class AppWithNavigationState extends React.Component {
|
||||
const { toast, emailToVerify, emailVerifyPending, emailVerifyErrorMessage, user } = nextProps;
|
||||
|
||||
if (toast) {
|
||||
const { message, isError } = toast;
|
||||
const { message } = toast;
|
||||
let currentDisplayType;
|
||||
if (!currentDisplayType && message) {
|
||||
// default to toast if no display type set and there is a message specified
|
||||
@@ -452,14 +389,7 @@ class AppWithNavigationState extends React.Component {
|
||||
}
|
||||
|
||||
if (currentDisplayType === 'toast') {
|
||||
const props = {
|
||||
title: message,
|
||||
duration: Snackbar.LENGTH_LONG,
|
||||
};
|
||||
if (isError) {
|
||||
props.backgroundColor = Colors.Red;
|
||||
}
|
||||
Snackbar.show(props);
|
||||
ToastAndroid.show(message, ToastAndroid.LONG);
|
||||
}
|
||||
|
||||
dispatch(doDismissToast());
|
||||
@@ -538,7 +468,7 @@ class AppWithNavigationState extends React.Component {
|
||||
try {
|
||||
verification = JSON.parse(atob(evt.url.substring(15)));
|
||||
} catch (error) {
|
||||
// console.log(error);
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
if (verification.token && verification.recaptcha) {
|
||||
@@ -554,7 +484,7 @@ class AppWithNavigationState extends React.Component {
|
||||
dispatch(
|
||||
doToast({
|
||||
message: 'Invalid Verification URI',
|
||||
}),
|
||||
})
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -51,7 +51,7 @@ export default class ChannelIconItem extends React.PureComponent {
|
||||
<TouchableOpacity style={channelIconStyle.container} onPress={onPress}>
|
||||
{isResolvingUri && (
|
||||
<View style={channelIconStyle.centered}>
|
||||
<ActivityIndicator size={'small'} color={Colors.NextLbryGreen} />
|
||||
<ActivityIndicator size={'small'} color={Colors.LbryGreen} />
|
||||
</View>
|
||||
)}
|
||||
<View
|
||||
|
||||
@@ -19,11 +19,11 @@ const select = state => ({
|
||||
const perform = dispatch => ({
|
||||
notify: data => dispatch(doToast(data)),
|
||||
createChannel: (name, amount) => dispatch(doCreateChannel(name, amount)),
|
||||
fetchChannelListMine: () => dispatch(doFetchChannelListMine(1, 99999, true)),
|
||||
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
||||
getSync: (password, callback) => dispatch(doGetSync(password, callback)),
|
||||
});
|
||||
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
perform
|
||||
)(ChannelSelector);
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { CLAIM_VALUES, formatCredits, isNameValid } from 'lbry-redux';
|
||||
import { CLAIM_VALUES, isNameValid } from 'lbry-redux';
|
||||
import { ActivityIndicator, NativeModules, Picker, Text, TextInput, TouchableOpacity, View } from 'react-native';
|
||||
import { logPublish } from 'utils/helper';
|
||||
import Button from 'component/button';
|
||||
@@ -14,7 +14,6 @@ export default class ChannelSelector extends React.PureComponent {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
creditsInputFocused: false,
|
||||
currentSelectedValue: Constants.ITEM_ANONYMOUS,
|
||||
newChannelName: '',
|
||||
newChannelBid: 0.1,
|
||||
@@ -36,14 +35,10 @@ export default class ChannelSelector extends React.PureComponent {
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
const { channels: prevChannels = [], channelName: prevChannelName } = this.props;
|
||||
const { channels = [], channelName } = nextProps;
|
||||
const { channels: prevChannels = [], channelName } = this.props;
|
||||
const { channels = [] } = nextProps;
|
||||
|
||||
if (channels && channels.length !== prevChannels.length && channelName !== this.state.currentSelectedValue) {
|
||||
this.setState({ currentSelectedValue: prevChannelName });
|
||||
}
|
||||
|
||||
if (channelName !== prevChannelName) {
|
||||
this.setState({ currentSelectedValue: channelName });
|
||||
}
|
||||
}
|
||||
@@ -193,11 +188,10 @@ export default class ChannelSelector extends React.PureComponent {
|
||||
|
||||
render() {
|
||||
const channel = this.state.addingChannel ? 'new' : this.props.channel;
|
||||
const { balance, enabled, fetchingChannels, channels = [], showAnonymous } = this.props;
|
||||
const pickerItems = (showAnonymous
|
||||
? [Constants.ITEM_ANONYMOUS, Constants.ITEM_CREATE_A_CHANNEL]
|
||||
: [Constants.ITEM_CREATE_A_CHANNEL]
|
||||
).concat(channels ? channels.map(ch => ch.name) : []);
|
||||
const { enabled, fetchingChannels, channels = [] } = this.props;
|
||||
const pickerItems = [Constants.ITEM_ANONYMOUS, Constants.ITEM_CREATE_A_CHANNEL].concat(
|
||||
channels ? channels.map(ch => ch.name) : []
|
||||
);
|
||||
|
||||
const {
|
||||
newChannelName,
|
||||
@@ -250,26 +244,18 @@ export default class ChannelSelector extends React.PureComponent {
|
||||
style={channelSelectorStyle.bidAmountInput}
|
||||
value={String(newChannelBid)}
|
||||
onChangeText={this.handleNewChannelBidChange}
|
||||
onFocus={() => this.setState({ creditsInputFocused: true })}
|
||||
onBlur={() => this.setState({ creditsInputFocused: false })}
|
||||
placeholder={'0.00'}
|
||||
keyboardType={'number-pad'}
|
||||
underlineColorAndroid={Colors.NextLbryGreen}
|
||||
/>
|
||||
<Text style={channelSelectorStyle.currency}>LBC</Text>
|
||||
<View style={channelSelectorStyle.balance}>
|
||||
{this.state.creditsInputFocused && <Icon name="coins" size={12} />}
|
||||
{this.state.creditsInputFocused && (
|
||||
<Text style={channelSelectorStyle.balanceText}>{formatCredits(parseFloat(balance), 1, true)}</Text>
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
<Text style={channelSelectorStyle.helpText}>
|
||||
{__('This LBC remains yours. It is a deposit to reserve the name and can be undone at any time.')}
|
||||
</Text>
|
||||
|
||||
<View style={channelSelectorStyle.buttonContainer}>
|
||||
{creatingChannel && <ActivityIndicator size={'small'} color={Colors.NextLbryGreen} />}
|
||||
{creatingChannel && <ActivityIndicator size={'small'} color={Colors.LbryGreen} />}
|
||||
{!creatingChannel && (
|
||||
<View style={channelSelectorStyle.buttons}>
|
||||
<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';
|
||||
|
||||
const select = state => ({
|
||||
showNsfwContent: selectShowNsfw(state),
|
||||
claimSearchByQuery: selectClaimSearchByQuery(state),
|
||||
lastPageReached: selectClaimSearchByQueryLastPageReached(state),
|
||||
loadingByQuery: selectFetchingClaimSearchByQuery(state),
|
||||
loading: selectFetchingClaimSearch(state),
|
||||
showNsfwContent: selectShowNsfw(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
@@ -25,5 +25,5 @@ const perform = dispatch => ({
|
||||
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
perform
|
||||
)(ClaimList);
|
||||
@@ -147,7 +147,7 @@ class ClaimList extends React.PureComponent {
|
||||
renderMorePlaceholder = () => {
|
||||
return (
|
||||
<TouchableOpacity style={discoverStyle.fileItemMore} onPress={this.onMorePressed}>
|
||||
<Text style={discoverStyle.moreText}>{__('more')}</Text>
|
||||
<Text style={discoverStyle.moreText}>more</Text>
|
||||
<Icon style={discoverStyle.moreIcon} name={'angle-double-down'} color={Colors.White} size={16} />
|
||||
</TouchableOpacity>
|
||||
);
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
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);
|
||||
@@ -1,180 +0,0 @@
|
||||
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;
|
||||
@@ -74,7 +74,7 @@ class CustomRewardCard extends React.PureComponent<Props> {
|
||||
/>
|
||||
<Button
|
||||
style={rewardStyle.redeemButton}
|
||||
text={__('Redeem')}
|
||||
text={'Redeem'}
|
||||
disabled={!this.state.rewardCode || this.state.rewardCode.trim().length === 0 || rewardIsPending}
|
||||
onPress={() => {
|
||||
if (!rewardIsPending) {
|
||||
|
||||
@@ -9,10 +9,10 @@ const select = state => ({
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
fetchChannelListMine: () => dispatch(doFetchChannelListMine(1, 99999, true)),
|
||||
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
||||
});
|
||||
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
perform
|
||||
)(DrawerContent);
|
||||
@@ -9,8 +9,8 @@ import discoverStyle from 'styles/discover';
|
||||
|
||||
const groupedMenuItems = {
|
||||
'Find content': [
|
||||
{ icon: 'heart', solid: true, label: 'Following', route: Constants.DRAWER_ROUTE_SUBSCRIPTIONS },
|
||||
{ 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 },
|
||||
],
|
||||
'Your content': [
|
||||
@@ -22,7 +22,6 @@ const groupedMenuItems = {
|
||||
Wallet: [
|
||||
{ icon: 'wallet', label: 'Wallet', route: Constants.DRAWER_ROUTE_WALLET },
|
||||
{ icon: 'award', label: 'Rewards', route: Constants.DRAWER_ROUTE_REWARDS },
|
||||
{ icon: 'user-friends', label: 'Invites', route: Constants.DRAWER_ROUTE_INVITES },
|
||||
],
|
||||
Settings: [
|
||||
{ icon: 'cog', label: 'Settings', route: Constants.DRAWER_ROUTE_SETTINGS },
|
||||
@@ -145,7 +144,7 @@ class DrawerContent extends React.PureComponent {
|
||||
const focused =
|
||||
activeItemKey === item.route ||
|
||||
(activeItemKey === Constants.FULL_ROUTE_NAME_DISCOVER &&
|
||||
item.route === Constants.DRAWER_ROUTE_SUBSCRIPTIONS) ||
|
||||
item.route === Constants.DRAWER_ROUTE_DISCOVER) ||
|
||||
(activeItemKey === Constants.FULL_ROUTE_NAME_WALLET &&
|
||||
item.route === Constants.DRAWER_ROUTE_WALLET);
|
||||
return (
|
||||
|
||||
@@ -11,6 +11,11 @@ class FileDownloadButton extends React.PureComponent {
|
||||
}
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
// this.checkAvailability(nextProps.uri);
|
||||
// this.restartDownload(nextProps);
|
||||
}
|
||||
|
||||
restartDownload(props) {
|
||||
const { downloading, fileInfo, uri, restartDownload } = props;
|
||||
|
||||
@@ -30,6 +35,7 @@ class FileDownloadButton extends React.PureComponent {
|
||||
fileInfo,
|
||||
downloading,
|
||||
uri,
|
||||
purchaseUri,
|
||||
costInfo,
|
||||
isPlayable,
|
||||
isViewable,
|
||||
@@ -39,23 +45,12 @@ class FileDownloadButton extends React.PureComponent {
|
||||
doPause,
|
||||
style,
|
||||
openFile,
|
||||
onFileActionPress,
|
||||
onButtonLayout,
|
||||
} = this.props;
|
||||
|
||||
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) {
|
||||
if ((fileInfo && !fileInfo.stopped) || loading || downloading) {
|
||||
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.toFixed(0) + '% complete' : __('Connecting...');
|
||||
|
||||
return (
|
||||
<View style={[style, fileDownloadButtonStyle.container]}>
|
||||
@@ -77,9 +72,33 @@ class FileDownloadButton extends React.PureComponent {
|
||||
text={isPlayable ? __('Play') : isViewable ? __('View') : __('Download')}
|
||||
onLayout={onButtonLayout}
|
||||
style={[style, fileDownloadButtonStyle.container]}
|
||||
onPress={onFileActionPress}
|
||||
onPress={() => {
|
||||
if (NativeModules.Firebase) {
|
||||
NativeModules.Firebase.track('purchase_uri', { uri: uri });
|
||||
}
|
||||
purchaseUri(uri, costInfo, !isPlayable);
|
||||
if (NativeModules.UtilityModule) {
|
||||
NativeModules.UtilityModule.checkDownloads();
|
||||
}
|
||||
if (isPlayable && onPlay) {
|
||||
this.props.onPlay();
|
||||
}
|
||||
if (isViewable && onView) {
|
||||
this.props.onView();
|
||||
}
|
||||
}}
|
||||
/>
|
||||
);
|
||||
} else if (fileInfo && fileInfo.download_path) {
|
||||
return (
|
||||
<TouchableOpacity
|
||||
onLayout={onButtonLayout}
|
||||
style={[style, fileDownloadButtonStyle.container]}
|
||||
onPress={openFile}
|
||||
>
|
||||
<Text style={fileDownloadButtonStyle.text}>{isViewable ? __('View') : __('Open')}</Text>
|
||||
</TouchableOpacity>
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -10,7 +10,6 @@ import {
|
||||
makeSelectClaimIsNsfw,
|
||||
makeSelectShortUrlForUri,
|
||||
} from 'lbry-redux';
|
||||
import { doSetPlayerVisible } from 'redux/actions/drawer';
|
||||
import { selectBlackListedOutpoints, selectFilteredOutpoints, selectRewardContentClaimIds } from 'lbryinc';
|
||||
import { selectShowNsfw } from 'redux/selectors/settings';
|
||||
import FileItem from './view';
|
||||
@@ -32,10 +31,9 @@ const select = (state, props) => ({
|
||||
|
||||
const perform = dispatch => ({
|
||||
resolveUri: uri => dispatch(doResolveUri(uri)),
|
||||
setPlayerVisible: (visible, uri) => dispatch(doSetPlayerVisible(visible, uri)),
|
||||
});
|
||||
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
perform
|
||||
)(FileItem);
|
||||
@@ -56,7 +56,6 @@ class FileItem extends React.PureComponent {
|
||||
obscureNsfw,
|
||||
showDetails,
|
||||
compactView,
|
||||
setPlayerVisible,
|
||||
titleBeforeThumbnail,
|
||||
} = this.props;
|
||||
|
||||
@@ -108,12 +107,7 @@ class FileItem extends React.PureComponent {
|
||||
<Icon style={discoverStyle.downloadedIcon} solid color={Colors.NextLbryGreen} name={'folder'} size={16} />
|
||||
)}
|
||||
{!compactView && (!fileInfo || !fileInfo.completed || !fileInfo.download_path) && (
|
||||
<FilePrice
|
||||
uri={uri}
|
||||
style={discoverStyle.filePriceContainer}
|
||||
iconStyle={discoverStyle.filePriceIcon}
|
||||
textStyle={discoverStyle.filePriceText}
|
||||
/>
|
||||
<FilePrice uri={uri} style={discoverStyle.filePriceContainer} textStyle={discoverStyle.filePriceText} />
|
||||
)}
|
||||
{!compactView && (
|
||||
<View style={isRewardContent ? discoverStyle.rewardTitleContainer : null}>
|
||||
@@ -135,8 +129,7 @@ class FileItem extends React.PureComponent {
|
||||
normalizeURI(shortChannelUri || fullChannelUri),
|
||||
null,
|
||||
false,
|
||||
fullChannelUri,
|
||||
setPlayerVisible,
|
||||
fullChannelUri
|
||||
);
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -61,7 +61,6 @@ class FileItemMedia extends React.PureComponent {
|
||||
let style = this.props.style;
|
||||
const { duration, isResolvingUri, thumbnail, title, resizeMode } = this.props;
|
||||
const atStyle = this.state.autoThumbStyle;
|
||||
const hasDuration = !!duration;
|
||||
|
||||
if (this.isThumbnailValid(thumbnail) && !this.state.imageLoadFailed) {
|
||||
if (style == null) {
|
||||
@@ -76,7 +75,7 @@ class FileItemMedia extends React.PureComponent {
|
||||
resizeMode={this.getFastImageResizeMode(resizeMode)}
|
||||
style={fileItemMediaStyle.image}
|
||||
/>
|
||||
{duration > 0 && (
|
||||
{duration && (
|
||||
<VideoDuration
|
||||
duration={duration}
|
||||
style={fileItemMediaStyle.duration}
|
||||
@@ -105,7 +104,7 @@ class FileItemMedia extends React.PureComponent {
|
||||
.toUpperCase()}
|
||||
</Text>
|
||||
)}
|
||||
{duration > 0 && (
|
||||
{duration && (
|
||||
<VideoDuration
|
||||
duration={duration}
|
||||
style={fileItemMediaStyle.duration}
|
||||
|
||||
@@ -10,7 +10,6 @@ import {
|
||||
makeSelectTitleForUri,
|
||||
makeSelectThumbnailForUri,
|
||||
} from 'lbry-redux';
|
||||
import { doSetPlayerVisible } from 'redux/actions/drawer';
|
||||
import { selectBlackListedOutpoints, selectFilteredOutpoints, selectRewardContentClaimIds } from 'lbryinc';
|
||||
import { selectShowNsfw } from 'redux/selectors/settings';
|
||||
import FileListItem from './view';
|
||||
@@ -33,10 +32,9 @@ const select = (state, props) => ({
|
||||
|
||||
const perform = dispatch => ({
|
||||
resolveUri: uri => dispatch(doResolveUri(uri)),
|
||||
setPlayerVisible: (visible, uri) => dispatch(doSetPlayerVisible(visible, uri)),
|
||||
});
|
||||
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
perform
|
||||
)(FileListItem);
|
||||
@@ -1,15 +1,11 @@
|
||||
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 { navigateToUri, formatBytes } 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';
|
||||
@@ -18,10 +14,27 @@ import fileListStyle from 'styles/fileList';
|
||||
|
||||
class FileListItem extends React.PureComponent {
|
||||
state = {
|
||||
autoStyle: 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 => {
|
||||
return Math.ceil((fileInfo.written_bytes / fileInfo.total_bytes) * 100);
|
||||
};
|
||||
@@ -31,16 +44,11 @@ class FileListItem extends React.PureComponent {
|
||||
if (!claim && !batchResolve) {
|
||||
resolveUri(uri);
|
||||
}
|
||||
|
||||
this.setState({
|
||||
autoStyle:
|
||||
ChannelIconItem.AUTO_THUMB_STYLES[Math.floor(Math.random() * ChannelIconItem.AUTO_THUMB_STYLES.length)],
|
||||
});
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
const { claim, resolveUri, uri, batchResolve } = this.props;
|
||||
if (!claim && uri !== this.state.url && !batchResolve) {
|
||||
const { claim, resolveUri, uri } = this.props;
|
||||
if (!claim && uri !== this.state.url) {
|
||||
this.setState({ url: uri }, () => resolveUri(uri));
|
||||
}
|
||||
}
|
||||
@@ -80,7 +88,6 @@ class FileListItem extends React.PureComponent {
|
||||
onPress,
|
||||
navigation,
|
||||
rewardedContentClaimIds,
|
||||
setPlayerVisible,
|
||||
thumbnail,
|
||||
hideChannel,
|
||||
onLongPress,
|
||||
@@ -99,12 +106,9 @@ class FileListItem extends React.PureComponent {
|
||||
isRewardContent,
|
||||
channelClaimId,
|
||||
fullChannelUri,
|
||||
repostChannel,
|
||||
repostChannelUrl,
|
||||
shortChannelUri,
|
||||
shouldHide,
|
||||
signingChannel,
|
||||
isRepost;
|
||||
signingChannel;
|
||||
if (claim) {
|
||||
name = claim.name;
|
||||
signingChannel = claim.signing_channel;
|
||||
@@ -114,12 +118,6 @@ class FileListItem extends React.PureComponent {
|
||||
channelClaimId = signingChannel ? signingChannel.claim_id : null;
|
||||
fullChannelUri = channelClaimId ? `${channel}#${channelClaimId}` : channel;
|
||||
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) {
|
||||
const outpointsToHide = !blackListedOutpoints
|
||||
@@ -136,22 +134,10 @@ class FileListItem extends React.PureComponent {
|
||||
return null;
|
||||
}
|
||||
|
||||
const actualHideChannel = !isRepost && hideChannel;
|
||||
const isChannel = name && name.startsWith('@');
|
||||
const hasThumbnail = !!thumbnail;
|
||||
return (
|
||||
<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>
|
||||
)}
|
||||
|
||||
<View style={style}>
|
||||
<TouchableOpacity
|
||||
style={[style, isChannel ? fileListStyle.channelContainer : null]}
|
||||
style={style}
|
||||
onPress={this.onPressHandler}
|
||||
onLongPress={() => {
|
||||
if (onLongPress) {
|
||||
@@ -159,55 +145,21 @@ class FileListItem extends React.PureComponent {
|
||||
}
|
||||
}}
|
||||
>
|
||||
{!isChannel && (
|
||||
<FileItemMedia
|
||||
style={fileListStyle.thumbnail}
|
||||
duration={duration}
|
||||
resizeMode="cover"
|
||||
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>
|
||||
)}
|
||||
|
||||
<FileItemMedia
|
||||
style={fileListStyle.thumbnail}
|
||||
duration={duration}
|
||||
resizeMode="cover"
|
||||
title={title || name || normalizeURI(uri).substring(7)}
|
||||
thumbnail={thumbnail}
|
||||
/>
|
||||
{selected && (
|
||||
<View style={fileListStyle.selectedOverlay}>
|
||||
<Icon name={'check-circle'} solid color={Colors.NextLbryGreen} size={32} />
|
||||
</View>
|
||||
)}
|
||||
{fileInfo && fileInfo.completed && fileInfo.download_path && (
|
||||
<Icon
|
||||
style={featuredResult ? fileListStyle.featuredDownloadedIcon : fileListStyle.downloadedIcon}
|
||||
solid
|
||||
color={Colors.NextLbryGreen}
|
||||
name={'folder'}
|
||||
size={16}
|
||||
/>
|
||||
<Icon style={fileListStyle.downloadedIcon} solid color={Colors.NextLbryGreen} name={'folder'} size={16} />
|
||||
)}
|
||||
<FilePrice
|
||||
uri={uri}
|
||||
style={fileListStyle.filePriceContainer}
|
||||
iconStyle={fileListStyle.filePriceIcon}
|
||||
textStyle={fileListStyle.filePriceText}
|
||||
/>
|
||||
<View style={fileListStyle.detailsContainer}>
|
||||
{featuredResult && (
|
||||
<Text style={fileListStyle.featuredUri} numberOfLines={1}>
|
||||
@@ -220,7 +172,7 @@ class FileListItem extends React.PureComponent {
|
||||
{!title && !name && <Text style={fileListStyle.uri}>{uri}</Text>}
|
||||
{!title && !name && (
|
||||
<View style={fileListStyle.row}>
|
||||
<ActivityIndicator size={'small'} color={featuredResult ? Colors.White : Colors.NextLbryGreen} />
|
||||
<ActivityIndicator size={'small'} color={featuredResult ? Colors.White : Colors.LbryGreen} />
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
@@ -228,11 +180,8 @@ class FileListItem extends React.PureComponent {
|
||||
|
||||
{(title || name) && (
|
||||
<View style={fileListStyle.titleContainer}>
|
||||
<Text
|
||||
style={featuredResult ? fileListStyle.featuredTitle : fileListStyle.title}
|
||||
numberOfLines={actualHideChannel ? 4 : 3}
|
||||
>
|
||||
{title || name}
|
||||
<Text style={featuredResult ? fileListStyle.featuredTitle : fileListStyle.title}>
|
||||
{this.formatTitle(title) || this.formatTitle(name)}
|
||||
</Text>
|
||||
{isRewardContent && <Icon style={fileListStyle.rewardIcon} name="award" size={12} />}
|
||||
</View>
|
||||
@@ -244,18 +193,17 @@ class FileListItem extends React.PureComponent {
|
||||
</View>
|
||||
)}
|
||||
|
||||
{(channel || isChannel) && !actualHideChannel && (
|
||||
{channel && !hideChannel && (
|
||||
<Link
|
||||
style={fileListStyle.publisher}
|
||||
text={isChannel ? name : channel}
|
||||
text={channel}
|
||||
onPress={() => {
|
||||
navigateToUri(
|
||||
navigation,
|
||||
normalizeURI(isChannel ? uri : shortChannelUri || fullChannelUri),
|
||||
normalizeURI(shortChannelUri || fullChannelUri),
|
||||
null,
|
||||
false,
|
||||
isChannel ? claim && claim.permanent_url : fullChannelUri,
|
||||
setPlayerVisible,
|
||||
fullChannelUri
|
||||
);
|
||||
}}
|
||||
/>
|
||||
@@ -263,7 +211,7 @@ class FileListItem extends React.PureComponent {
|
||||
|
||||
<View style={fileListStyle.info}>
|
||||
{fileInfo && !isNaN(fileInfo.written_bytes) && fileInfo.written_bytes > 0 && (
|
||||
<Text style={fileListStyle.infoText}>{getStorageForFileInfo(fileInfo)}</Text>
|
||||
<Text style={fileListStyle.infoText}>{this.getStorageForFileInfo(fileInfo)}</Text>
|
||||
)}
|
||||
<DateTime style={fileListStyle.publishInfo} textStyle={fileListStyle.infoText} timeAgo uri={uri} />
|
||||
</View>
|
||||
@@ -276,7 +224,7 @@ class FileListItem extends React.PureComponent {
|
||||
color={Colors.NextLbryGreen}
|
||||
height={3}
|
||||
style={fileListStyle.progress}
|
||||
progress={getDownloadProgress(fileInfo)}
|
||||
progress={this.getDownloadProgress(fileInfo)}
|
||||
/>
|
||||
)}
|
||||
</View>
|
||||
|
||||
@@ -2,7 +2,6 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Text, View } from 'react-native';
|
||||
import { formatCredits, formatFullPrice } from 'lbry-redux';
|
||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||
|
||||
class CreditAmount extends React.PureComponent {
|
||||
static propTypes = {
|
||||
@@ -63,27 +62,25 @@ class CreditAmount extends React.PureComponent {
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<Text style={style} numberOfLines={1}>
|
||||
{amountText}
|
||||
</Text>
|
||||
);
|
||||
/* {this.props.isEstimate ? (
|
||||
<span
|
||||
className="credit-amount__estimate"
|
||||
title={__('This is an estimate and does not include data fees')}
|
||||
>
|
||||
*
|
||||
</span>
|
||||
) : null} */
|
||||
return <Text style={style}>{amountText}</Text>;
|
||||
}
|
||||
}
|
||||
|
||||
class FilePrice extends React.PureComponent {
|
||||
componentWillMount() {
|
||||
const { cost } = this.props;
|
||||
if (isNaN(parseFloat(cost))) {
|
||||
this.fetchCost(this.props);
|
||||
}
|
||||
this.fetchCost(this.props);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
const { cost } = this.props;
|
||||
if (isNaN(parseFloat(cost))) {
|
||||
this.fetchCost(nextProps);
|
||||
}
|
||||
this.fetchCost(nextProps);
|
||||
}
|
||||
|
||||
fetchCost(props) {
|
||||
@@ -95,25 +92,30 @@ class FilePrice extends React.PureComponent {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { cost, costInfo, look = 'indicator', showFullPrice = false, style, iconStyle, textStyle } = this.props;
|
||||
const { costInfo, look = 'indicator', showFullPrice = false, style, textStyle } = this.props;
|
||||
|
||||
const isEstimate = costInfo ? !costInfo.includesData : null;
|
||||
const amount = cost ? parseFloat(cost) : costInfo ? parseFloat(costInfo.cost) : 0;
|
||||
if (isNaN(amount) || amount === 0) {
|
||||
return null;
|
||||
|
||||
if (!costInfo) {
|
||||
return (
|
||||
<View style={style}>
|
||||
<Text style={textStyle}>???</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={style}>
|
||||
<Icon name="coins" size={9} style={iconStyle} />
|
||||
<CreditAmount
|
||||
style={textStyle}
|
||||
label={false}
|
||||
amount={amount}
|
||||
amount={parseFloat(costInfo.cost)}
|
||||
isEstimate={isEstimate}
|
||||
showFree
|
||||
showFullPrice={showFullPrice}
|
||||
/>
|
||||
>
|
||||
???
|
||||
</CreditAmount>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ class MediaPlayer extends React.PureComponent {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
buffering: true,
|
||||
buffering: false,
|
||||
backgroundPlayEnabled: false,
|
||||
autoPaused: false,
|
||||
rate: 1,
|
||||
@@ -45,9 +45,9 @@ class MediaPlayer extends React.PureComponent {
|
||||
resizeMode: 'contain',
|
||||
duration: 0.0,
|
||||
currentTime: 0.0,
|
||||
paused: true,
|
||||
paused: !props.autoPlay,
|
||||
fullscreenMode: false,
|
||||
areControlsVisible: false,
|
||||
areControlsVisible: true,
|
||||
controlsTimeout: -1,
|
||||
seekerOffset: 0,
|
||||
seekerPosition: 0,
|
||||
@@ -87,9 +87,7 @@ class MediaPlayer extends React.PureComponent {
|
||||
}
|
||||
|
||||
onLoad = data => {
|
||||
const { autoPlay } = this.props;
|
||||
this.setState({
|
||||
buffering: false,
|
||||
duration: data.duration,
|
||||
});
|
||||
|
||||
@@ -102,17 +100,13 @@ class MediaPlayer extends React.PureComponent {
|
||||
if (this.props.onMediaLoaded) {
|
||||
this.props.onMediaLoaded();
|
||||
}
|
||||
|
||||
if (autoPlay) {
|
||||
this.setState({ paused: false });
|
||||
}
|
||||
};
|
||||
|
||||
onProgress = data => {
|
||||
const { savePosition, claim } = this.props;
|
||||
|
||||
this.setState({ buffering: false, currentTime: data.currentTime });
|
||||
if (claim && data.currentTime > 0 && Math.floor(data.currentTime) % positionSaveInterval === 0) {
|
||||
if (data.currentTime > 0 && Math.floor(data.currentTime) % positionSaveInterval === 0) {
|
||||
const { claim_id: claimId, txid, nout } = claim;
|
||||
savePosition(claimId, `${txid}:${nout}`, data.currentTime);
|
||||
}
|
||||
@@ -173,7 +167,7 @@ class MediaPlayer extends React.PureComponent {
|
||||
|
||||
togglePlay = () => {
|
||||
this.showPlayerControls();
|
||||
this.setState({ paused: !this.state.paused }, this.updateBackgroundMediaNotification);
|
||||
this.setState({ paused: !this.state.paused }, this.handlePausedState);
|
||||
};
|
||||
|
||||
handlePausedState = () => {
|
||||
@@ -194,7 +188,7 @@ class MediaPlayer extends React.PureComponent {
|
||||
};
|
||||
|
||||
onEnd = () => {
|
||||
this.setState({ paused: true }, this.updateBackgroundMediaNotification);
|
||||
this.setState({ paused: true });
|
||||
if (this.props.onPlaybackFinished) {
|
||||
this.props.onPlaybackFinished();
|
||||
}
|
||||
@@ -333,10 +327,6 @@ class MediaPlayer extends React.PureComponent {
|
||||
}
|
||||
};
|
||||
|
||||
onFocusChanged = evt => {
|
||||
this.setState({ paused: !(this.state.paused && evt.hasAudioFocus) }, this.updateBackgroundMediaNotification);
|
||||
};
|
||||
|
||||
onBuffer = () => {
|
||||
if (!this.state.paused) {
|
||||
this.setState({ buffering: true }, () => this.manualHidePlayerControls());
|
||||
@@ -351,12 +341,6 @@ class MediaPlayer extends React.PureComponent {
|
||||
this.setState({ paused: true }, this.updateBackgroundMediaNotification);
|
||||
};
|
||||
|
||||
handleSeek = time => {
|
||||
const { currentTime } = this.state;
|
||||
const newTime = currentTime + time;
|
||||
this.seekTo(newTime);
|
||||
};
|
||||
|
||||
updateBackgroundMediaNotification = () => {
|
||||
this.handlePausedState();
|
||||
const { backgroundPlayEnabled } = this.props;
|
||||
@@ -378,26 +362,14 @@ class MediaPlayer extends React.PureComponent {
|
||||
<Icon name={'arrow-left'} size={18} style={mediaPlayerStyle.backButtonIcon} />
|
||||
</TouchableOpacity>
|
||||
|
||||
<View style={mediaPlayerStyle.midControls}>
|
||||
<TouchableOpacity style={mediaPlayerStyle.rewind10} onPress={() => this.handleSeek(-10)}>
|
||||
<Icon name="undo" size={24} color={Colors.White} />
|
||||
<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.playPauseButton} onPress={this.togglePlay}>
|
||||
{this.state.paused && <Icon name="play" size={40} color="#ffffff" />}
|
||||
{!this.state.paused && <Icon name="pause" size={40} color="#ffffff" />}
|
||||
</TouchableOpacity>
|
||||
|
||||
<TouchableOpacity style={mediaPlayerStyle.toggleFullscreenButton} onPress={this.toggleFullscreenMode}>
|
||||
{this.state.fullscreenMode && <Icon name="compress" size={16} color={Colors.White} />}
|
||||
{!this.state.fullscreenMode && <Icon name="expand" size={16} color={Colors.White} />}
|
||||
{this.state.fullscreenMode && <Icon name="compress" size={16} color="#ffffff" />}
|
||||
{!this.state.fullscreenMode && <Icon name="expand" size={16} color="#ffffff" />}
|
||||
</TouchableOpacity>
|
||||
|
||||
<Text style={mediaPlayerStyle.elapsedDuration}>{this.formatTime(this.state.currentTime)}</Text>
|
||||
@@ -449,7 +421,7 @@ class MediaPlayer extends React.PureComponent {
|
||||
const seekerCircleStyle = [this.state.seeking ? mediaPlayerStyle.bigSeekerCircle : mediaPlayerStyle.seekerCircle];
|
||||
if (!this.state.seeking) {
|
||||
seekerCircleStyle.push(
|
||||
this.state.fullscreenMode ? mediaPlayerStyle.seekerCircleTopFs : mediaPlayerStyle.seekerCircleTop,
|
||||
this.state.fullscreenMode ? mediaPlayerStyle.seekerCircleTopFs : mediaPlayerStyle.seekerCircleTop
|
||||
);
|
||||
}
|
||||
|
||||
@@ -468,7 +440,6 @@ class MediaPlayer extends React.PureComponent {
|
||||
}}
|
||||
resizeMode={this.state.resizeMode}
|
||||
playInBackground={this.state.backgroundPlayEnabled}
|
||||
playWhenInactive={this.state.backgroundPlayEnabled}
|
||||
style={mediaPlayerStyle.player}
|
||||
rate={this.state.rate}
|
||||
volume={this.state.volume}
|
||||
@@ -479,7 +450,6 @@ class MediaPlayer extends React.PureComponent {
|
||||
onEnd={this.onEnd}
|
||||
onError={this.onError}
|
||||
minLoadRetryCount={999}
|
||||
onAudioFocusChanged={this.onFocusChanged}
|
||||
/>
|
||||
|
||||
{this.state.firstPlay && thumbnail && (
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { selectFetchingClaimSearch } from 'lbry-redux';
|
||||
import ModalSuggestedSubscriptions from './view';
|
||||
|
||||
const select = state => ({
|
||||
loadingSuggested: selectFetchingClaimSearch(state),
|
||||
});
|
||||
|
||||
export default connect(select)(ModalSuggestedSubscriptions);
|
||||
export default connect()(ModalSuggestedSubscriptions);
|
||||
@@ -1,26 +1,23 @@
|
||||
import React from 'react';
|
||||
import { ActivityIndicator, ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
||||
import { ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
||||
import modalStyle from 'styles/modal';
|
||||
import subscriptionsStyle from 'styles/subscriptions';
|
||||
import Button from 'component/button';
|
||||
import Colors from 'styles/colors';
|
||||
import SuggestedSubscriptionsGrid from 'component/suggestedSubscriptionsGrid';
|
||||
import SuggestedSubscriptions from 'component/suggestedSubscriptions';
|
||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||
|
||||
export default class ModalSuggestedSubcriptions extends React.PureComponent {
|
||||
render() {
|
||||
const { loadingSuggested, navigation, onDonePress, onOverlayPress } = this.props;
|
||||
const { navigation, onDonePress, onOverlayPress } = this.props;
|
||||
|
||||
return (
|
||||
<TouchableOpacity style={modalStyle.overlay} activeOpacity={1} onPress={onOverlayPress}>
|
||||
<TouchableOpacity style={[modalStyle.container, subscriptionsStyle.modalContainer]} activeOpacity={1}>
|
||||
<SuggestedSubscriptionsGrid inModal navigation={navigation} />
|
||||
<View style={modalStyle.wideButtons}>
|
||||
<Button style={modalStyle.wideDoneButton} text={__('Done')} onPress={onDonePress} />
|
||||
{loadingSuggested && (
|
||||
<ActivityIndicator size="small" color={Colors.White} style={subscriptionsStyle.modalLoading} />
|
||||
)}
|
||||
<SuggestedSubscriptions inModal navigation={navigation} />
|
||||
<View style={modalStyle.buttons}>
|
||||
<Button style={modalStyle.doneButton} text={__('Done')} onPress={onDonePress} />
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
</TouchableOpacity>
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doSendTip, doToast, selectBalance } from 'lbry-redux';
|
||||
import ModalTipView from './view';
|
||||
|
||||
const select = state => ({
|
||||
balance: selectBalance(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
notify: data => dispatch(doToast(data)),
|
||||
sendTip: (amount, claimId, isSupport, successCallback, errorCallback) =>
|
||||
dispatch(doSendTip(amount, claimId, isSupport, successCallback, errorCallback)),
|
||||
});
|
||||
|
||||
export default connect(
|
||||
select,
|
||||
perform
|
||||
)(ModalTipView);
|
||||
@@ -1,148 +0,0 @@
|
||||
import React from 'react';
|
||||
import { ActivityIndicator, Alert, Text, TextInput, TouchableOpacity, View } from 'react-native';
|
||||
import { formatCredits } from 'lbry-redux';
|
||||
import modalStyle from 'styles/modal';
|
||||
import modalTipStyle from 'styles/modalTip';
|
||||
import Button from 'component/button';
|
||||
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';
|
||||
|
||||
export default class ModalTipView extends React.PureComponent {
|
||||
tipAmountInput = null;
|
||||
|
||||
state = {
|
||||
creditsInputFocused: false,
|
||||
sendTipStarted: false,
|
||||
tipAmount: null,
|
||||
};
|
||||
|
||||
handleSendTip = () => {
|
||||
const { claim, balance, notify, onSendTipFailed, onSendTipSuccessful, sendTip } = this.props;
|
||||
const { tipAmount } = this.state;
|
||||
|
||||
if (tipAmount > balance) {
|
||||
notify({
|
||||
message: 'Insufficient credits',
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const amount = parseInt(tipAmount, 10);
|
||||
const message =
|
||||
amount === 1
|
||||
? __('Please confirm you want to tip %amount% credit', { amount })
|
||||
: __('Please confirm you want to tip %amount% credits', { amount });
|
||||
|
||||
Alert.alert(
|
||||
__('Send Tip'),
|
||||
message,
|
||||
[
|
||||
{ text: __('No') },
|
||||
{
|
||||
text: __('Yes'),
|
||||
onPress: () => {
|
||||
this.setState({ sendTipStarted: true }, () =>
|
||||
sendTip(
|
||||
tipAmount,
|
||||
claim.claim_id,
|
||||
false,
|
||||
() => {
|
||||
// success
|
||||
this.setState({ tipAmount: null, sendTipStarted: false });
|
||||
if (onSendTipSuccessful) onSendTipSuccessful();
|
||||
},
|
||||
() => {
|
||||
// error
|
||||
if (onSendTipFailed) onSendTipFailed();
|
||||
}
|
||||
)
|
||||
);
|
||||
},
|
||||
},
|
||||
],
|
||||
{ cancelable: true }
|
||||
);
|
||||
};
|
||||
|
||||
render() {
|
||||
const { balance, channelName, contentName, onCancelPress, onOverlayPress } = this.props;
|
||||
const canSendTip = this.state.tipAmount > 0;
|
||||
|
||||
return (
|
||||
<TouchableOpacity style={modalStyle.overlay} activeOpacity={1} onPress={onOverlayPress}>
|
||||
<TouchableOpacity style={modalStyle.container} activeOpacity={1}>
|
||||
<View
|
||||
style={modalTipStyle.container}
|
||||
onLayout={() => {
|
||||
if (this.tipAmountInput) {
|
||||
this.tipAmountInput.focus();
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Text style={modalTipStyle.title} numberOfLines={1}>
|
||||
{channelName ? __('Send a tip to %channel%', { channel: channelName }) : __('Send a tip')}
|
||||
</Text>
|
||||
|
||||
<View style={modalTipStyle.row}>
|
||||
<View style={modalTipStyle.amountRow}>
|
||||
<TextInput
|
||||
editable={!this.state.sendTipStarted}
|
||||
ref={ref => (this.tipAmountInput = ref)}
|
||||
onChangeText={value => this.setState({ tipAmount: value })}
|
||||
underlineColorAndroid={Colors.NextLbryGreen}
|
||||
keyboardType={'numeric'}
|
||||
onFocus={() => this.setState({ creditsInputFocused: true })}
|
||||
onBlur={() => this.setState({ creditsInputFocused: false })}
|
||||
placeholder={'0'}
|
||||
value={this.state.tipAmount}
|
||||
selectTextOnFocus
|
||||
style={modalTipStyle.tipAmountInput}
|
||||
/>
|
||||
<Text style={modalTipStyle.currency}>LBC</Text>
|
||||
<View style={modalTipStyle.balance}>
|
||||
{this.state.creditsInputFocused && <Icon name="coins" size={12} />}
|
||||
{this.state.creditsInputFocused && (
|
||||
<Text style={modalTipStyle.balanceText}>{formatCredits(parseFloat(balance), 1, true)}</Text>
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
{this.state.sendTipStarted && <ActivityIndicator size={'small'} color={Colors.NextLbryGreen} />}
|
||||
</View>
|
||||
|
||||
<View style={modalTipStyle.info}>
|
||||
<Text style={modalTipStyle.infoText}>
|
||||
{__(
|
||||
'This will appear as a tip for %content%, which will boost its ability to be discovered while active.',
|
||||
{ content: contentName }
|
||||
)}{' '}
|
||||
<Link
|
||||
style={modalTipStyle.learnMoreLink}
|
||||
text={__('Learn more.')}
|
||||
href={'https://lbry.com/faq/tipping'}
|
||||
/>
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View style={modalTipStyle.buttonRow}>
|
||||
<Link
|
||||
style={modalTipStyle.cancelTipLink}
|
||||
text={__('Cancel')}
|
||||
onPress={() => {
|
||||
if (onCancelPress) onCancelPress();
|
||||
}}
|
||||
/>
|
||||
<Button
|
||||
text={__('Send')}
|
||||
style={modalTipStyle.button}
|
||||
disabled={!canSendTip || this.state.sendTipStarted}
|
||||
onPress={this.handleSendTip}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
</TouchableOpacity>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,35 +1,25 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
doResolveUris,
|
||||
doResolvedSearch,
|
||||
makeSelectClaimForUri,
|
||||
makeSelectResolvedRecommendedContentForUri,
|
||||
selectResolvingUris,
|
||||
makeSelectRecommendedContentForUri,
|
||||
makeSelectTitleForUri,
|
||||
selectIsSearching,
|
||||
} from 'lbry-redux';
|
||||
import { selectShowNsfw } from 'redux/selectors/settings';
|
||||
import RelatedContent from './view';
|
||||
|
||||
const RESULT_SIZE = 16;
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
recommendedContent: makeSelectRecommendedContentForUri(props.uri)(state),
|
||||
title: makeSelectTitleForUri(props.uri)(state),
|
||||
isSearching: selectIsSearching(state),
|
||||
recommendedContent: makeSelectResolvedRecommendedContentForUri(
|
||||
props.uri,
|
||||
RESULT_SIZE,
|
||||
props.claimId,
|
||||
props.claimName,
|
||||
props.title,
|
||||
)(state),
|
||||
resolvingUris: selectResolvingUris(state),
|
||||
showNsfwContent: selectShowNsfw(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
resolveUris: uris => dispatch(doResolveUris(uris)),
|
||||
searchRecommended: (query, claimId, nsfw) =>
|
||||
dispatch(doResolvedSearch(query, RESULT_SIZE, undefined, true, { related_to: claimId }, nsfw)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(RelatedContent);
|
||||
export default connect(
|
||||
select,
|
||||
perform
|
||||
)(RelatedContent);
|
||||
@@ -4,42 +4,44 @@ import { normalizeURI } from 'lbry-redux';
|
||||
import { navigateToUri } from 'utils/helper';
|
||||
import Colors from 'styles/colors';
|
||||
import FileListItem from 'component/fileListItem';
|
||||
import ClaimResultItem from 'component/claimResultItem';
|
||||
import fileListStyle from 'styles/fileList';
|
||||
import relatedContentStyle from 'styles/relatedContent';
|
||||
|
||||
export default class RelatedContent extends React.PureComponent {
|
||||
componentDidMount() {
|
||||
const { title, claimId, searchRecommended, showNsfwContent } = this.props;
|
||||
if (title && claimId) {
|
||||
searchRecommended(title, claimId, showNsfwContent);
|
||||
state = {
|
||||
urlsResolved: false,
|
||||
};
|
||||
|
||||
componentDidUpdate(prevProps) {
|
||||
const { resolveUris, recommendedContent } = this.props;
|
||||
|
||||
if (recommendedContent && recommendedContent.length > 0 && !this.state.urisResolved) {
|
||||
this.setState({ urisResolved: true }, () => {
|
||||
// batch resolve the uris
|
||||
resolveUris(recommendedContent);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
shouldComponentUpdate(nextProps, nextState) {
|
||||
const { isSearching, recommendedContent } = nextProps;
|
||||
return isSearching || (!isSearching && recommendedContent && recommendedContent.length > 0);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { isSearching, recommendedContent, navigation, urlOpenHandler, uri, fullUri } = this.props;
|
||||
const { recommendedContent, navigation, uri, fullUri } = this.props;
|
||||
|
||||
return (
|
||||
<View style={relatedContentStyle.container}>
|
||||
<Text style={relatedContentStyle.title}>{__('Related Content')}</Text>
|
||||
{isSearching && <ActivityIndicator size={'small'} color={Colors.NextLbryGreen} />}
|
||||
<Text style={relatedContentStyle.title}>Related Content</Text>
|
||||
{recommendedContent &&
|
||||
recommendedContent.map(result => (
|
||||
<ClaimResultItem
|
||||
style={fileListStyle.item}
|
||||
uri={result ? normalizeURI(`${result.name}#${result.claimId}`) : null}
|
||||
urlOpenHandler={urlOpenHandler}
|
||||
key={result.claimId}
|
||||
result={result}
|
||||
navigation={navigation}
|
||||
autoplay
|
||||
/>
|
||||
))}
|
||||
recommendedContent
|
||||
.filter(recommendedUri => recommendedUri !== normalizeURI(fullUri))
|
||||
.map(recommendedUri => (
|
||||
<FileListItem
|
||||
style={fileListStyle.item}
|
||||
key={recommendedUri}
|
||||
uri={recommendedUri}
|
||||
batchResolve
|
||||
navigation={navigation}
|
||||
autoplay
|
||||
/>
|
||||
))}
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -35,10 +35,7 @@ class RewardEnrolment extends React.Component {
|
||||
<View style={rewardStyle.enrollContainer}>
|
||||
<View style={rewardStyle.summaryRow}>
|
||||
<Icon name="award" size={36} color={Colors.White} />
|
||||
<Text style={rewardStyle.summaryText}>
|
||||
{unclaimedRewardAmount === 1 && __('%amount% available credit', { amount: unclaimedRewardAmount })}
|
||||
{unclaimedRewardAmount !== 1 && __('%amount% available credits', { amount: unclaimedRewardAmount })}
|
||||
</Text>
|
||||
<Text style={rewardStyle.summaryText}>{unclaimedRewardAmount} available credits</Text>
|
||||
</View>
|
||||
|
||||
<View style={rewardStyle.onboarding}>
|
||||
|
||||
@@ -75,10 +75,10 @@ class StorageStatsCard extends React.PureComponent {
|
||||
<View style={[storageStatsStyle.row, storageStatsStyle.totalSizeContainer]}>
|
||||
<View style={storageStatsStyle.summary}>
|
||||
<Text style={storageStatsStyle.totalSize}>{formatBytes(this.state.totalBytes, 2)}</Text>
|
||||
<Text style={storageStatsStyle.annotation}>{__('used')}</Text>
|
||||
<Text style={storageStatsStyle.annotation}>used</Text>
|
||||
</View>
|
||||
<View style={[storageStatsStyle.row, storageStatsStyle.toggleStatsContainer]}>
|
||||
<Text style={storageStatsStyle.statsText}>{__('Stats')}</Text>
|
||||
<Text style={storageStatsStyle.statsText}>Stats</Text>
|
||||
<Switch
|
||||
style={storageStatsStyle.statsToggle}
|
||||
value={this.state.showStats}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
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);
|
||||
@@ -1,36 +0,0 @@
|
||||
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,7 +6,6 @@ import {
|
||||
makeSelectTitleForUri,
|
||||
makeSelectIsUriResolving,
|
||||
} from 'lbry-redux';
|
||||
import { doChannelSubscribe, doChannelUnsubscribe, makeSelectIsSubscribed } from 'lbryinc';
|
||||
import SuggestedSubscriptionItem from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
@@ -14,16 +13,13 @@ const select = (state, props) => ({
|
||||
title: makeSelectTitleForUri(props.uri)(state),
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
isResolvingUri: makeSelectIsUriResolving(props.uri)(state),
|
||||
isSubscribed: makeSelectIsSubscribed(props.uri, true)(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
resolveUri: uri => dispatch(doResolveUri(uri)),
|
||||
subscribe: subscription => doChannelSubscribe(subscription),
|
||||
unsubscribe: subscription => doChannelUnsubscribe(subscription),
|
||||
});
|
||||
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
perform
|
||||
)(SuggestedSubscriptionItem);
|
||||
@@ -1,37 +1,25 @@
|
||||
import React from 'react';
|
||||
import { buildURI, normalizeURI } from 'lbry-redux';
|
||||
import { ActivityIndicator, FlatList, Image, Text, TouchableOpacity, View } from 'react-native';
|
||||
import { ActivityIndicator, FlatList, Image, Text, View } from 'react-native';
|
||||
import { navigateToUri } from 'utils/helper';
|
||||
import Colors from 'styles/colors';
|
||||
import ChannelIconItem from 'component/channelIconItem';
|
||||
import channelIconStyle from 'styles/channelIcon';
|
||||
import discoverStyle from 'styles/discover';
|
||||
import FileItem from 'component/fileItem';
|
||||
import SubscribeButtonOverlay from 'component/subscribeButtonOverlay';
|
||||
import SubscribeButton from 'component/subscribeButton';
|
||||
import subscriptionsStyle from 'styles/subscriptions';
|
||||
import Link from 'component/link';
|
||||
import Tag from 'component/tag';
|
||||
|
||||
class SuggestedSubscriptionItem extends React.PureComponent {
|
||||
state = {
|
||||
autoStyle: null,
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
const { claim, uri, resolveUri } = this.props;
|
||||
if (!claim) {
|
||||
resolveUri(uri);
|
||||
}
|
||||
|
||||
this.setState({
|
||||
autoStyle:
|
||||
ChannelIconItem.AUTO_THUMB_STYLES[Math.floor(Math.random() * ChannelIconItem.AUTO_THUMB_STYLES.length)],
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
const { claim, isResolvingUri, navigation, thumbnail, title, uri } = this.props;
|
||||
|
||||
let shortUrl, tags;
|
||||
if (claim) {
|
||||
shortUrl = claim.short_url;
|
||||
@@ -40,60 +28,54 @@ class SuggestedSubscriptionItem extends React.PureComponent {
|
||||
}
|
||||
}
|
||||
|
||||
const hasThumbnail = !!thumbnail;
|
||||
if (isResolvingUri) {
|
||||
return (
|
||||
<View style={subscriptionsStyle.itemLoadingContainer}>
|
||||
<ActivityIndicator size={'small'} color={Colors.NextLbryGreen} />
|
||||
<ActivityIndicator size={'small'} color={Colors.LbryGreen} />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<TouchableOpacity style={subscriptionsStyle.suggestedItem}>
|
||||
<View style={[subscriptionsStyle.suggestedItemThumbnailContainer, this.state.autoStyle]}>
|
||||
{hasThumbnail && (
|
||||
<Image style={subscriptionsStyle.suggestedItemThumbnail} resizeMode={'cover'} source={{ uri: thumbnail }} />
|
||||
)}
|
||||
{!hasThumbnail && (
|
||||
<Text style={channelIconStyle.autothumbCharacter}>
|
||||
{title ? title.substring(0, 1).toUpperCase() : claim ? claim.name.substring(1, 2).toUpperCase() : ''}
|
||||
</Text>
|
||||
)}
|
||||
<View style={subscriptionsStyle.suggestedItem}>
|
||||
<View style={subscriptionsStyle.suggestedItemThumbnailContainer}>
|
||||
<Image
|
||||
style={subscriptionsStyle.suggestedItemThumbnail}
|
||||
resizeMode={'cover'}
|
||||
source={thumbnail ? { uri: thumbnail } : require('../../assets/default_avatar.jpg')}
|
||||
/>
|
||||
</View>
|
||||
|
||||
<View style={subscriptionsStyle.suggestedItemDetails}>
|
||||
<Text style={subscriptionsStyle.suggestedItemTitle} numberOfLines={2}>
|
||||
{title || claim.name}
|
||||
</Text>
|
||||
{title && (
|
||||
<Text style={subscriptionsStyle.suggestedItemTitle} numberOfLines={1}>
|
||||
{title}
|
||||
</Text>
|
||||
)}
|
||||
{claim && (
|
||||
<Link
|
||||
style={subscriptionsStyle.suggestedItemName}
|
||||
numberOfLines={1}
|
||||
text={claim.name}
|
||||
onPress={() => navigateToUri(navigation, normalizeURI(shortUrl || uri), null, false, claim.permanent_url)}
|
||||
/>
|
||||
)}
|
||||
{tags && (
|
||||
<View style={subscriptionsStyle.suggestedItemTagList}>
|
||||
{tags &&
|
||||
tags
|
||||
.slice(0, 1)
|
||||
.slice(0, 3)
|
||||
.map(tag => (
|
||||
<Tag
|
||||
numberOfLines={1}
|
||||
onPress={this.handleItemPress}
|
||||
style={subscriptionsStyle.tag}
|
||||
key={tag}
|
||||
name={tag}
|
||||
navigation={navigation}
|
||||
truncate
|
||||
/>
|
||||
<Tag style={subscriptionsStyle.tag} key={tag} name={tag} navigation={navigation} truncate />
|
||||
))}
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
|
||||
{claim && (
|
||||
<SubscribeButtonOverlay
|
||||
claim={claim}
|
||||
style={subscriptionsStyle.suggestedItemSubscribeOverlay}
|
||||
uri={normalizeURI(claim.permanent_url)}
|
||||
/>
|
||||
<SubscribeButton style={subscriptionsStyle.suggestedItemSubscribe} uri={normalizeURI(claim.permanent_url)} />
|
||||
)}
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
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);
|
||||
@@ -1,111 +0,0 @@
|
||||
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() {
|
||||
const { name, numberOfLines, onPress, style, type, truncate } = this.props;
|
||||
const { name, onPress, style, type, truncate } = this.props;
|
||||
|
||||
let styles = [];
|
||||
if (style) {
|
||||
@@ -50,9 +50,7 @@ export default class Tag extends React.PureComponent {
|
||||
return (
|
||||
<TouchableOpacity style={styles} onPress={onPress || this.onPressDefault}>
|
||||
<View style={tagStyle.content}>
|
||||
<Text style={tagStyle.text} numberOfLines={numberOfLines}>
|
||||
{truncate ? formatTagName(name) : name}
|
||||
</Text>
|
||||
<Text style={tagStyle.text}>{truncate ? formatTagName(name) : name}</Text>
|
||||
{type && <Icon style={tagStyle.icon} name={type === 'add' ? 'plus' : 'times'} size={8} />}
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
|
||||
@@ -74,7 +74,7 @@ export default class TagSearch extends React.PureComponent {
|
||||
<TextInput
|
||||
editable={editable}
|
||||
style={tagStyle.searchInput}
|
||||
placeholder={__('Search for more tags')}
|
||||
placeholder={'Search for more tags'}
|
||||
underlineColorAndroid={Colors.NextLbryGreen}
|
||||
value={this.state.tag}
|
||||
numberOfLines={1}
|
||||
|
||||
@@ -26,7 +26,7 @@ class TransactionListRecent extends React.PureComponent<Props> {
|
||||
return (
|
||||
<View style={walletStyle.transactionsCard}>
|
||||
<View style={[walletStyle.row, walletStyle.transactionsHeader]}>
|
||||
<Text style={walletStyle.transactionsTitle}>{__('Recent Transactions')}</Text>
|
||||
<Text style={walletStyle.transactionsTitle}>Recent Transactions</Text>
|
||||
<Link style={walletStyle.link} navigation={navigation} text={__('View All')} href={'#TransactionHistory'} />
|
||||
</View>
|
||||
{fetchingTransactions && <Text style={walletStyle.infoText}>{__('Fetching transactions...')}</Text>}
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
selectSearchSuggestions,
|
||||
SETTINGS,
|
||||
} from 'lbry-redux';
|
||||
import { doSetPlayerVisible } from 'redux/actions/drawer';
|
||||
import { selectCurrentRoute } from 'redux/selectors/drawer';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
import UriBar from './view';
|
||||
@@ -25,10 +24,9 @@ const select = state => {
|
||||
|
||||
const perform = dispatch => ({
|
||||
updateSearchQuery: query => dispatch(doUpdateSearchQuery(query)),
|
||||
setPlayerVisible: (visible, uri) => dispatch(doSetPlayerVisible(visible, uri)),
|
||||
});
|
||||
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
perform
|
||||
)(UriBar);
|
||||
@@ -1,14 +1,13 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import { SEARCH_TYPES, isNameValid, isURIValid, normalizeURI } from 'lbry-redux';
|
||||
import { Alert, Dimensions, FlatList, Keyboard, Text, TextInput, TouchableOpacity, View } from 'react-native';
|
||||
import { Dimensions, FlatList, Keyboard, Text, TextInput, TouchableOpacity, View } from 'react-native';
|
||||
import { navigateToUri, transformUrl } from 'utils/helper';
|
||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import UriBarItem from './internal/uri-bar-item';
|
||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||
import NavigationButton from 'component/navigationButton';
|
||||
import uriBarStyle from 'styles/uriBar';
|
||||
import { NavigationActions, StackActions } from 'react-navigation';
|
||||
|
||||
class UriBar extends React.PureComponent {
|
||||
static INPUT_TIMEOUT = 2500; // 2.5 seconds
|
||||
@@ -19,20 +18,18 @@ class UriBar extends React.PureComponent {
|
||||
|
||||
keyboardDidHideListener = null;
|
||||
|
||||
changeTextTimeout = -1;
|
||||
|
||||
state = {
|
||||
changeTextTimeout: null,
|
||||
currentValue: null,
|
||||
inputText: null,
|
||||
focused: false,
|
||||
keyboardHeight: 0,
|
||||
selection: undefined,
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this._keyboardDidShow);
|
||||
this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide);
|
||||
this.setState({ selection: { start: 0, end: 0 } });
|
||||
this.setSelection();
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
@@ -54,14 +51,15 @@ class UriBar extends React.PureComponent {
|
||||
}
|
||||
|
||||
handleChangeText = text => {
|
||||
this.setState({ selection: undefined });
|
||||
const newValue = text || '';
|
||||
clearTimeout(this.changeTextTimeout);
|
||||
clearTimeout(this.state.changeTextTimeout);
|
||||
const { updateSearchQuery, onSearchSubmitted, showUriBarSuggestions, navigation } = this.props;
|
||||
|
||||
this.changeTextTimeout = -1;
|
||||
updateSearchQuery(text);
|
||||
|
||||
let timeout = -1;
|
||||
if (!showUriBarSuggestions) {
|
||||
this.changeTextTimeout = setTimeout(() => {
|
||||
timeout = setTimeout(() => {
|
||||
if (text.trim().length === 0) {
|
||||
// don't do anything if the text is empty
|
||||
return;
|
||||
@@ -69,7 +67,6 @@ class UriBar extends React.PureComponent {
|
||||
|
||||
if (!text.startsWith('lbry://')) {
|
||||
// not a URI input, so this is a search, perform a direct search
|
||||
updateSearchQuery(text);
|
||||
if (onSearchSubmitted) {
|
||||
onSearchSubmitted(text);
|
||||
} else {
|
||||
@@ -77,14 +74,12 @@ class UriBar extends React.PureComponent {
|
||||
}
|
||||
}
|
||||
}, UriBar.INPUT_TIMEOUT);
|
||||
} else {
|
||||
updateSearchQuery(text);
|
||||
}
|
||||
this.setState({ inputText: newValue, currentValue: newValue });
|
||||
this.setState({ inputText: newValue, currentValue: newValue, changeTextTimeout: timeout });
|
||||
};
|
||||
|
||||
handleItemPress = item => {
|
||||
const { navigation, onSearchSubmitted, setPlayerVisible, updateSearchQuery } = this.props;
|
||||
const { navigation, onSearchSubmitted, updateSearchQuery } = this.props;
|
||||
const { type, value } = item;
|
||||
|
||||
Keyboard.dismiss();
|
||||
@@ -113,7 +108,7 @@ class UriBar extends React.PureComponent {
|
||||
});
|
||||
} else {
|
||||
const uri = normalizeURI(value);
|
||||
navigateToUri(navigation, uri, null, false, null, setPlayerVisible);
|
||||
navigateToUri(navigation, uri);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -128,8 +123,14 @@ class UriBar extends React.PureComponent {
|
||||
this.setState({ focused: false, keyboardHeight: 0 });
|
||||
};
|
||||
|
||||
setSelection() {
|
||||
if (this.textInput) {
|
||||
this.textInput.setNativeProps({ selection: { start: 0, end: 0 } });
|
||||
}
|
||||
}
|
||||
|
||||
handleSubmitEditing = () => {
|
||||
const { navigation, onSearchSubmitted, setPlayerVisible, updateSearchQuery } = this.props;
|
||||
const { navigation, onSearchSubmitted, updateSearchQuery } = this.props;
|
||||
if (this.state.inputText) {
|
||||
let inputText = this.state.inputText,
|
||||
inputTextIsUrl = false;
|
||||
@@ -138,7 +139,7 @@ class UriBar extends React.PureComponent {
|
||||
// if it's a URI (lbry://...), open the file page
|
||||
if (transformedUrl && isURIValid(transformedUrl)) {
|
||||
inputTextIsUrl = true;
|
||||
navigateToUri(navigation, transformedUrl, null, false, null, setPlayerVisible);
|
||||
navigateToUri(navigation, transformedUrl);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,58 +159,9 @@ class UriBar extends React.PureComponent {
|
||||
}
|
||||
};
|
||||
|
||||
handleFocus = () => {
|
||||
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();
|
||||
}
|
||||
};
|
||||
onSearchPageBlurred() {
|
||||
this.setState({ currenValueSet: false });
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
@@ -290,7 +242,7 @@ class UriBar extends React.PureComponent {
|
||||
size={24}
|
||||
style={uriBarStyle.drawerMenuButton}
|
||||
iconStyle={uriBarStyle.drawerHamburger}
|
||||
onPress={this.handleNavigationButtonPress}
|
||||
onPress={() => navigation.openDrawer()}
|
||||
/>
|
||||
)}
|
||||
{!selectionMode && (
|
||||
@@ -298,10 +250,12 @@ class UriBar extends React.PureComponent {
|
||||
ref={ref => {
|
||||
this.textInput = ref;
|
||||
}}
|
||||
onTouchStart={this.handleTouchStart}
|
||||
autoCorrect={false}
|
||||
style={uriBarStyle.uriText}
|
||||
selection={this.state.selection}
|
||||
onLayout={() => {
|
||||
this.setSelection();
|
||||
}}
|
||||
selectTextOnFocus
|
||||
placeholder={__('Search movies, music, and more')}
|
||||
underlineColorAndroid={'transparent'}
|
||||
numberOfLines={1}
|
||||
@@ -310,8 +264,11 @@ class UriBar extends React.PureComponent {
|
||||
returnKeyType={'go'}
|
||||
inlineImageLeft={'baseline_search_black_24'}
|
||||
inlineImagePadding={16}
|
||||
onFocus={this.handleFocus}
|
||||
onBlur={this.handleBlur}
|
||||
onFocus={() => this.setState({ focused: true })}
|
||||
onBlur={() => {
|
||||
this.setState({ focused: false });
|
||||
this.setSelection();
|
||||
}}
|
||||
onChangeText={this.handleChangeText}
|
||||
onSubmitEditing={this.handleSubmitEditing}
|
||||
/>
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
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);
|
||||
@@ -1,54 +0,0 @@
|
||||
// @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;
|
||||
@@ -1,10 +1,9 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { selectUnclaimedRewardValue, selectUser } from 'lbryinc';
|
||||
import { selectUnclaimedRewardValue } from 'lbryinc';
|
||||
import WalletRewardsDriver from './view';
|
||||
|
||||
const select = state => ({
|
||||
unclaimedRewardAmount: selectUnclaimedRewardValue(state),
|
||||
user: selectUser(state),
|
||||
});
|
||||
|
||||
export default connect(select)(WalletRewardsDriver);
|
||||
@@ -5,31 +5,15 @@ import walletStyle from 'styles/wallet';
|
||||
|
||||
class WalletRewardsDriver extends React.PureComponent<Props> {
|
||||
render() {
|
||||
const { navigation, unclaimedRewardAmount, user } = this.props;
|
||||
const signedIn = user && user.has_verified_email;
|
||||
const { navigation, unclaimedRewardAmount } = this.props;
|
||||
|
||||
return (
|
||||
<TouchableOpacity style={walletStyle.rewardDriverCard} onPress={() => navigation.navigate('Rewards')}>
|
||||
<Icon name="award" size={16} style={walletStyle.rewardIcon} />
|
||||
{signedIn && (
|
||||
<Text style={walletStyle.rewardDriverText}>
|
||||
{unclaimedRewardAmount === 0 && __('Free credits available in rewards.')}
|
||||
{unclaimedRewardAmount === 1 &&
|
||||
__('%amount% free credit available in rewards.', { amount: unclaimedRewardAmount })}
|
||||
{unclaimedRewardAmount > 1 &&
|
||||
__('%amount% free credits available in rewards.', { amount: unclaimedRewardAmount })}{' '}
|
||||
{__('Tap to learn more.')}
|
||||
</Text>
|
||||
)}
|
||||
|
||||
{!signedIn && (
|
||||
<Text style={walletStyle.rewardDriverText}>
|
||||
{unclaimedRewardAmount === 1 &&
|
||||
__('Get %amount% free credit after creating an account.', { amount: unclaimedRewardAmount })}
|
||||
{unclaimedRewardAmount !== 1 &&
|
||||
__('Get %amount% free credits after creating an account.', { amount: unclaimedRewardAmount })}
|
||||
</Text>
|
||||
)}
|
||||
<Text style={walletStyle.rewardDriverText}>
|
||||
Get {unclaimedRewardAmount > 0 ? unclaimedRewardAmount : ''} free credit
|
||||
{unclaimedRewardAmount === 1 ? '' : 's'} after creating an account.
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import { formatCredits, regexAddress } from 'lbry-redux';
|
||||
import { regexAddress } from 'lbry-redux';
|
||||
import { Alert, Clipboard, TextInput, Text, View } from 'react-native';
|
||||
import Button from 'component/button';
|
||||
import Colors from 'styles/colors';
|
||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||
import walletStyle from 'styles/wallet';
|
||||
|
||||
type DraftTransaction = {
|
||||
@@ -25,7 +24,6 @@ class WalletSend extends React.PureComponent<Props> {
|
||||
address: null,
|
||||
addressChanged: false,
|
||||
addressValid: false,
|
||||
creditsInputFocused: false,
|
||||
};
|
||||
|
||||
componentWillUpdate(nextProps) {
|
||||
@@ -38,10 +36,9 @@ class WalletSend extends React.PureComponent<Props> {
|
||||
handleSend = () => {
|
||||
const { balance, sendToAddress, notify } = this.props;
|
||||
const { address, amount } = this.state;
|
||||
if (address && (!regexAddress.test(address) || address.substring(0, 1) === 'r')) {
|
||||
if (address && !regexAddress.test(address)) {
|
||||
notify({
|
||||
message: __('The recipient address is not a valid LBRY address.'),
|
||||
isError: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -49,7 +46,6 @@ class WalletSend extends React.PureComponent<Props> {
|
||||
if (amount > balance) {
|
||||
notify({
|
||||
message: __('Insufficient credits'),
|
||||
isError: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -74,7 +70,6 @@ class WalletSend extends React.PureComponent<Props> {
|
||||
const { notify } = this.props;
|
||||
notify({
|
||||
message: __('The recipient address is not a valid LBRY address.'),
|
||||
isError: true,
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -100,10 +95,9 @@ class WalletSend extends React.PureComponent<Props> {
|
||||
this.setState({
|
||||
address: value,
|
||||
addressChanged: true,
|
||||
addressValid: value.trim().length === 0 || (regexAddress.test(value) && !value.startsWith('r')),
|
||||
addressValid: value.trim().length === 0 || regexAddress.test(value),
|
||||
})
|
||||
}
|
||||
numberOfLines={1}
|
||||
onBlur={this.handleAddressInputBlur}
|
||||
onSubmitEditing={this.handleAddressInputSubmit}
|
||||
placeholder={'bbFxRyXXXXXXXXXXXZD8nE7XTLUxYnddTs'}
|
||||
@@ -124,8 +118,6 @@ class WalletSend extends React.PureComponent<Props> {
|
||||
<TextInput
|
||||
ref={ref => (this.amountInput = ref)}
|
||||
onChangeText={value => this.setState({ amount: value })}
|
||||
onFocus={() => this.setState({ creditsInputFocused: true })}
|
||||
onBlur={() => this.setState({ creditsInputFocused: false })}
|
||||
keyboardType={'numeric'}
|
||||
placeholder={'0'}
|
||||
underlineColorAndroid={Colors.NextLbryGreen}
|
||||
@@ -133,15 +125,9 @@ class WalletSend extends React.PureComponent<Props> {
|
||||
style={[walletStyle.input, walletStyle.amountInput]}
|
||||
/>
|
||||
<Text style={[walletStyle.text, walletStyle.currency]}>LBC</Text>
|
||||
<View style={walletStyle.balanceFocus}>
|
||||
{this.state.creditsInputFocused && <Icon name="coins" size={12} />}
|
||||
{this.state.creditsInputFocused && (
|
||||
<Text style={walletStyle.balanceText}>{formatCredits(parseFloat(balance), 1, true)}</Text>
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
<Button
|
||||
text={__('Send')}
|
||||
text={'Send'}
|
||||
style={[walletStyle.button, walletStyle.sendButton]}
|
||||
disabled={!canSend}
|
||||
onPress={this.handleSend}
|
||||
|
||||
@@ -29,12 +29,14 @@ class WalletSignIn extends React.Component {
|
||||
return (
|
||||
<View style={walletStyle.signInContainer}>
|
||||
<View style={walletStyle.signInSummaryRow}>
|
||||
<Text style={walletStyle.signInTitle}>{__('Account Recommended')}</Text>
|
||||
<Text style={walletStyle.signInTitle}>Account Recommended</Text>
|
||||
</View>
|
||||
|
||||
<View style={walletStyle.onboarding}>
|
||||
<Text style={walletStyle.onboardingText}>
|
||||
{__('A lbry.tv account allows you to earn rewards, backup your wallet, and keep everything in sync.')}
|
||||
{__(
|
||||
'An account with LBRY Inc. allows you to earn rewards, backup your wallet, and keep everything synced.'
|
||||
)}
|
||||
{'\n\n'}
|
||||
{__('Without an account, you assume all responsibility for securing your wallet and LBRY data.')}
|
||||
</Text>
|
||||
|
||||
+2
-12
@@ -64,8 +64,6 @@ const Constants = {
|
||||
ACTION_CLEAR_PUBLISH_FORM_STATE: 'CLEAR_PUBLISH_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',
|
||||
|
||||
ORIENTATION_HORIZONTAL: 'horizontal',
|
||||
@@ -92,14 +90,11 @@ const Constants = {
|
||||
DRAWER_ROUTE_TAG: 'Tag',
|
||||
DRAWER_ROUTE_CHANNEL_CREATOR: 'ChannelCreator',
|
||||
DRAWER_ROUTE_CHANNEL_CREATOR_FORM: 'ChannnelCreatorForm',
|
||||
DRAWER_ROUTE_INVITES: 'Invites',
|
||||
DRAWER_ROUTE_LITE_FILE: 'LiteFile',
|
||||
|
||||
FULL_ROUTE_NAME_DISCOVER: 'DiscoverStack',
|
||||
FULL_ROUTE_NAME_WALLET: 'WalletStack',
|
||||
|
||||
ROUTE_FILE: 'File',
|
||||
DRAWER_ROUTE_FILE_VIEW: 'FileView',
|
||||
|
||||
ITEM_CREATE_A_CHANNEL: 'Create a channel...',
|
||||
ITEM_ANONYMOUS: 'Publish anonymously',
|
||||
@@ -138,7 +133,7 @@ const Constants = {
|
||||
|
||||
ORDER_BY_EFFECTIVE_AMOUNT: 'effective_amount',
|
||||
|
||||
DEFAULT_PAGE_SIZE: 20,
|
||||
DEFAULT_PAGE_SIZE: 10,
|
||||
|
||||
ALL_PLACEHOLDER: '_all',
|
||||
|
||||
@@ -169,12 +164,7 @@ export const DrawerRoutes = [
|
||||
Constants.DRAWER_ROUTE_SEARCH,
|
||||
Constants.DRAWER_ROUTE_TRANSACTION_HISTORY,
|
||||
Constants.DRAWER_ROUTE_CHANNEL_CREATOR,
|
||||
Constants.DRAWER_ROUTE_INVITES,
|
||||
];
|
||||
|
||||
// sub-pages for main routes
|
||||
export const InnerDrawerRoutes = [
|
||||
Constants.DRAWER_ROUTE_CHANNEL_CREATOR_FORM,
|
||||
Constants.DRAWER_ROUTE_PUBLISH_FORM,
|
||||
Constants.DRAWER_ROUTE_FILE_VIEW,
|
||||
];
|
||||
export const InnerDrawerRoutes = [Constants.DRAWER_ROUTE_CHANNEL_CREATOR_FORM, Constants.DRAWER_ROUTE_PUBLISH_FORM];
|
||||
+3
-4
@@ -52,9 +52,8 @@ function checkMessageAndSave(message, messagesFilePath) {
|
||||
); */
|
||||
})
|
||||
.catch(err => {
|
||||
if (err && !isProduction) {
|
||||
// only do this when not in production
|
||||
console.error(err);
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -75,6 +74,6 @@ export function __(message, tokens) {
|
||||
}
|
||||
|
||||
return translatedMessage.replace(/%([^%]+)%/g, function($1, $2) {
|
||||
return tokens.hasOwnProperty($2) ? tokens[$2] : $2;
|
||||
return tokens[$2] || $2;
|
||||
});
|
||||
}
|
||||
+6
-12
@@ -27,7 +27,6 @@ import {
|
||||
homepageReducer,
|
||||
rewardsReducer,
|
||||
selectUserVerifiedEmail,
|
||||
statsReducer,
|
||||
subscriptionsReducer,
|
||||
syncReducer,
|
||||
userReducer,
|
||||
@@ -42,7 +41,6 @@ import AppWithNavigationState, {
|
||||
} from 'component/AppNavigator';
|
||||
import { REHYDRATE, PURGE, persistCombineReducers, persistStore } from 'redux-persist';
|
||||
import { __ } from 'i18n';
|
||||
import reactotron from '../reactotron';
|
||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import getStoredStateMigrateV4 from 'redux-persist/lib/integration/getStoredStateMigrateV4';
|
||||
import FilesystemStorage from 'redux-persist-filesystem-storage';
|
||||
@@ -58,8 +56,7 @@ window.__ = __;
|
||||
|
||||
const globalExceptionHandler = (error, isFatal) => {
|
||||
if (error && NativeModules.Firebase) {
|
||||
console.log(error);
|
||||
NativeModules.Firebase.logException(!!isFatal, error.message ? error.message : 'No message', JSON.stringify(error));
|
||||
NativeModules.Firebase.logException(isFatal, error.message ? error.message : 'No message', JSON.stringify(error));
|
||||
}
|
||||
};
|
||||
setJSExceptionHandler(globalExceptionHandler, true);
|
||||
@@ -96,7 +93,6 @@ const compressor = createCompressor();
|
||||
const authFilter = createFilter('auth', ['authToken']);
|
||||
const blockedFilter = createFilter('blocked', ['blockedChannels']);
|
||||
const contentFilter = createFilter('content', ['positions']);
|
||||
const drawerFilter = createFilter('drawer', ['lastRouteInStack']);
|
||||
const saveClaimsFilter = createFilter('claims', ['claimsByUri']);
|
||||
const subscriptionsFilter = createFilter('subscriptions', ['enabledChannelNotifications', 'subscriptions', 'latest']);
|
||||
const settingsFilter = createFilter('settings', ['clientSettings']);
|
||||
@@ -104,13 +100,12 @@ const tagsFilter = createFilter('tags', ['followedTags']);
|
||||
const walletFilter = createFilter('wallet', ['receiveAddress']);
|
||||
|
||||
const v4PersistOptions = {
|
||||
whitelist: ['auth', 'blocked', 'claims', 'drawer', 'content', 'subscriptions', 'settings', 'tags', 'wallet'],
|
||||
whitelist: ['auth', 'blocked', 'claims', 'content', 'subscriptions', 'settings', 'tags', 'wallet'],
|
||||
// Order is important. Needs to be compressed last or other transforms can't
|
||||
// read the data
|
||||
transforms: [
|
||||
authFilter,
|
||||
blockedFilter,
|
||||
drawerFilter,
|
||||
saveClaimsFilter,
|
||||
subscriptionsFilter,
|
||||
settingsFilter,
|
||||
@@ -145,7 +140,6 @@ const reducers = persistCombineReducers(persistOptions, {
|
||||
rewards: rewardsReducer,
|
||||
settings: settingsReducer,
|
||||
search: searchReducer,
|
||||
stats: statsReducer,
|
||||
subscriptions: subscriptionsReducer,
|
||||
sync: syncReducer,
|
||||
tags: tagsReducer,
|
||||
@@ -183,7 +177,7 @@ const sharedStateCallback = ({ dispatch, getState }) => {
|
||||
const emailVerified = selectUserVerifiedEmail(state);
|
||||
if (syncEnabled && emailVerified) {
|
||||
NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(password =>
|
||||
dispatch(doGetSync(password)),
|
||||
dispatch(doGetSync(password))
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -199,13 +193,13 @@ const composeEnhancers = compose;
|
||||
const store = createStore(
|
||||
enableBatching(reducers),
|
||||
{}, // initial state,
|
||||
composeEnhancers(applyMiddleware(...middleware), reactotron.createEnhancer()),
|
||||
composeEnhancers(applyMiddleware(...middleware))
|
||||
);
|
||||
window.store = store;
|
||||
|
||||
const persistor = persistStore(store, null, err => {
|
||||
const persistor = persistStore(store, persistOptions, err => {
|
||||
if (err) {
|
||||
// console.log('Unable to load saved SETTINGS');
|
||||
console.log('Unable to load saved SETTINGS');
|
||||
}
|
||||
});
|
||||
window.persistor = persistor;
|
||||
|
||||
+9
-20
@@ -10,7 +10,6 @@ import aboutStyle from 'styles/about';
|
||||
class AboutPage extends React.PureComponent {
|
||||
state = {
|
||||
appVersion: null,
|
||||
firebaseToken: null,
|
||||
lbryId: null,
|
||||
versionInfo: null,
|
||||
};
|
||||
@@ -46,12 +45,11 @@ class AboutPage extends React.PureComponent {
|
||||
setPlayerVisible();
|
||||
|
||||
NativeModules.Firebase.setCurrentScreen('About').then(result => {
|
||||
NativeModules.VersionInfo.getAppVersion().then(version => {
|
||||
this.setState({ appVersion: version });
|
||||
});
|
||||
NativeModules.Firebase.getMessagingToken().then(firebaseToken => {
|
||||
this.setState({ firebaseToken });
|
||||
});
|
||||
if (NativeModules.VersionInfo) {
|
||||
NativeModules.VersionInfo.getAppVersion().then(version => {
|
||||
this.setState({ appVersion: version });
|
||||
});
|
||||
}
|
||||
Lbry.version().then(info => {
|
||||
this.setState({
|
||||
versionInfo: info,
|
||||
@@ -76,10 +74,10 @@ class AboutPage extends React.PureComponent {
|
||||
<View style={aboutStyle.container}>
|
||||
<PageHeader title={'About LBRY'} onBackPressed={() => navigateBack(navigation, drawerStack, popDrawerStack)} />
|
||||
<ScrollView style={aboutStyle.scrollContainer}>
|
||||
<Text style={aboutStyle.title}>{__('Content Freedom')}</Text>
|
||||
<Text style={aboutStyle.title}>Content Freedom</Text>
|
||||
<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>
|
||||
<View style={aboutStyle.links}>
|
||||
@@ -87,10 +85,10 @@ class AboutPage extends React.PureComponent {
|
||||
<Link style={aboutStyle.link} href="https://lbry.com/faq/android-basics" text={__('Android App Basics')} />
|
||||
<Link style={aboutStyle.link} href="https://lbry.com/faq" text={__('Frequently Asked Questions')} />
|
||||
</View>
|
||||
<Text style={aboutStyle.socialTitle}>{__('Get Social')}</Text>
|
||||
<Text style={aboutStyle.socialTitle}>Get Social</Text>
|
||||
<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>
|
||||
<View style={aboutStyle.links}>
|
||||
@@ -166,15 +164,6 @@ class AboutPage extends React.PureComponent {
|
||||
</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.col}>
|
||||
<Text style={aboutStyle.text}>{__('Logs')}</Text>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doAbandonClaim, doFetchChannelListMine, makeSelectClaimForUri, selectMyChannelClaims } from 'lbry-redux';
|
||||
import { doFetchSubCount, makeSelectSubCountForUri } from 'lbryinc';
|
||||
import { doPopDrawerStack } from 'redux/actions/drawer';
|
||||
import { doSetSortByItem, doSetTimeItem } from 'redux/actions/settings';
|
||||
import { selectDrawerStack } from 'redux/selectors/drawer';
|
||||
@@ -12,14 +11,12 @@ const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
drawerStack: selectDrawerStack(state),
|
||||
sortByItem: selectSortByItem(state),
|
||||
subCount: makeSelectSubCountForUri(props.uri)(state),
|
||||
timeItem: selectTimeItem(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
abandonClaim: (txid, nout) => dispatch(doAbandonClaim(txid, nout)),
|
||||
fetchChannelListMine: () => dispatch(doFetchChannelListMine(1, 99999, true)),
|
||||
fetchSubCount: claimId => dispatch(doFetchSubCount(claimId)),
|
||||
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
||||
popDrawerStack: () => dispatch(doPopDrawerStack()),
|
||||
setSortByItem: item => dispatch(doSetSortByItem(item)),
|
||||
setTimeItem: item => dispatch(doSetTimeItem(item)),
|
||||
@@ -27,5 +24,5 @@ const perform = dispatch => ({
|
||||
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
perform
|
||||
)(ChannelPage);
|
||||
+17
-47
@@ -23,7 +23,6 @@ import EmptyStateView from 'component/emptyStateView';
|
||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||
import Link from 'component/link';
|
||||
import ModalPicker from 'component/modalPicker';
|
||||
import ModalTipView from 'component/modalTipView';
|
||||
import PageHeader from 'component/pageHeader';
|
||||
import SubscribeButton from 'component/subscribeButton';
|
||||
import SubscribeNotificationButton from 'component/subscribeNotificationButton';
|
||||
@@ -37,10 +36,8 @@ class ChannelPage extends React.PureComponent {
|
||||
autoStyle: null,
|
||||
showSortPicker: false,
|
||||
showTimePicker: false,
|
||||
showTipView: false,
|
||||
orderBy: ['release_time'], // sort by new by default
|
||||
activeTab: Constants.CONTENT_TAB,
|
||||
currentSortByItem: Constants.CLAIM_SEARCH_SORT_BY_ITEMS[1], // should always default to sorting channel pages by new
|
||||
};
|
||||
|
||||
componentWillMount() {
|
||||
@@ -51,17 +48,16 @@ class ChannelPage extends React.PureComponent {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { claim, fetchChannelListMine, fetchSubCount } = this.props;
|
||||
const { fetchChannelListMine, setSortByItem } = this.props;
|
||||
NativeModules.Firebase.setCurrentScreen('Channel');
|
||||
setSortByItem(Constants.CLAIM_SEARCH_SORT_BY_ITEMS[1]); // sort by newest first
|
||||
fetchChannelListMine();
|
||||
if (claim) {
|
||||
fetchSubCount(claim.claim_id);
|
||||
}
|
||||
}
|
||||
|
||||
handleSortByItemSelected = item => {
|
||||
// sort by specific only to this component state
|
||||
this.setState({ currentSortByItem: item, orderBy: getOrderBy(item), showSortPicker: false });
|
||||
const { setSortByItem } = this.props;
|
||||
setSortByItem(item);
|
||||
this.setState({ orderBy: getOrderBy(item), showSortPicker: false });
|
||||
};
|
||||
|
||||
handleTimeItemSelected = item => {
|
||||
@@ -71,18 +67,17 @@ class ChannelPage extends React.PureComponent {
|
||||
};
|
||||
|
||||
listHeader = () => {
|
||||
const { timeItem } = this.props;
|
||||
const { currentSortByItem } = this.state;
|
||||
const { sortByItem, timeItem } = this.props;
|
||||
|
||||
return (
|
||||
<View style={channelPageStyle.listHeader}>
|
||||
<View style={discoverStyle.pickerRow}>
|
||||
<View style={discoverStyle.leftPickerRow}>
|
||||
<TouchableOpacity style={discoverStyle.tagSortBy} onPress={() => this.setState({ showSortPicker: true })}>
|
||||
<Text style={discoverStyle.tagSortText}>{__(currentSortByItem.label.split(' ')[0])}</Text>
|
||||
<Text style={discoverStyle.tagSortText}>{__(sortByItem.label.split(' ')[0])}</Text>
|
||||
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
|
||||
</TouchableOpacity>
|
||||
{Constants.SORT_BY_TOP === currentSortByItem.name && (
|
||||
{Constants.SORT_BY_TOP === sortByItem.name && (
|
||||
<TouchableOpacity style={discoverStyle.tagTime} onPress={() => this.setState({ showTimePicker: true })}>
|
||||
<Text style={discoverStyle.tagSortText}>{__(timeItem.label)}</Text>
|
||||
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
|
||||
@@ -173,14 +168,9 @@ class ChannelPage extends React.PureComponent {
|
||||
const { permanent_url: permanentUrl } = claim;
|
||||
navigation.navigate({
|
||||
routeName: Constants.DRAWER_ROUTE_CHANNEL_CREATOR,
|
||||
params: { editChannelUrl: permanentUrl, returnUrl: permanentUrl },
|
||||
params: { editChannelUrl: permanentUrl },
|
||||
});
|
||||
}
|
||||
this.onEditPressed = null;
|
||||
};
|
||||
|
||||
onTipPressed = () => {
|
||||
this.setState({ showTipView: true });
|
||||
};
|
||||
|
||||
onSharePressed = () => {
|
||||
@@ -211,15 +201,15 @@ class ChannelPage extends React.PureComponent {
|
||||
},
|
||||
},
|
||||
],
|
||||
{ cancelable: true },
|
||||
{ cancelable: true }
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { channels, claim, navigation, uri, drawerStack, popDrawerStack, subCount, timeItem } = this.props;
|
||||
const { channels, claim, navigation, uri, drawerStack, popDrawerStack, sortByItem, timeItem } = this.props;
|
||||
const { name, permanent_url: permanentUrl } = claim;
|
||||
const { autoStyle, currentSortByItem, showSortPicker, showTimePicker, showTipView } = this.state;
|
||||
const { autoStyle, showSortPicker, showTimePicker } = this.state;
|
||||
const ownedChannel = channels ? channels.map(channel => channel.permanent_url).includes(permanentUrl) : false;
|
||||
|
||||
let thumbnailUrl,
|
||||
@@ -262,10 +252,6 @@ class ChannelPage extends React.PureComponent {
|
||||
|
||||
<View style={channelPageStyle.channelHeader}>
|
||||
<Text style={channelPageStyle.channelName}>{title && title.trim().length > 0 ? title : name}</Text>
|
||||
<Text style={[channelPageStyle.followerCount, subCount >= 1 ? channelPageStyle.followerCountBg : null]}>
|
||||
{subCount === 1 && __('%follower% follower', { follower: subCount })}
|
||||
{subCount > 1 && __('%follower% followers', { follower: subCount })}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View style={[channelPageStyle.avatarImageContainer, autoStyle]}>
|
||||
@@ -285,7 +271,7 @@ class ChannelPage extends React.PureComponent {
|
||||
style={channelPageStyle.actionButton}
|
||||
theme={'light'}
|
||||
icon={'edit'}
|
||||
text={__('Edit')}
|
||||
text={'Edit'}
|
||||
onPress={this.onEditPressed}
|
||||
/>
|
||||
)}
|
||||
@@ -294,7 +280,7 @@ class ChannelPage extends React.PureComponent {
|
||||
style={[channelPageStyle.actionButton, channelPageStyle.deleteButton]}
|
||||
theme={'light'}
|
||||
icon={'trash-alt'}
|
||||
text={__('Delete')}
|
||||
text={'Delete'}
|
||||
onPress={this.onDeletePressed}
|
||||
/>
|
||||
)}
|
||||
@@ -304,12 +290,6 @@ class ChannelPage extends React.PureComponent {
|
||||
icon={'share-alt'}
|
||||
onPress={this.onSharePressed}
|
||||
/>
|
||||
<Button
|
||||
style={[channelPageStyle.actionButton, channelPageStyle.tipButton]}
|
||||
theme={'light'}
|
||||
icon={'gift'}
|
||||
onPress={this.onTipPressed}
|
||||
/>
|
||||
{!ownedChannel && <SubscribeButton style={channelPageStyle.subscribeButton} uri={fullUri} name={name} />}
|
||||
{false && !ownedChannel && (
|
||||
<SubscribeNotificationButton
|
||||
@@ -326,14 +306,14 @@ class ChannelPage extends React.PureComponent {
|
||||
style={channelPageStyle.tab}
|
||||
onPress={() => this.setState({ activeTab: Constants.CONTENT_TAB })}
|
||||
>
|
||||
<Text style={channelPageStyle.tabTitle}>{__('CONTENT')}</Text>
|
||||
<Text style={channelPageStyle.tabTitle}>CONTENT</Text>
|
||||
{Constants.CONTENT_TAB === this.state.activeTab && <View style={channelPageStyle.activeTabHint} />}
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity
|
||||
style={channelPageStyle.tab}
|
||||
onPress={() => this.setState({ activeTab: Constants.ABOUT_TAB })}
|
||||
>
|
||||
<Text style={channelPageStyle.tabTitle}>{__('ABOUT')}</Text>
|
||||
<Text style={channelPageStyle.tabTitle}>ABOUT</Text>
|
||||
{Constants.ABOUT_TAB === this.state.activeTab && <View style={channelPageStyle.activeTabHint} />}
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
@@ -347,7 +327,7 @@ class ChannelPage extends React.PureComponent {
|
||||
title={__('Sort content by')}
|
||||
onOverlayPress={() => this.setState({ showSortPicker: false })}
|
||||
onItemSelected={this.handleSortByItemSelected}
|
||||
selectedItem={currentSortByItem}
|
||||
selectedItem={sortByItem}
|
||||
items={Constants.CLAIM_SEARCH_SORT_BY_ITEMS}
|
||||
/>
|
||||
)}
|
||||
@@ -360,16 +340,6 @@ class ChannelPage extends React.PureComponent {
|
||||
items={Constants.CLAIM_SEARCH_TIME_ITEMS}
|
||||
/>
|
||||
)}
|
||||
{showTipView && (
|
||||
<ModalTipView
|
||||
claim={claim}
|
||||
channelName={claim.name}
|
||||
contentName={title}
|
||||
onCancelPress={() => this.setState({ showTipView: false })}
|
||||
onOverlayPress={() => this.setState({ showTipView: false })}
|
||||
onSendTipSuccessful={() => this.setState({ showTipView: false })}
|
||||
/>
|
||||
)}
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -13,12 +13,7 @@ import {
|
||||
doToast,
|
||||
} from 'lbry-redux';
|
||||
import { doGetSync } from 'lbryinc';
|
||||
import {
|
||||
doPushDrawerStack,
|
||||
doPopDrawerStack,
|
||||
doSetPlayerVisible,
|
||||
doSetExplicitNavigateBack,
|
||||
} from 'redux/actions/drawer';
|
||||
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';
|
||||
@@ -42,17 +37,16 @@ const perform = dispatch => ({
|
||||
notify: data => dispatch(doToast(data)),
|
||||
clearChannelFormState: () => dispatch(doClearChannelFormState()),
|
||||
createChannel: (name, amount, optionalParams) => dispatch(doCreateChannel(name, amount, optionalParams)),
|
||||
fetchChannelListMine: () => dispatch(doFetchChannelListMine(1, 99999, true)),
|
||||
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
||||
getSync: (password, callback) => dispatch(doGetSync(password, callback)),
|
||||
updateChannel: params => dispatch(doUpdateChannel(params)),
|
||||
updateChannelFormState: data => dispatch(doUpdateChannelFormState(data)),
|
||||
pushDrawerStack: (routeName, params) => dispatch(doPushDrawerStack(routeName, params)),
|
||||
popDrawerStack: () => dispatch(doPopDrawerStack()),
|
||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||
setExplicitNavigateBack: flag => dispatch(doSetExplicitNavigateBack(flag)),
|
||||
});
|
||||
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
perform
|
||||
)(ChannelCreator);
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { CLAIM_VALUES, Lbry, formatCredits, isNameValid, regexInvalidURI } from 'lbry-redux';
|
||||
import { CLAIM_VALUES, isNameValid, regexInvalidURI } from 'lbry-redux';
|
||||
import {
|
||||
ActivityIndicator,
|
||||
Alert,
|
||||
@@ -14,14 +14,13 @@ import {
|
||||
TouchableOpacity,
|
||||
View,
|
||||
} from 'react-native';
|
||||
import { navigateBack, navigateToUri, logPublish, uploadImageAsset } from 'utils/helper';
|
||||
import { navigateToUri, logPublish, uploadImageAsset } from 'utils/helper';
|
||||
import Button from 'component/button';
|
||||
import ChannelIconItem from 'component/channelIconItem';
|
||||
import ChannelRewardsDriver from 'component/channelRewardsDriver';
|
||||
import Colors from 'styles/colors';
|
||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import EmptyStateView from 'component/emptyStateView';
|
||||
import FastImage from 'react-native-fast-image';
|
||||
import FloatingWalletBalance from 'component/floatingWalletBalance';
|
||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||
import Link from 'component/link';
|
||||
@@ -37,10 +36,8 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
|
||||
state = {
|
||||
autoStyle: null,
|
||||
returnUrl: null,
|
||||
canSave: true,
|
||||
claimId: null,
|
||||
creditsInputFocused: false,
|
||||
currentSelectedValue: Constants.ITEM_ANONYMOUS,
|
||||
currentPhase: null,
|
||||
displayName: null,
|
||||
@@ -78,7 +75,6 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
descriptionFocused: false,
|
||||
websiteFocused: false,
|
||||
emailFocused: false,
|
||||
hasReturnedBack: false,
|
||||
};
|
||||
|
||||
didFocusListener;
|
||||
@@ -120,14 +116,7 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
};
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
const {
|
||||
currentRoute: prevRoute,
|
||||
drawerStack: prevDrawerStack,
|
||||
popDrawerStack,
|
||||
setPlayerVisible,
|
||||
navigation,
|
||||
notify,
|
||||
} = this.props;
|
||||
const { currentRoute: prevRoute, drawerStack: prevDrawerStack, notify } = this.props;
|
||||
const { currentRoute, drawerStack, updatingChannel, updateChannelError } = nextProps;
|
||||
|
||||
if (Constants.DRAWER_ROUTE_CHANNEL_CREATOR === currentRoute && currentRoute !== prevRoute) {
|
||||
@@ -151,11 +140,6 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
) {
|
||||
// navigated back from the form
|
||||
this.setState({ currentPhase: Constants.PHASE_LIST });
|
||||
if (!this.state.hasReturnedBack && this.state.returnUrl) {
|
||||
this.setState({ hasReturnedBack: true }, () => {
|
||||
navigateBack(navigation, drawerStack, popDrawerStack, setPlayerVisible);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,12 +169,11 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
|
||||
let isEditMode = false;
|
||||
if (navigation.state.params) {
|
||||
const { editChannelUrl, displayForm, returnUrl } = navigation.state.params;
|
||||
const { editChannelUrl, displayForm } = navigation.state.params;
|
||||
if (editChannelUrl) {
|
||||
isEditMode = true;
|
||||
this.setState({ editChannelUrl, currentPhase: Constants.PHASE_CREATE });
|
||||
}
|
||||
this.setState({ returnUrl });
|
||||
}
|
||||
|
||||
if (!isEditMode && hasFormState) {
|
||||
@@ -241,9 +224,9 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
error => {
|
||||
notify({ message: `The image could not be uploaded: ${error}` });
|
||||
this.setState({ uploadingImage: false });
|
||||
},
|
||||
}
|
||||
);
|
||||
},
|
||||
}
|
||||
);
|
||||
} else {
|
||||
// could not determine the file path
|
||||
@@ -505,12 +488,12 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
claim_id: claimId,
|
||||
amount: newChannelBid,
|
||||
},
|
||||
optionalParams,
|
||||
optionalParams
|
||||
);
|
||||
this.setState({ updateChannelStarted: true }, () => updateChannel(params));
|
||||
} else {
|
||||
this.setState({ creatingChannel: true }, () =>
|
||||
createChannel(channelName, newChannelBid, optionalParams).then(success, failure),
|
||||
createChannel(channelName, newChannelBid, optionalParams).then(success, failure)
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -543,7 +526,7 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
avatarImagePickerOpen: false,
|
||||
coverImagePickerOpen: true,
|
||||
},
|
||||
() => this.checkStoragePermission(),
|
||||
() => NativeModules.UtilityModule.openDocumentPicker('image/*')
|
||||
);
|
||||
};
|
||||
|
||||
@@ -559,7 +542,7 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
avatarImagePickerOpen: true,
|
||||
coverImagePickerOpen: false,
|
||||
},
|
||||
() => this.checkStoragePermission(),
|
||||
() => NativeModules.UtilityModule.openDocumentPicker('image/*')
|
||||
);
|
||||
};
|
||||
|
||||
@@ -689,7 +672,7 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
},
|
||||
},
|
||||
],
|
||||
{ cancelable: true },
|
||||
{ cancelable: true }
|
||||
);
|
||||
};
|
||||
|
||||
@@ -765,42 +748,6 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
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() {
|
||||
const { abandoningClaimIds, balance, fetchingChannels, updatingChannel, channels = [], navigation } = this.props;
|
||||
const {
|
||||
@@ -883,9 +830,9 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
>
|
||||
<View style={[channelCreatorStyle.channelListAvatar, itemAutoStyle]}>
|
||||
{itemThumbnailUrl && (
|
||||
<FastImage
|
||||
<Image
|
||||
style={channelCreatorStyle.avatarImage}
|
||||
resizeMode={FastImage.resizeMode.cover}
|
||||
resizeMode={'cover'}
|
||||
source={{ uri: itemThumbnailUrl }}
|
||||
/>
|
||||
)}
|
||||
@@ -920,7 +867,7 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
style={channelCreatorStyle.coverImage}
|
||||
resizeMode={'cover'}
|
||||
source={
|
||||
!!coverImageUrl && coverImageUrl.trim().length > 0
|
||||
coverImageUrl !== null && coverImageUrl.trim().length > 0
|
||||
? { uri: coverImageUrl }
|
||||
: require('../../assets/default_channel_cover.png')
|
||||
}
|
||||
@@ -939,15 +886,14 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
|
||||
<View style={[channelCreatorStyle.avatarImageContainer, autoStyle]}>
|
||||
<TouchableOpacity style={channelCreatorStyle.avatarTouchArea} onPress={this.onAvatarImagePress}>
|
||||
{!!thumbnailUrl && thumbnailUrl.trim().length > 0 && (
|
||||
{thumbnailUrl !== null && thumbnailUrl.trim().length > 0 && (
|
||||
<Image
|
||||
style={channelCreatorStyle.avatarImage}
|
||||
resizeMode={'cover'}
|
||||
source={{ uri: thumbnailUrl }}
|
||||
/>
|
||||
)}
|
||||
{(!!thumbnailUrl || (!!thumbnailUrl && thumbnailUrl.trim().length === 0)) &&
|
||||
newChannelName.length > 0 && (
|
||||
{(thumbnailUrl === null || thumbnailUrl.trim().length === 0) && newChannelName.length > 0 && (
|
||||
<Text style={channelIconStyle.autothumbCharacter}>
|
||||
{newChannelName.substring(0, 1).toUpperCase()}
|
||||
</Text>
|
||||
@@ -1014,19 +960,11 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
style={channelCreatorStyle.bidAmountInput}
|
||||
value={String(newChannelBid)}
|
||||
onChangeText={this.handleNewChannelBidChange}
|
||||
onFocus={() => this.setState({ creditsInputFocused: true })}
|
||||
onBlur={() => this.setState({ creditsInputFocused: false })}
|
||||
placeholder={'0.00'}
|
||||
keyboardType={'number-pad'}
|
||||
underlineColorAndroid={Colors.NextLbryGreen}
|
||||
/>
|
||||
<Text style={channelCreatorStyle.currency}>LBC</Text>
|
||||
<View style={channelCreatorStyle.balance}>
|
||||
{this.state.creditsInputFocused && <Icon name="coins" size={12} />}
|
||||
{this.state.creditsInputFocused && (
|
||||
<Text style={channelCreatorStyle.balanceText}>{formatCredits(parseFloat(balance), 1, true)}</Text>
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
<Text style={channelCreatorStyle.helpText}>
|
||||
{__('This LBC remains yours. It is a deposit to reserve the name and can be undone at any time.')}
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
selectSubscriptionClaims,
|
||||
selectUnreadSubscriptions,
|
||||
} from 'lbryinc';
|
||||
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||
import { doPushDrawerStack } from 'redux/actions/drawer';
|
||||
import { doSetClientSetting, doSetSortByItem, doSetTimeItem } from 'redux/actions/settings';
|
||||
import { makeSelectClientSetting, selectSortByItem, selectTimeItem } from 'redux/selectors/settings';
|
||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
@@ -41,12 +41,11 @@ const perform = dispatch => ({
|
||||
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_DISCOVER)),
|
||||
removeUnreadSubscriptions: () => dispatch(doRemoveUnreadSubscriptions()),
|
||||
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||
setSortByItem: item => dispatch(doSetSortByItem(item)),
|
||||
setTimeItem: item => dispatch(doSetTimeItem(item)),
|
||||
});
|
||||
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
perform
|
||||
)(DiscoverPage);
|
||||
+84
-23
@@ -37,6 +37,29 @@ class DiscoverPage extends React.PureComponent {
|
||||
};
|
||||
|
||||
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;
|
||||
|
||||
this.buildTagCollection(followedTags);
|
||||
@@ -63,11 +86,11 @@ class DiscoverPage extends React.PureComponent {
|
||||
}
|
||||
|
||||
onComponentFocused = () => {
|
||||
const { pushDrawerStack, setPlayerVisible, currentRoute } = this.props;
|
||||
pushDrawerStack();
|
||||
|
||||
NativeModules.Firebase.setCurrentScreen('Your tags');
|
||||
setPlayerVisible();
|
||||
const { fetchSubscriptions, pushDrawerStack } = this.props;
|
||||
// pushDrawerStack();
|
||||
NativeModules.Firebase.setCurrentScreen('Your tags').then(result => {
|
||||
fetchSubscriptions();
|
||||
});
|
||||
};
|
||||
|
||||
handleSortByItemSelected = item => {
|
||||
@@ -100,6 +123,46 @@ class DiscoverPage extends React.PureComponent {
|
||||
return null;
|
||||
};
|
||||
|
||||
componentDidUpdate(prevProps, prevState) {
|
||||
const { unreadSubscriptions, enabledChannelNotifications } = this.props;
|
||||
|
||||
const utility = NativeModules.UtilityModule;
|
||||
const hasUnread =
|
||||
prevProps.unreadSubscriptions &&
|
||||
prevProps.unreadSubscriptions.length !== unreadSubscriptions.length &&
|
||||
unreadSubscriptions.length > 0;
|
||||
|
||||
if (hasUnread) {
|
||||
unreadSubscriptions.map(({ channel, uris }) => {
|
||||
const { claimName: channelName } = parseURI(channel);
|
||||
|
||||
// check if notifications are enabled for the channel
|
||||
if (enabledChannelNotifications.includes(channelName)) {
|
||||
uris.forEach(uri => {
|
||||
Lbry.resolve({ urls: uri }).then(result => {
|
||||
const sub = result[uri];
|
||||
|
||||
if (sub && sub.value) {
|
||||
const { source, title, thumbnail } = sub.value;
|
||||
const isPlayable =
|
||||
source && source.media_type && ['audio', 'video'].includes(source.media_type.substring(0, 5));
|
||||
if (title) {
|
||||
utility.showNotificationForContent(
|
||||
uri,
|
||||
title,
|
||||
channelName,
|
||||
thumbnail ? thumbnail.url : null,
|
||||
isPlayable
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
showRatingReminder = () => {
|
||||
const { ratingReminderDisabled, ratingReminderLastShown, setClientSetting } = this.props;
|
||||
|
||||
@@ -114,7 +177,7 @@ class DiscoverPage extends React.PureComponent {
|
||||
Alert.alert(
|
||||
__('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.'
|
||||
),
|
||||
[
|
||||
{
|
||||
@@ -130,7 +193,7 @@ class DiscoverPage extends React.PureComponent {
|
||||
},
|
||||
},
|
||||
],
|
||||
{ cancelable: false },
|
||||
{ cancelable: false }
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -268,27 +331,25 @@ class DiscoverPage extends React.PureComponent {
|
||||
);
|
||||
|
||||
render() {
|
||||
const { currentRoute, navigation, sortByItem, timeItem } = this.props;
|
||||
const { navigation, sortByItem, timeItem } = this.props;
|
||||
const { orderBy, showModalTagSelector, showSortPicker, showTimePicker } = this.state;
|
||||
|
||||
return (
|
||||
<View style={discoverStyle.container}>
|
||||
<UriBar navigation={navigation} belowOverlay={showModalTagSelector} />
|
||||
{currentRoute !== Constants.ROUTE_FILE && currentRoute !== Constants.DRAWER_ROUTE_FILE_VIEW && (
|
||||
<SectionList
|
||||
ListHeaderComponent={this.sectionListHeader}
|
||||
ListFooterComponent={this.sectionListFooter}
|
||||
style={discoverStyle.scrollContainer}
|
||||
contentContainerStyle={discoverStyle.scrollPadding}
|
||||
initialNumToRender={4}
|
||||
maxToRenderPerBatch={4}
|
||||
removeClippedSubviews
|
||||
renderItem={this.renderSectionListItem}
|
||||
renderSectionHeader={this.renderSectionHeader}
|
||||
sections={this.buildSections()}
|
||||
keyExtractor={(item, index) => item}
|
||||
/>
|
||||
)}
|
||||
<SectionList
|
||||
ListHeaderComponent={this.sectionListHeader}
|
||||
ListFooterComponent={this.sectionListFooter}
|
||||
style={discoverStyle.scrollContainer}
|
||||
contentContainerStyle={discoverStyle.scrollPadding}
|
||||
initialNumToRender={4}
|
||||
maxToRenderPerBatch={4}
|
||||
removeClippedSubviews
|
||||
renderItem={this.renderSectionListItem}
|
||||
renderSectionHeader={this.renderSectionHeader}
|
||||
sections={this.buildSections()}
|
||||
keyExtractor={(item, index) => item}
|
||||
/>
|
||||
{!showModalTagSelector && !showSortPicker && !showTimePicker && (
|
||||
<FloatingWalletBalance navigation={navigation} />
|
||||
)}
|
||||
|
||||
@@ -79,7 +79,7 @@ class DownloadsPage extends React.PureComponent {
|
||||
const { claims, fileInfos } = this.props;
|
||||
const claimUris = claims.map(claim => normalizeURI(`${claim.name}#${claim.claim_id}`));
|
||||
return fileInfos.filter(
|
||||
fileInfo => !claimUris.includes(normalizeURI(`${fileInfo.claim_name}#${fileInfo.claim_id}`)),
|
||||
fileInfo => !claimUris.includes(normalizeURI(`${fileInfo.claim_name}#${fileInfo.claim_id}`))
|
||||
);
|
||||
};
|
||||
|
||||
@@ -125,11 +125,7 @@ class DownloadsPage extends React.PureComponent {
|
||||
onPress: () => {
|
||||
const uris = Object.keys(selectedClaimsMap);
|
||||
uris.forEach(uri => {
|
||||
const { txid, nout, name, claim_id: claimId } = selectedClaimsMap[uri];
|
||||
if (name && claimId) {
|
||||
NativeModules.UtilityModule.deleteDownload(normalizeURI(`${name}#${claimId}`));
|
||||
}
|
||||
|
||||
const { txid, nout } = selectedClaimsMap[uri];
|
||||
deleteFile(`${txid}:${nout}`, true);
|
||||
});
|
||||
this.onExitSelectionMode();
|
||||
@@ -139,7 +135,7 @@ class DownloadsPage extends React.PureComponent {
|
||||
],
|
||||
{
|
||||
cancelable: true,
|
||||
},
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
@@ -188,7 +184,7 @@ class DownloadsPage extends React.PureComponent {
|
||||
this.handleSelectItem(item, claim);
|
||||
} else {
|
||||
// TODO: when shortUrl is available for my claims, navigate to that URL instead
|
||||
navigateToUri(navigation, item, { autoplay: true }, false, null);
|
||||
navigateToUri(navigation, item, { autoplay: true });
|
||||
}
|
||||
}}
|
||||
onLongPress={claim => this.handleItemLongPress(item, claim)}
|
||||
|
||||
+21
-14
@@ -8,7 +8,7 @@ import {
|
||||
doPurchaseUri,
|
||||
doDeletePurchasedUri,
|
||||
doResolveUri,
|
||||
doResolveUris,
|
||||
doSearch,
|
||||
doSendTip,
|
||||
doToast,
|
||||
makeSelectIsUriResolving,
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
makeSelectContentPositionForUri,
|
||||
makeSelectContentTypeForUri,
|
||||
makeSelectMetadataForUri,
|
||||
makeSelectRecommendedContentForUri,
|
||||
makeSelectStreamingUrlForUri,
|
||||
makeSelectThumbnailForUri,
|
||||
makeSelectTitleForUri,
|
||||
@@ -27,20 +28,25 @@ import {
|
||||
selectPurchasedUris,
|
||||
selectFailedPurchaseUris,
|
||||
selectPurchaseUriErrorMessage,
|
||||
selectIsSearching,
|
||||
} from 'lbry-redux';
|
||||
import {
|
||||
doClaimEligiblePurchaseRewards,
|
||||
doFetchCostInfoForUri,
|
||||
doFetchViewCount,
|
||||
makeSelectCostInfoForUri,
|
||||
makeSelectViewCountForUri,
|
||||
selectRewardContentClaimIds,
|
||||
selectBlackListedOutpoints,
|
||||
} from 'lbryinc';
|
||||
import { doDeleteFile, doStopDownloadingFile } from 'redux/actions/file';
|
||||
import { doPushDrawerStack, doPopDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||
import {
|
||||
doStartDownload,
|
||||
doUpdateDownload,
|
||||
doCompleteDownload,
|
||||
doDeleteFile,
|
||||
doStopDownloadingFile,
|
||||
} from 'redux/actions/file';
|
||||
import { doPopDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||
import { doToggleFullscreenMode } from 'redux/actions/settings';
|
||||
import { selectDrawerStack, makeSelectPlayerVisible } from 'redux/selectors/drawer';
|
||||
import { selectDrawerStack } from 'redux/selectors/drawer';
|
||||
import FilePage from './view';
|
||||
|
||||
const select = (state, props) => {
|
||||
@@ -60,7 +66,6 @@ const select = (state, props) => {
|
||||
fileInfo: makeSelectFileInfoForUri(contentUri)(state),
|
||||
rewardedContentClaimIds: selectRewardContentClaimIds(state, selectProps),
|
||||
channelUri: makeSelectChannelForClaimUri(contentUri, true)(state),
|
||||
isPlayerVisible: makeSelectPlayerVisible(uri)(state), // use navigation uri for this selector
|
||||
position: makeSelectContentPositionForUri(contentUri)(state),
|
||||
purchasedUris: selectPurchasedUris(state),
|
||||
failedPurchaseUris: selectFailedPurchaseUris(state),
|
||||
@@ -69,7 +74,8 @@ const select = (state, props) => {
|
||||
streamingUrl: makeSelectStreamingUrlForUri(contentUri)(state),
|
||||
thumbnail: makeSelectThumbnailForUri(contentUri)(state),
|
||||
title: makeSelectTitleForUri(contentUri)(state),
|
||||
viewCount: makeSelectViewCountForUri(contentUri)(state),
|
||||
recommendedContent: makeSelectRecommendedContentForUri(contentUri)(state),
|
||||
isSearchingRecommendContent: selectIsSearching(state),
|
||||
};
|
||||
};
|
||||
|
||||
@@ -82,24 +88,25 @@ const perform = dispatch => ({
|
||||
fetchFileInfo: uri => dispatch(doFetchFileInfo(uri)),
|
||||
fetchCostInfo: uri => dispatch(doFetchCostInfoForUri(uri)),
|
||||
fetchMyClaims: () => dispatch(doFetchClaimListMine()),
|
||||
fetchChannelListMine: () => dispatch(doFetchChannelListMine(1, 99999, true)),
|
||||
fetchViewCount: claimId => dispatch(doFetchViewCount(claimId)),
|
||||
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
||||
fileGet: (uri, saveFile) => dispatch(doFileGet(uri, saveFile)),
|
||||
notify: data => dispatch(doToast(data)),
|
||||
popDrawerStack: () => dispatch(doPopDrawerStack()),
|
||||
pushDrawerStack: (routeName, params) => dispatch(doPushDrawerStack(routeName, params)),
|
||||
purchaseUri: (uri, costInfo, saveFile) => dispatch(doPurchaseUri(uri, costInfo, saveFile)),
|
||||
deletePurchasedUri: uri => dispatch(doDeletePurchasedUri(uri)),
|
||||
resolveUri: uri => dispatch(doResolveUri(uri)),
|
||||
resolveUris: uris => dispatch(doResolveUris(uris)),
|
||||
searchRecommended: query => dispatch(doSearch(query, 20, undefined, true)),
|
||||
sendTip: (amount, claimId, isSupport, successCallback, errorCallback) =>
|
||||
dispatch(doSendTip(amount, claimId, isSupport, successCallback, errorCallback)),
|
||||
setPlayerVisible: (visible, uri) => dispatch(doSetPlayerVisible(visible, uri)),
|
||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(true)),
|
||||
stopDownload: (uri, fileInfo) => dispatch(doStopDownloadingFile(uri, fileInfo)),
|
||||
startDownload: (uri, outpoint, fileInfo) => dispatch(doStartDownload(uri, outpoint, fileInfo)),
|
||||
updateDownload: (uri, outpoint, fileInfo, progress) => dispatch(doUpdateDownload(uri, outpoint, fileInfo, progress)),
|
||||
completeDownload: (uri, outpoint, fileInfo) => dispatch(doCompleteDownload(uri, outpoint, fileInfo)),
|
||||
toggleFullscreenMode: mode => dispatch(doToggleFullscreenMode(mode)),
|
||||
});
|
||||
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
perform
|
||||
)(FilePage);
|
||||
+509
-845
File diff suppressed because it is too large.
Load diff
@@ -113,7 +113,7 @@ class WalletPage extends React.PureComponent {
|
||||
// only display this view if it's not a new user (or auto-login has been attempted once)
|
||||
content = (
|
||||
<View onLayout={onWalletViewLayout}>
|
||||
<Text style={firstRunStyle.title}>{__('Password')}</Text>
|
||||
<Text style={firstRunStyle.title}>Password</Text>
|
||||
<Text style={firstRunStyle.paragraph}>
|
||||
{hasSyncedWallet
|
||||
? __('Please enter the password you used to secure your wallet.')
|
||||
@@ -146,6 +146,15 @@ class WalletPage extends React.PureComponent {
|
||||
<Icon name={this.state.revealPassword ? 'eye-slash' : 'eye'} size={16} style={firstRunStyle.revealIcon} />
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
{(!this.state.password || this.state.password.trim().length === 0) && (
|
||||
<View style={firstRunStyle.passwordWarning}>
|
||||
<Text style={firstRunStyle.passwordWarningText}>
|
||||
{hasSyncedWallet
|
||||
? __('If you did not provide a password, please press Use LBRY to continue.')
|
||||
: __('You can proceed without a password, but this is not recommended.')}
|
||||
</Text>
|
||||
</View>
|
||||
)}
|
||||
|
||||
{(!hasSyncedWallet && this.state.password && this.state.password.trim().length) > 0 && (
|
||||
<View style={firstRunStyle.passwordStrength}>
|
||||
|
||||
@@ -103,7 +103,7 @@ class WelcomePage extends React.PureComponent {
|
||||
} else {
|
||||
content = (
|
||||
<View onLayout={onWelcomePageLayout}>
|
||||
<Text style={firstRunStyle.title}>{__('Welcome to LBRY.')}</Text>
|
||||
<Text style={firstRunStyle.title}>Welcome to LBRY.</Text>
|
||||
<Text style={firstRunStyle.paragraph}>
|
||||
{__(
|
||||
'LBRY is a community-controlled content platform where you can find and publish videos, music, books, and more.'
|
||||
|
||||
@@ -28,7 +28,6 @@ class FirstRunScreen extends React.PureComponent {
|
||||
emailCollectTracked: false,
|
||||
emailSubmitted: false,
|
||||
enterPasswordTracked: false,
|
||||
autoLoginTried: false,
|
||||
isFirstRun: false,
|
||||
launchUrl: null,
|
||||
languageLoaded: false,
|
||||
@@ -39,6 +38,7 @@ class FirstRunScreen extends React.PureComponent {
|
||||
walletPassword: '',
|
||||
syncApplyStarted: false,
|
||||
syncApplyCompleted: false,
|
||||
language: null,
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
@@ -126,16 +126,8 @@ class FirstRunScreen extends React.PureComponent {
|
||||
|
||||
if (this.state.syncApplyStarted && !syncApplyIsPending) {
|
||||
if (syncApplyErrorMessage && syncApplyErrorMessage.trim().length > 0) {
|
||||
if (this.state.autoLoginTried) {
|
||||
// don't show the error message for auto-login if it fails
|
||||
notify({ message: __(syncApplyErrorMessage), isError: true });
|
||||
}
|
||||
this.setState({
|
||||
autoLoginTried: true,
|
||||
showBottomContainer: true,
|
||||
syncApplyStarted: false,
|
||||
syncApplyCompleted: false,
|
||||
});
|
||||
notify({ message: __(syncApplyErrorMessage), isError: true });
|
||||
this.setState({ showBottomContainer: true, syncApplyStarted: false, syncApplyCompleted: false });
|
||||
} else {
|
||||
this.setState({ syncApplyCompleted: true });
|
||||
// password successfully verified
|
||||
@@ -228,13 +220,7 @@ class FirstRunScreen extends React.PureComponent {
|
||||
handleContinuePressed = () => {
|
||||
const { notify, user, hasSyncedWallet } = this.props;
|
||||
const pageIndex = FirstRunScreen.pages.indexOf(this.state.currentPage);
|
||||
|
||||
if (Constants.FIRST_RUN_PAGE_WELCOME === this.state.currentPage) {
|
||||
// only show the welcome screen on first run
|
||||
this.closeFinalPage();
|
||||
}
|
||||
|
||||
/* if (Constants.FIRST_RUN_PAGE_WALLET === this.state.currentPage) {
|
||||
if (Constants.FIRST_RUN_PAGE_WALLET === this.state.currentPage) {
|
||||
// do apply sync to check if the password is valid
|
||||
if (hasSyncedWallet) {
|
||||
this.checkWalletPassword();
|
||||
@@ -262,7 +248,7 @@ class FirstRunScreen extends React.PureComponent {
|
||||
} else {
|
||||
this.showNextPage();
|
||||
}
|
||||
} */
|
||||
}
|
||||
};
|
||||
|
||||
handleEmailCollectPageContinue() {
|
||||
@@ -315,7 +301,7 @@ class FirstRunScreen extends React.PureComponent {
|
||||
onEmailChanged = email => {
|
||||
this.setState({ email });
|
||||
if (Constants.FIRST_RUN_PAGE_EMAIL_COLLECT === this.state.currentPage) {
|
||||
this.setState({ showSkip: !email || typeof email !== 'string' || email.trim().length === 0 });
|
||||
this.setState({ showSkip: !email || email.trim().length === 0 });
|
||||
} else {
|
||||
this.setState({ showSkip: false });
|
||||
}
|
||||
@@ -506,12 +492,7 @@ class FirstRunScreen extends React.PureComponent {
|
||||
{Constants.FIRST_RUN_PAGE_SKIP_ACCOUNT !== this.state.currentPage &&
|
||||
Constants.FIRST_RUN_PAGE_EMAIL_VERIFY !== this.state.currentPage && (
|
||||
<Text style={firstRunStyle.buttonText}>
|
||||
{[Constants.FIRST_RUN_PAGE_WALLET, Constants.FIRST_RUN_PAGE_WELCOME].includes(
|
||||
this.state.currentPage
|
||||
)
|
||||
? __('Use LBRY')
|
||||
: __('Continue')}{' '}
|
||||
»
|
||||
{Constants.FIRST_RUN_PAGE_WALLET === this.state.currentPage ? __('Use LBRY') : __('Continue')} »
|
||||
</Text>
|
||||
)}
|
||||
</TouchableOpacity>
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
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);
|
||||
@@ -1,244 +0,0 @@
|
||||
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;
|
||||
@@ -1,31 +0,0 @@
|
||||
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);
|
||||
@@ -1,289 +0,0 @@
|
||||
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,7 +1,6 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
doPublish,
|
||||
doFetchClaimListMine,
|
||||
doResolveUri,
|
||||
doToast,
|
||||
doUpdatePublishForm,
|
||||
@@ -28,7 +27,6 @@ const select = state => ({
|
||||
const perform = dispatch => ({
|
||||
notify: data => dispatch(doToast(data)),
|
||||
clearPublishFormState: () => dispatch(doClearPublishFormState()),
|
||||
fetchMyClaims: () => dispatch(doFetchClaimListMine()),
|
||||
pendingPublishSuccess: pendingClaim => dispatch(doPendingPublishSuccess(pendingClaim)),
|
||||
updatePublishForm: value => dispatch(doUpdatePublishForm(value)),
|
||||
updatePublishFormState: data => dispatch(doUpdatePublishFormState(data)),
|
||||
@@ -41,5 +39,5 @@ const perform = dispatch => ({
|
||||
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
perform
|
||||
)(PublishPage);
|
||||
+32
-138
@@ -16,11 +16,9 @@ import {
|
||||
} from 'react-native';
|
||||
import { FlatGrid } from 'react-native-super-grid';
|
||||
import {
|
||||
Lbry,
|
||||
isNameValid,
|
||||
batchActions,
|
||||
buildURI,
|
||||
formatCredits,
|
||||
normalizeURI,
|
||||
parseURI,
|
||||
regexInvalidURI,
|
||||
@@ -47,7 +45,7 @@ import Tag from 'component/tag';
|
||||
import TagSearch from 'component/tagSearch';
|
||||
import UriBar from 'component/uriBar';
|
||||
import publishStyle from 'styles/publish';
|
||||
import { navigateToUri, navigateBack, logPublish, uploadImageAsset } from 'utils/helper';
|
||||
import { navigateToUri, logPublish, uploadImageAsset } from 'utils/helper';
|
||||
|
||||
const languages = {
|
||||
en: 'English',
|
||||
@@ -85,7 +83,6 @@ class PublishPage extends React.PureComponent {
|
||||
state = {
|
||||
canPublish: true,
|
||||
canUseCamera: false,
|
||||
creditsInputFocused: false,
|
||||
documentPickerOpen: false,
|
||||
editMode: false,
|
||||
titleFocused: false,
|
||||
@@ -140,9 +137,6 @@ class PublishPage extends React.PureComponent {
|
||||
|
||||
// other
|
||||
publishStarted: false,
|
||||
storagePermissionRequired: false,
|
||||
hasReturnedBack: false,
|
||||
returnUrl: null,
|
||||
};
|
||||
|
||||
didFocusListener;
|
||||
@@ -164,8 +158,6 @@ class PublishPage extends React.PureComponent {
|
||||
DeviceEventEmitter.removeListener('onAllGalleryThumbnailsChecked', this.handleAllGalleryThumbnailsChecked);
|
||||
DeviceEventEmitter.removeListener('onDocumentPickerFilePicked', this.onFilePicked);
|
||||
DeviceEventEmitter.removeListener('onDocumentPickerCanceled', this.onPickerCanceled);
|
||||
DeviceEventEmitter.removeListener('onStoragePermissionGranted', this.handleStoragePermissionGranted);
|
||||
DeviceEventEmitter.removeListener('onStoragePermissionRefused', this.handleStoragePermissionRefused);
|
||||
}
|
||||
|
||||
handleGalleryThumbnailChecked = evt => {
|
||||
@@ -188,57 +180,28 @@ class PublishPage extends React.PureComponent {
|
||||
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 = () => {
|
||||
const { balance, fetchMyClaims, hasFormState, pushDrawerStack, setPlayerVisible, navigation } = this.props;
|
||||
const { balance, hasFormState, pushDrawerStack, setPlayerVisible, navigation } = this.props;
|
||||
NativeModules.Firebase.setCurrentScreen('Publish').then(result => {
|
||||
pushDrawerStack(Constants.DRAWER_ROUTE_PUBLISH, navigation.state.params ? navigation.state.params : null);
|
||||
setPlayerVisible();
|
||||
|
||||
DeviceEventEmitter.addListener('onStoragePermissionGranted', this.handleStoragePermissionGranted);
|
||||
DeviceEventEmitter.addListener('onStoragePermissionRefused', this.handleStoragePermissionRefused);
|
||||
|
||||
NativeModules.Gallery.canUseCamera().then(canUseCamera => this.setState({ canUseCamera }));
|
||||
NativeModules.Gallery.getThumbnailPath().then(thumbnailPath => this.setState({ thumbnailPath }));
|
||||
fetchMyClaims();
|
||||
|
||||
NativeModules.UtilityModule.canReadWriteStorage().then(canReadWrite => {
|
||||
if (!canReadWrite) {
|
||||
this.setState({ storagePermissionRequired: true }, () =>
|
||||
NativeModules.UtilityModule.requestStoragePermission(),
|
||||
);
|
||||
} else {
|
||||
// Can only load videos when the storage permission is granted
|
||||
this.loadVideos();
|
||||
this.setState(
|
||||
{
|
||||
loadingVideos: true,
|
||||
},
|
||||
() => {
|
||||
NativeModules.Gallery.getVideos().then(videos => this.setState({ videos, loadingVideos: false }));
|
||||
}
|
||||
});
|
||||
);
|
||||
|
||||
// Check if this is an edit action
|
||||
let isEditMode = false,
|
||||
vanityUrlSet = false;
|
||||
if (navigation.state.params) {
|
||||
const { displayForm, editMode, claimToEdit, vanityUrl, returnUrl } = navigation.state.params;
|
||||
const { displayForm, editMode, claimToEdit, vanityUrl } = navigation.state.params;
|
||||
if (editMode) {
|
||||
this.prepareEdit(claimToEdit);
|
||||
isEditMode = true;
|
||||
@@ -252,7 +215,6 @@ class PublishPage extends React.PureComponent {
|
||||
vanityUrl: claimName,
|
||||
});
|
||||
}
|
||||
this.setState({ returnUrl });
|
||||
}
|
||||
|
||||
if (!isEditMode && hasFormState) {
|
||||
@@ -324,7 +286,7 @@ class PublishPage extends React.PureComponent {
|
||||
this.handleChannelChange(channelName);
|
||||
}
|
||||
pushDrawerStack(Constants.DRAWER_ROUTE_PUBLISH_FORM);
|
||||
},
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
@@ -360,7 +322,7 @@ class PublishPage extends React.PureComponent {
|
||||
};
|
||||
|
||||
handlePublishPressed = () => {
|
||||
const { balance, myClaims, notify, publish, updatePublishForm } = this.props;
|
||||
const { balance, notify, publish, updatePublishForm } = this.props;
|
||||
const {
|
||||
editMode,
|
||||
bid,
|
||||
@@ -392,34 +354,18 @@ class PublishPage extends React.PureComponent {
|
||||
}
|
||||
|
||||
if (!title || title.trim().length === 0) {
|
||||
notify({ message: __('Please provide a title'), isError: true });
|
||||
notify({ message: __('Please provide a title') });
|
||||
return;
|
||||
}
|
||||
|
||||
if (!name) {
|
||||
notify({ message: __('Please specify an address where people can find your content.'), isError: true });
|
||||
notify({ message: __('Please specify an address where people can find your content.') });
|
||||
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) {
|
||||
// sanity check. normally shouldn't happen
|
||||
notify({
|
||||
message: __('No file selected. Please select a video or take a photo before publishing.'),
|
||||
isError: true,
|
||||
});
|
||||
notify({ message: __('No file selected. Please select a video or take a photo before publishing.') });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -475,15 +421,7 @@ class PublishPage extends React.PureComponent {
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
const {
|
||||
currentRoute: prevRoute,
|
||||
drawerStack: prevDrawerStack,
|
||||
popDrawerStack,
|
||||
setPlayerVisible,
|
||||
navigation,
|
||||
notify,
|
||||
updatePublishFormState,
|
||||
} = this.props;
|
||||
const { currentRoute: prevRoute, drawerStack: prevDrawerStack, notify, updatePublishFormState } = this.props;
|
||||
const { currentRoute, drawerStack, publishFormValues } = nextProps;
|
||||
|
||||
if (Constants.DRAWER_ROUTE_PUBLISH === currentRoute && currentRoute !== prevRoute) {
|
||||
@@ -497,11 +435,6 @@ class PublishPage extends React.PureComponent {
|
||||
) {
|
||||
// navigated back from the form
|
||||
this.showSelector();
|
||||
if (!this.state.hasReturnedBack && this.state.returnUrl) {
|
||||
this.setState({ hasReturnedBack: true }, () => {
|
||||
navigateBack(navigation, drawerStack, popDrawerStack, setPlayerVisible);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -521,7 +454,7 @@ class PublishPage extends React.PureComponent {
|
||||
() => {
|
||||
this.handleNameChange(this.state.name);
|
||||
pushDrawerStack(Constants.DRAWER_ROUTE_PUBLISH_FORM);
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -575,7 +508,7 @@ class PublishPage extends React.PureComponent {
|
||||
clearPublishFormState();
|
||||
// reset thumbnail
|
||||
updatePublishForm({ thumbnail: null });
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -602,7 +535,7 @@ class PublishPage extends React.PureComponent {
|
||||
},
|
||||
() => {
|
||||
NativeModules.UtilityModule.openDocumentPicker('*/*');
|
||||
},
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
@@ -648,12 +581,12 @@ class PublishPage extends React.PureComponent {
|
||||
() => {
|
||||
// upload a new thumbnail
|
||||
uploadImageAsset(fileUrl, this.handleThumbnailUploadSuccess, this.handleThumbnailUploadFailure);
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// could not determine the file path
|
||||
notify({ message: __('The path could not be determined. Please try a different file.'), isError: true });
|
||||
notify({ message: __('The path could not be determined. Please try a different file.') });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -699,7 +632,7 @@ class PublishPage extends React.PureComponent {
|
||||
videoRecordingMode: false,
|
||||
recordingVideo: false,
|
||||
},
|
||||
() => pushDrawerStack(Constants.DRAWER_ROUTE_PUBLISH_FORM),
|
||||
() => pushDrawerStack(Constants.DRAWER_ROUTE_PUBLISH_FORM)
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -723,7 +656,7 @@ class PublishPage extends React.PureComponent {
|
||||
showCameraOverlay: false,
|
||||
videoRecordingMode: false,
|
||||
},
|
||||
() => pushDrawerStack(Constants.DRAWER_ROUTE_PUBLISH),
|
||||
() => pushDrawerStack(Constants.DRAWER_ROUTE_PUBLISH)
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -842,8 +775,8 @@ class PublishPage extends React.PureComponent {
|
||||
uploadImageAsset(
|
||||
this.getFilePathFromUri(uri),
|
||||
this.handleThumbnailUploadSuccess,
|
||||
this.handleThumbnailUploadFailure,
|
||||
),
|
||||
this.handleThumbnailUploadFailure
|
||||
)
|
||||
);
|
||||
}
|
||||
} else if (mediaType === 'image' || mediaType === 'video') {
|
||||
@@ -856,7 +789,7 @@ class PublishPage extends React.PureComponent {
|
||||
this.setState({ currentThumbnailUri: `file://${path}`, updatingThumbnailUri: false });
|
||||
if (!this.state.uploadedThumbnailUri) {
|
||||
this.setState({ uploadThumbnailStarted: true }, () =>
|
||||
uploadImageAsset(path, this.handleThumbnailUploadSuccess, this.handleThumbnailUploadFailure),
|
||||
uploadImageAsset(path, this.handleThumbnailUploadSuccess, this.handleThumbnailUploadFailure)
|
||||
);
|
||||
}
|
||||
})
|
||||
@@ -882,7 +815,7 @@ class PublishPage extends React.PureComponent {
|
||||
},
|
||||
() => {
|
||||
this.handleNameChange(this.state.name);
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -946,33 +879,10 @@ class PublishPage extends React.PureComponent {
|
||||
},
|
||||
() => {
|
||||
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() {
|
||||
const { balance, navigation, notify, publishFormValues } = this.props;
|
||||
const {
|
||||
@@ -982,7 +892,6 @@ class PublishPage extends React.PureComponent {
|
||||
currentPhase,
|
||||
checkedThumbnails,
|
||||
loadingVideos,
|
||||
storagePermissionRequired,
|
||||
thumbnailPath,
|
||||
videos,
|
||||
} = this.state;
|
||||
@@ -1024,20 +933,13 @@ class PublishPage extends React.PureComponent {
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
{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) && (
|
||||
{(loadingVideos || !allThumbnailsChecked) && (
|
||||
<View style={publishStyle.loadingView}>
|
||||
<ActivityIndicator size="small" color={Colors.NextLbryGreen} />
|
||||
<Text style={publishStyle.loadingText}>{__('Please wait while we load your videos...')}</Text>
|
||||
</View>
|
||||
)}
|
||||
{!storagePermissionRequired && !loadingVideos && (!videos || videos.length === 0) && (
|
||||
{!loadingVideos && (!videos || videos.length === 0) && (
|
||||
<View style={publishStyle.relativeCentered}>
|
||||
<Text style={publishStyle.noVideos}>
|
||||
{__('We could not find any videos on your device. Take a photo or record a video to get started.')}
|
||||
@@ -1208,7 +1110,7 @@ class PublishPage extends React.PureComponent {
|
||||
{__('The address where people can find your content (ex. lbry://myvideo). ')}
|
||||
{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>
|
||||
|
||||
@@ -1231,16 +1133,8 @@ class PublishPage extends React.PureComponent {
|
||||
keyboardType={'numeric'}
|
||||
value={String(this.state.bid)}
|
||||
onChangeText={this.handleBidChange}
|
||||
onFocus={() => this.setState({ creditsInputFocused: true })}
|
||||
onBlur={() => this.setState({ creditsInputFocused: false })}
|
||||
/>
|
||||
<Text style={publishStyle.currency}>LBC</Text>
|
||||
<View style={publishStyle.balance}>
|
||||
{this.state.creditsInputFocused && <Icon name="coins" size={12} />}
|
||||
{this.state.creditsInputFocused && (
|
||||
<Text style={publishStyle.balanceText}>{formatCredits(parseFloat(balance), 1, true)}</Text>
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
<Text style={publishStyle.helpText}>
|
||||
{__('This LBC remains yours and the deposit can be undone at any time.')}
|
||||
@@ -1358,7 +1252,7 @@ class PublishPage extends React.PureComponent {
|
||||
</View>
|
||||
<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>
|
||||
</View>
|
||||
|
||||
@@ -11,10 +11,6 @@ import RewardEnrolment from 'component/rewardEnrolment';
|
||||
import UriBar from 'component/uriBar';
|
||||
import rewardStyle from 'styles/reward';
|
||||
|
||||
const FILTER_ALL = 'all';
|
||||
const FILTER_AVAILABLE = 'available';
|
||||
const FILTER_CLAIMED = 'claimed';
|
||||
|
||||
class RewardsPage extends React.PureComponent {
|
||||
state = {
|
||||
isEmailVerified: false,
|
||||
@@ -23,7 +19,6 @@ class RewardsPage extends React.PureComponent {
|
||||
verifyRequestStarted: false,
|
||||
revealVerification: true,
|
||||
firstRewardClaimed: false,
|
||||
currentFilter: FILTER_AVAILABLE,
|
||||
};
|
||||
|
||||
scrollView = null;
|
||||
@@ -109,7 +104,7 @@ class RewardsPage extends React.PureComponent {
|
||||
if (this.state.isEmailVerified && this.state.isIdentityVerified && !this.state.isRewardApproved) {
|
||||
return (
|
||||
<View style={[rewardStyle.card, rewardStyle.verification]}>
|
||||
<Text style={rewardStyle.title}>{__('Manual Reward Verification')}</Text>
|
||||
<Text style={rewardStyle.title}>Manual Reward Verification</Text>
|
||||
<Text style={rewardStyle.text}>
|
||||
__('You need to be manually verified before you can start claiming rewards.') Please request to be verified
|
||||
on the{' '}
|
||||
@@ -187,13 +182,8 @@ class RewardsPage extends React.PureComponent {
|
||||
});
|
||||
};
|
||||
|
||||
setFilter = filter => {
|
||||
this.setState({ currentFilter: filter });
|
||||
};
|
||||
|
||||
render() {
|
||||
const { user, navigation } = this.props;
|
||||
const { currentFilter } = this.state;
|
||||
|
||||
return (
|
||||
<View style={rewardStyle.container}>
|
||||
@@ -207,29 +197,8 @@ class RewardsPage extends React.PureComponent {
|
||||
style={rewardStyle.scrollContainer}
|
||||
contentContainerStyle={rewardStyle.scrollContentContainer}
|
||||
>
|
||||
<View style={rewardStyle.filterHeader}>
|
||||
<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()}
|
||||
{this.renderUnclaimedRewards()}
|
||||
{this.renderClaimedRewards()}
|
||||
</ScrollView>
|
||||
)}
|
||||
</View>
|
||||
|
||||
@@ -1,52 +1,40 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
doClaimSearch,
|
||||
doResolveUris,
|
||||
doResolvedSearch,
|
||||
doSearch,
|
||||
doUpdateSearchQuery,
|
||||
makeSelectResolvedSearchResults,
|
||||
makeSelectResolvedSearchResultsLastPageReached,
|
||||
makeSelectSearchUris,
|
||||
selectClaimSearchByQuery,
|
||||
selectIsSearching,
|
||||
selectResolvingUris,
|
||||
selectSearchValue,
|
||||
makeSelectQueryWithOptions,
|
||||
selectSearchUrisByQuery,
|
||||
} from 'lbry-redux';
|
||||
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/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 SearchPage from './view';
|
||||
|
||||
const numSearchResults = 25;
|
||||
|
||||
const select = state => ({
|
||||
claimSearchByQuery: selectClaimSearchByQuery(state),
|
||||
currentRoute: selectCurrentRoute(state),
|
||||
isSearching: selectIsSearching(state),
|
||||
query: selectSearchValue(state),
|
||||
resolvingUris: selectResolvingUris(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),
|
||||
uris: makeSelectSearchUris(makeSelectQueryWithOptions(null, numSearchResults)(state))(state),
|
||||
urisByQuery: selectSearchUrisByQuery(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
search: (query, from, nsfw) => dispatch(doResolvedSearch(query, Constants.DEFAULT_PAGE_SIZE, from, false, {}, nsfw)),
|
||||
search: query => dispatch(doSearch(query, numSearchResults)),
|
||||
claimSearch: options => dispatch(doClaimSearch(options)),
|
||||
updateSearchQuery: query => dispatch(doUpdateSearchQuery(query)),
|
||||
pushDrawerStack: (routeName, params) => dispatch(doPushDrawerStack(routeName, params)),
|
||||
resolveUris: uris => dispatch(doResolveUris(uris)),
|
||||
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_SEARCH)),
|
||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||
});
|
||||
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
perform
|
||||
)(SearchPage);
|
||||
+26
-93
@@ -15,23 +15,17 @@ import Colors from 'styles/colors';
|
||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import PageHeader from 'component/pageHeader';
|
||||
import FileListItem from 'component/fileListItem';
|
||||
import ClaimResultItem from 'component/claimResultItem';
|
||||
import FloatingWalletBalance from 'component/floatingWalletBalance';
|
||||
import UriBar from 'component/uriBar';
|
||||
import searchStyle from 'styles/search';
|
||||
|
||||
const softLimit = 500;
|
||||
|
||||
class SearchPage extends React.PureComponent {
|
||||
state = {
|
||||
currentQuery: null,
|
||||
currentFrom: 0,
|
||||
currentUri: null,
|
||||
showTagResult: false,
|
||||
claimSearchRun: false,
|
||||
claimSearchOptions: null,
|
||||
resultsResolved: false,
|
||||
tagResultDisplayed: false,
|
||||
};
|
||||
|
||||
static navigationOptions = {
|
||||
@@ -52,23 +46,20 @@ class SearchPage extends React.PureComponent {
|
||||
}
|
||||
|
||||
onComponentFocused = () => {
|
||||
const { pushDrawerStack, setPlayerVisible, navigation, query, search, showNsfwContent } = this.props;
|
||||
const { pushDrawerStack, setPlayerVisible, query, search } = this.props;
|
||||
pushDrawerStack();
|
||||
setPlayerVisible();
|
||||
pushDrawerStack(Constants.DRAWER_ROUTE_SEARCH, navigation.state.params ? navigation.state.params : null);
|
||||
NativeModules.Firebase.setCurrentScreen('Search').then(result => {
|
||||
const searchQuery = query || this.getSearchQuery();
|
||||
if (searchQuery && searchQuery.trim().length > 0) {
|
||||
this.setState({
|
||||
currentFrom: 0,
|
||||
currentQuery: searchQuery,
|
||||
currentUri: isURIValid(searchQuery) ? normalizeURI(searchQuery) : null,
|
||||
claimSearchOptions: null,
|
||||
claimSearchRun: false,
|
||||
showTagResult: false,
|
||||
resultsResolved: false,
|
||||
tagResultDisplayed: false,
|
||||
});
|
||||
search(searchQuery, 0, showNsfwContent);
|
||||
search(searchQuery);
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -78,8 +69,8 @@ class SearchPage extends React.PureComponent {
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
const { currentRoute, query, isSearching } = nextProps;
|
||||
const { currentRoute: prevRoute, search, isSearching: prevIsSearching, showNsfwContent } = this.props;
|
||||
const { currentRoute, query } = nextProps;
|
||||
const { currentRoute: prevRoute, search } = this.props;
|
||||
|
||||
if (Constants.DRAWER_ROUTE_SEARCH === currentRoute && currentRoute !== prevRoute) {
|
||||
this.onComponentFocused();
|
||||
@@ -87,43 +78,10 @@ class SearchPage extends React.PureComponent {
|
||||
|
||||
if (query && query.trim().length > 0 && query !== this.state.currentQuery) {
|
||||
this.setState({
|
||||
currentFrom: 0,
|
||||
currentQuery: query,
|
||||
currentUri: isURIValid(query) ? normalizeURI(query) : null,
|
||||
resultsResolved: false,
|
||||
tagResultDisplayed: false,
|
||||
});
|
||||
search(query, 0, showNsfwContent);
|
||||
}
|
||||
}
|
||||
|
||||
allContentResolved(props) {
|
||||
const { uris, resolvingUris } = props;
|
||||
if (!this.state.resultsResolved) {
|
||||
return false;
|
||||
}
|
||||
if (uris) {
|
||||
let allResolved = true;
|
||||
uris.forEach(uri => {
|
||||
allResolved = allResolved && !resolvingUris.includes(uri);
|
||||
});
|
||||
return allResolved;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* shouldComponentUpdate(nextProps) {
|
||||
const { isSearching, uris } = this.props;
|
||||
return (isSearching && (!uris || uris.length === 0)) || (!isSearching && this.allContentResolved(this.props));
|
||||
} */
|
||||
|
||||
componentDidUpdate() {
|
||||
const { claimSearchByQuery } = this.props;
|
||||
if (this.state.claimSearchRun && this.state.claimSearchOptions && !this.state.tagResultDisplayed) {
|
||||
const claimSearchKey = createNormalizedClaimSearchKey(this.state.claimSearchOptions);
|
||||
const claimSearchUris = claimSearchByQuery[claimSearchKey];
|
||||
this.setState({ showTagResult: claimSearchUris && claimSearchUris.length > 0, tagResultDisplayed: true });
|
||||
search(query);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,18 +94,14 @@ class SearchPage extends React.PureComponent {
|
||||
}
|
||||
|
||||
handleSearchSubmitted = keywords => {
|
||||
const { search, showNsfwContent } = this.props;
|
||||
const { search } = this.props;
|
||||
this.setState({
|
||||
currentUri: isURIValid(keywords) ? normalizeURI(keywords) : null,
|
||||
currentFrom: 0,
|
||||
currentQuery: keywords,
|
||||
claimSearchOptions: null,
|
||||
claimSearchRun: false,
|
||||
showTagResult: false,
|
||||
resultsResolved: false,
|
||||
tagResultDisplayed: false,
|
||||
});
|
||||
search(keywords, 0, showNsfwContent);
|
||||
search(keywords);
|
||||
};
|
||||
|
||||
listEmptyComponent = () => {
|
||||
@@ -155,26 +109,34 @@ class SearchPage extends React.PureComponent {
|
||||
return (
|
||||
<View style={searchStyle.noResults}>
|
||||
<Text style={searchStyle.noResultsText}>
|
||||
{__('There are no results to display for "%query%". Please try a different search term.', { query })}
|
||||
There are no results to display for <Text style={searchStyle.boldText}>{query}</Text>. Please try a different
|
||||
search term.
|
||||
</Text>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
listHeaderComponent = (showTagResult, query) => {
|
||||
const { navigation, claimSearch } = this.props;
|
||||
listHeaderComponent = showTagResult => {
|
||||
const { navigation, claimSearch, claimSearchByQuery } = this.props;
|
||||
const { currentUri } = this.state;
|
||||
const query = this.getSearchQuery();
|
||||
|
||||
const canBeTag = query && query.trim().length > 0 && isURIValid(query);
|
||||
if (canBeTag && !this.state.claimSearchRun) {
|
||||
const options = {
|
||||
any_tags: [query.toLowerCase()],
|
||||
any_tags: [query],
|
||||
page: 1,
|
||||
no_totals: true,
|
||||
};
|
||||
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 (
|
||||
<View>
|
||||
<FileListItem uri={currentUri} featuredResult style={searchStyle.featuredResultItem} navigation={navigation} />
|
||||
@@ -193,29 +155,14 @@ class SearchPage extends React.PureComponent {
|
||||
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() {
|
||||
const { isSearching, navigation, query, results } = this.props;
|
||||
const { isSearching, navigation, query, uris, urisByQuery } = this.props;
|
||||
|
||||
return (
|
||||
<View style={searchStyle.container}>
|
||||
<UriBar value={query} navigation={navigation} onSearchSubmitted={this.handleSearchSubmitted} />
|
||||
|
||||
{isSearching && this.state.currentFrom === 0 && (
|
||||
{isSearching && (
|
||||
<View style={searchStyle.busyContainer}>
|
||||
<ActivityIndicator size="large" color={Colors.NextLbryGreen} style={searchStyle.loading} />
|
||||
</View>
|
||||
@@ -226,31 +173,17 @@ class SearchPage extends React.PureComponent {
|
||||
style={searchStyle.scrollContainer}
|
||||
contentContainerStyle={searchStyle.scrollPadding}
|
||||
keyboardShouldPersistTaps={'handled'}
|
||||
data={results}
|
||||
keyExtractor={(item, index) => item.claimId}
|
||||
data={uris}
|
||||
keyExtractor={(item, index) => item}
|
||||
initialNumToRender={10}
|
||||
maxToRenderPerBatch={20}
|
||||
onEndReached={this.handleVerticalEndReached}
|
||||
onEndReachedThreshold={0.2}
|
||||
removeClippedSubviews
|
||||
ListEmptyComponent={!isSearching ? this.listEmptyComponent() : null}
|
||||
ListHeaderComponent={this.listHeaderComponent(this.state.showTagResult, this.state.currentQuery)}
|
||||
ListHeaderComponent={this.state.currentUri ? this.listHeaderComponent(this.state.showTagResult) : null}
|
||||
renderItem={({ item }) => (
|
||||
<ClaimResultItem
|
||||
key={item.claimId}
|
||||
uri={item ? normalizeURI(`${item.name}#${item.claimId}`) : null}
|
||||
result={item}
|
||||
style={searchStyle.resultItem}
|
||||
navigation={navigation}
|
||||
/>
|
||||
<FileListItem key={item} uri={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} />
|
||||
</View>
|
||||
);
|
||||
|
||||
+22
-30
@@ -89,41 +89,33 @@ class SettingsPage extends React.PureComponent {
|
||||
}
|
||||
|
||||
// check the local filesystem for the language first? Or download remote strings first?
|
||||
if (language === 'en') {
|
||||
// don't attempt to download English
|
||||
NativeModules.UtilityModule.setNativeStringSetting(SETTINGS.LANGUAGE, language);
|
||||
|
||||
// update state and client setting
|
||||
window.language = language;
|
||||
setClientSetting(SETTINGS.LANGUAGE, value);
|
||||
} else {
|
||||
// download and save the language file
|
||||
this.setState({ downloadingLanguage: true }, () => {
|
||||
fetch('https://lbry.com/i18n/get/lbry-mobile/app-strings/' + language + '.json')
|
||||
.then(r => r.json())
|
||||
.then(j => {
|
||||
window.i18n_messages[language] = j;
|
||||
// download and save the language file
|
||||
this.setState({ downloadingLanguage: true }, () => {
|
||||
fetch('https://lbry.com/i18n/get/lbry-mobile/app-strings/' + language + '.json')
|
||||
.then(r => r.json())
|
||||
.then(j => {
|
||||
window.i18n_messages[language] = j;
|
||||
|
||||
// write the language file to the filesystem
|
||||
const langFilePath = RNFS.ExternalDirectoryPath + '/' + language + '.json';
|
||||
RNFS.writeFile(langFilePath, JSON.stringify(j), 'utf8');
|
||||
// write the language file to the filesystem
|
||||
const langFilePath = RNFS.ExternalDirectoryPath + '/' + language + '.json';
|
||||
RNFS.writeFile(langFilePath, JSON.stringify(j), 'utf8');
|
||||
|
||||
// save the setting outside redux because when the first component mounts, the redux value isn't loaded yet
|
||||
// so we have to load it from native settings
|
||||
NativeModules.UtilityModule.setNativeStringSetting(SETTINGS.LANGUAGE, language);
|
||||
// save the setting outside redux because when the first component mounts, the redux value isn't loaded yet
|
||||
// so we have to load it from native settings
|
||||
NativeModules.UtilityModule.setNativeStringSetting(SETTINGS.LANGUAGE, value);
|
||||
|
||||
// update state and client setting
|
||||
window.language = language;
|
||||
setClientSetting(SETTINGS.LANGUAGE, value);
|
||||
// update state and client setting
|
||||
window.language = language;
|
||||
setClientSetting(SETTINGS.LANGUAGE, value);
|
||||
|
||||
this.setState({ downloadingLanguage: false });
|
||||
})
|
||||
.catch(e => {
|
||||
notify({ message: __('Failed to load %language% translations.', { language: language }), isError: true });
|
||||
this.setState({ downloadingLanguage: false });
|
||||
});
|
||||
});
|
||||
}
|
||||
this.setState({ downloadingLanguage: false });
|
||||
})
|
||||
.catch(e => {
|
||||
notify({ message: __('Failed to load %language% translations.', { language: language }), isError: true });
|
||||
this.setState({ downloadingLanguage: false });
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
handleBackPressed = () => {
|
||||
|
||||
@@ -2,38 +2,32 @@ import { connect } from 'react-redux';
|
||||
import { SETTINGS, doBalanceSubscribe, doUpdateBlockHeight, doPopulateSharedUserState, doToast } from 'lbry-redux';
|
||||
import {
|
||||
doAuthenticate,
|
||||
doInstallNew,
|
||||
doInstallNewWithParams,
|
||||
doBlackListedOutpointsSubscribe,
|
||||
doFilteredOutpointsSubscribe,
|
||||
doCheckSubscriptionsInit,
|
||||
doFetchMySubscriptions,
|
||||
doFetchRewardedContent,
|
||||
doGetSync,
|
||||
doUserEmailToVerify,
|
||||
doUserEmailVerify,
|
||||
doUserEmailVerifyFailure,
|
||||
selectAuthenticationIsPending,
|
||||
selectUser,
|
||||
selectEmailToVerify,
|
||||
} from 'lbryinc';
|
||||
import { doSetClientSetting } from 'redux/actions/settings';
|
||||
import { selectLastRouteInStack } from 'redux/selectors/drawer';
|
||||
import SplashScreen from './view';
|
||||
|
||||
const select = state => ({
|
||||
authIsPending: selectAuthenticationIsPending(state),
|
||||
user: selectUser(state),
|
||||
emailToVerify: selectEmailToVerify(state),
|
||||
lastRouteInStack: selectLastRouteInStack(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
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()),
|
||||
blacklistedOutpointsSubscribe: () => dispatch(doBlackListedOutpointsSubscribe()),
|
||||
filteredOutpointsSubscribe: () => dispatch(doFilteredOutpointsSubscribe()),
|
||||
checkSubscriptionsInit: () => dispatch(doCheckSubscriptionsInit()),
|
||||
fetchRewardedContent: () => dispatch(doFetchRewardedContent()),
|
||||
fetchSubscriptions: callback => dispatch(doFetchMySubscriptions(callback)),
|
||||
getSync: (password, callback) => dispatch(doGetSync(password, callback)),
|
||||
@@ -46,4 +40,7 @@ const perform = dispatch => ({
|
||||
verifyUserEmailFailure: error => dispatch(doUserEmailVerifyFailure(error)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(SplashScreen);
|
||||
export default connect(
|
||||
select,
|
||||
perform
|
||||
)(SplashScreen);
|
||||
+84
-166
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Lbry, doPreferenceGet, isURIValid } from 'lbry-redux';
|
||||
import { Lbry, doPreferenceGet } from 'lbry-redux';
|
||||
import { Lbryio } from 'lbryinc';
|
||||
import { ActivityIndicator, DeviceEventEmitter, Linking, NativeModules, Platform, Text, View } from 'react-native';
|
||||
import { NavigationActions, StackActions } from 'react-navigation';
|
||||
@@ -11,7 +11,7 @@ import Button from 'component/button';
|
||||
import ProgressBar from 'component/progressBar';
|
||||
import PropTypes from 'prop-types';
|
||||
import Colors from 'styles/colors';
|
||||
import Constants, { DrawerRoutes, InnerDrawerRoutes } from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import splashStyle from 'styles/splash';
|
||||
import RNFS from 'react-native-fs';
|
||||
|
||||
@@ -24,10 +24,8 @@ class SplashScreen extends React.PureComponent {
|
||||
|
||||
state = {
|
||||
accountUnlockFailed: false,
|
||||
appVersion: null,
|
||||
daemonReady: false,
|
||||
details: __('Starting up'),
|
||||
firebaseToken: null,
|
||||
message: __('Connecting'),
|
||||
isRunning: false,
|
||||
isLagging: false,
|
||||
@@ -36,61 +34,16 @@ class SplashScreen extends React.PureComponent {
|
||||
headersDownloadProgress: 0,
|
||||
shouldAuthenticate: 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() {
|
||||
const { authenticate } = this.props;
|
||||
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);
|
||||
});
|
||||
}
|
||||
Lbry.status().then(status => {
|
||||
this._updateStatusCallback(status);
|
||||
});
|
||||
}
|
||||
|
||||
navigateToMain = () => {
|
||||
const { lastRouteInStack, navigation, notify, verifyUserEmail, verifyUserEmailFailure } = this.props;
|
||||
const { navigation, notify, verifyUserEmail, verifyUserEmailFailure } = this.props;
|
||||
const resetAction = StackActions.reset({
|
||||
index: 0,
|
||||
actions: [NavigationActions.navigate({ routeName: 'Main' })],
|
||||
@@ -102,54 +55,48 @@ class SplashScreen extends React.PureComponent {
|
||||
? navigation.state.params.launchUrl
|
||||
: this.state.launchUrl;
|
||||
if (launchUrl) {
|
||||
navigateToUri(navigation, transformUrl(launchUrl));
|
||||
} else if (lastRouteInStack) {
|
||||
// no launch url, check if there's a last route in stack to navigate to.
|
||||
const { route, params } = lastRouteInStack;
|
||||
if (route) {
|
||||
if (DrawerRoutes.includes(route)) {
|
||||
navigation.navigate({ routeName: route, params });
|
||||
} else if (!InnerDrawerRoutes.includes(route) && isURIValid(route)) {
|
||||
navigateToUri(navigation, route);
|
||||
if (launchUrl.startsWith('lbry://?verify=')) {
|
||||
let verification = {};
|
||||
try {
|
||||
verification = JSON.parse(atob(launchUrl.substring(15)));
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
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) {
|
||||
const { getSync, installNewWithParams } = this.props;
|
||||
const { daemonReady, shouldAuthenticate, liteMode, liteModeParams, appVersion, firebaseToken } = this.state;
|
||||
const { emailToVerify, getSync, setEmailToVerify, verifyUserEmail, verifyUserEmailFailure } = this.props;
|
||||
const { daemonReady, shouldAuthenticate } = this.state;
|
||||
const { user } = nextProps;
|
||||
|
||||
if (liteMode && user && user.id) {
|
||||
this.navigateToLiteMode();
|
||||
} else if (daemonReady && shouldAuthenticate && user && user.id) {
|
||||
if (daemonReady && shouldAuthenticate && user && user.id) {
|
||||
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
|
||||
if (user.has_verified_email) {
|
||||
NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(walletPassword => {
|
||||
getSync(walletPassword, () => {
|
||||
this.getUserSettings();
|
||||
this.navigateToMain();
|
||||
});
|
||||
});
|
||||
this.navigateToMain();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -158,21 +105,6 @@ 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 = () => {
|
||||
const { populateSharedUserState } = this.props;
|
||||
|
||||
@@ -183,7 +115,7 @@ class SplashScreen extends React.PureComponent {
|
||||
},
|
||||
error => {
|
||||
/* failed */
|
||||
},
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
@@ -198,38 +130,39 @@ class SplashScreen extends React.PureComponent {
|
||||
authenticate,
|
||||
balanceSubscribe,
|
||||
blacklistedOutpointsSubscribe,
|
||||
checkSubscriptionsInit,
|
||||
filteredOutpointsSubscribe,
|
||||
getSync,
|
||||
updateBlockHeight,
|
||||
user,
|
||||
} = this.props;
|
||||
|
||||
// Lbry.resolve({ urls: 'lbry://one' }).then(() => {
|
||||
// Leave the splash screen
|
||||
balanceSubscribe();
|
||||
blacklistedOutpointsSubscribe();
|
||||
filteredOutpointsSubscribe();
|
||||
Lbry.resolve({ urls: 'lbry://one' }).then(() => {
|
||||
// Leave the splash screen
|
||||
balanceSubscribe();
|
||||
blacklistedOutpointsSubscribe();
|
||||
filteredOutpointsSubscribe();
|
||||
checkSubscriptionsInit();
|
||||
|
||||
if (user && user.id && user.has_verified_email) {
|
||||
// user already authenticated
|
||||
NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(walletPassword => {
|
||||
getSync(walletPassword, () => {
|
||||
this.getUserSettings();
|
||||
if (user && user.id && user.has_verified_email) {
|
||||
// user already authenticated
|
||||
NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(walletPassword => {
|
||||
getSync(walletPassword, () => {
|
||||
this.getUserSettings();
|
||||
this.navigateToMain();
|
||||
});
|
||||
});
|
||||
});
|
||||
this.navigateToMain();
|
||||
} else {
|
||||
NativeModules.VersionInfo.getAppVersion().then(appVersion => {
|
||||
this.setState({ shouldAuthenticate: true }, () => {
|
||||
} else {
|
||||
NativeModules.VersionInfo.getAppVersion().then(appVersion => {
|
||||
this.setState({ shouldAuthenticate: true });
|
||||
NativeModules.Firebase.getMessagingToken()
|
||||
.then(firebaseToken => {
|
||||
authenticate(appVersion, Platform.OS, firebaseToken);
|
||||
})
|
||||
.catch(() => authenticate(appVersion, Platform.OS));
|
||||
});
|
||||
});
|
||||
}
|
||||
// });
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
handleAccountUnlockFailed() {
|
||||
@@ -238,6 +171,7 @@ class SplashScreen extends React.PureComponent {
|
||||
|
||||
_updateStatusCallback(status) {
|
||||
const { fetchSubscriptions, getSync, setClientSetting } = this.props;
|
||||
const blockchainHeaders = status.blockchain_headers;
|
||||
const startupStatus = status.startup_status;
|
||||
const walletStatus = status.wallet;
|
||||
|
||||
@@ -267,8 +201,8 @@ class SplashScreen extends React.PureComponent {
|
||||
Lbry.wallet_unlock({ password: password || '' }).then(unlocked => {
|
||||
if (unlocked) {
|
||||
this.setState({
|
||||
message: __('Authenticating'),
|
||||
details: __('Waiting for authentication'),
|
||||
message: __('Testing network'),
|
||||
details: __('Waiting for name resolution'),
|
||||
});
|
||||
this.finishSplashScreen();
|
||||
} else {
|
||||
@@ -277,8 +211,8 @@ class SplashScreen extends React.PureComponent {
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
message: __('Authenticating'),
|
||||
details: __('Waiting for authentication'),
|
||||
message: __('Testing network'),
|
||||
details: __('Waiting for name resolution'),
|
||||
});
|
||||
this.finishSplashScreen();
|
||||
}
|
||||
@@ -288,11 +222,10 @@ class SplashScreen extends React.PureComponent {
|
||||
return;
|
||||
}
|
||||
|
||||
const headerSyncProgress = walletStatus ? walletStatus.headers_synchronization_progress : null;
|
||||
if (headerSyncProgress && headerSyncProgress < 100) {
|
||||
if (blockchainHeaders) {
|
||||
this.setState({
|
||||
isDownloadingHeaders: true,
|
||||
headersDownloadProgress: headerSyncProgress,
|
||||
isDownloadingHeaders: blockchainHeaders.downloading_headers,
|
||||
headersDownloadProgress: blockchainHeaders.download_progress,
|
||||
});
|
||||
} else {
|
||||
// set downloading flag to false if blockchain_headers isn't in the status response
|
||||
@@ -301,16 +234,15 @@ class SplashScreen extends React.PureComponent {
|
||||
});
|
||||
}
|
||||
|
||||
if (headerSyncProgress < 100) {
|
||||
const downloadProgress = isNaN(parseInt(headerSyncProgress, 10)) ? '0' : headerSyncProgress || '0';
|
||||
if (blockchainHeaders && blockchainHeaders.downloading_headers) {
|
||||
const downloadProgress = blockchainHeaders.download_progress ? blockchainHeaders.download_progress : 0;
|
||||
this.setState({
|
||||
message: __('Blockchain Sync'),
|
||||
details: __('Catching up with the blockchain (%progress%%)', { progress: downloadProgress }),
|
||||
details: `Catching up with the blockchain (${downloadProgress}%)`, // TODO: i18n tokenization
|
||||
});
|
||||
} else if (walletStatus && walletStatus.blocks_behind > 0) {
|
||||
const behind = walletStatus.blocks_behind;
|
||||
const behindText =
|
||||
behind === 1 ? __('%num% block behind', { num: behind }) : __('%num% blocks behind', { num: behind });
|
||||
const behindText = behind + ' block' + (behind === 1 ? '' : 's') + ' behind'; // TODO: i18n tokenization
|
||||
this.setState({
|
||||
message: __('Blockchain Sync'),
|
||||
details: behindText,
|
||||
@@ -338,30 +270,32 @@ class SplashScreen extends React.PureComponent {
|
||||
componentDidMount() {
|
||||
NativeModules.Firebase.track('app_launch', null);
|
||||
NativeModules.Firebase.setCurrentScreen('Splash');
|
||||
const { navigation } = this.props;
|
||||
const { resetUrl } = navigation.state.params;
|
||||
const isResetUrlSet = !!resetUrl;
|
||||
|
||||
this.props.fetchRewardedContent();
|
||||
Linking.getInitialURL().then(url => {
|
||||
let liteMode;
|
||||
if (url) {
|
||||
liteMode = !isResetUrlSet && url.indexOf('liteMode=1') > -1;
|
||||
this.setState({ launchUrl: resetUrl || url, liteMode });
|
||||
this.setState({ launchUrl: url });
|
||||
}
|
||||
|
||||
NativeModules.UtilityModule.getNotificationLaunchTarget().then(target => {
|
||||
if (target) {
|
||||
liteMode = !isResetUrlSet && target.indexOf('liteMode=1') > -1;
|
||||
this.setState({ launchUrl: resetUrl || target, liteMode });
|
||||
this.setState({ launchUrl: target });
|
||||
}
|
||||
|
||||
// Only connect after checking initial launch url / notification launch target
|
||||
if (liteMode) {
|
||||
this.initLiteMode();
|
||||
} else {
|
||||
this.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.'
|
||||
),
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -376,30 +310,14 @@ 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 = () => {
|
||||
this.setState(
|
||||
{
|
||||
accountUnlockFailed: false,
|
||||
message: __('Authenticating'),
|
||||
details: __('Waiting for authentication'),
|
||||
message: __('Testing network'),
|
||||
details: __('Waiting for name resolution'),
|
||||
},
|
||||
() => this.finishSplashScreen(),
|
||||
() => this.finishSplashScreen()
|
||||
);
|
||||
};
|
||||
|
||||
@@ -412,12 +330,12 @@ class SplashScreen extends React.PureComponent {
|
||||
<Text style={splashStyle.errorTitle}>{__('Oops! Something went wrong.')}</Text>
|
||||
<Text style={splashStyle.paragraph}>
|
||||
{__(
|
||||
'Your wallet failed to unlock, which means you may not be able to play any videos or access your funds.',
|
||||
'Your wallet failed to unlock, which means you may not be able to play any videos or access your funds.'
|
||||
)}
|
||||
</Text>
|
||||
<Text style={splashStyle.paragraph}>
|
||||
{__(
|
||||
'You can try to fix this by tapping Stop on the LBRY service notification and starting the app again. If the problem continues, you may have to reinstall the app and restore your account.',
|
||||
'You can try to fix this by tapping Stop on the LBRY service notification and starting the app again. If the problem continues, you may have to reinstall the app and restore your account.'
|
||||
)}
|
||||
</Text>
|
||||
|
||||
|
||||
Loaded 100 of 147 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user