Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8535f1b90c |
No files matched your search
Vendored
Whitespace-only changes.
+20
-4
@@ -2,17 +2,33 @@
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
## [Unreleased for desktop]
|
||||
|
||||
### Added
|
||||
- Checkbox to disable background wallpaper ([#7630](https://github.com/lbryio/lbry-desktop/pull/7630))
|
||||
|
||||
### Fixed
|
||||
- Better handle cover uploads ([#7647](https://github.com/lbryio/lbry-desktop/pull/7647))
|
||||
- Use default path when first choosing file on windows ([#7625](https://github.com/lbryio/lbry-desktop/pull/7625))
|
||||
- Emoji button hover ([#7620](https://github.com/lbryio/lbry-desktop/pull/7620))
|
||||
- Prevent infinite retries on thumbs ([#7618](https://github.com/lbryio/lbry-desktop/pull/7618))
|
||||
- Double splash/error on app startup ([#7615](https://github.com/lbryio/lbry-desktop/pull/7615))
|
||||
- App updates are now more coherent, also debs work. ([#7502](https://github.com/lbryio/lbry-desktop/pull/7502))
|
||||
|
||||
### Changed
|
||||
- Upgraded Electron to v15.5.5 ([#7614](https://github.com/lbryio/lbry-desktop/pull/7614))
|
||||
|
||||
|
||||
## [0.53.4] - [2022-06-10]
|
||||
|
||||
## Added
|
||||
### Added
|
||||
- Add top in language category for non-english on homepage ([#7585](https://github.com/lbryio/lbry-desktop/pull/7585))
|
||||
- Auto hosting in settings and hosting first run page ([#7598](https://github.com/lbryio/lbry-desktop/pull/7598))
|
||||
|
||||
### Changed
|
||||
- Updated lbry-sdk to [0.107.2](https://github.com/lbryio/lbry-sdk/releases/tag/v0.107.2)
|
||||
|
||||
## Fixed
|
||||
### Fixed
|
||||
- Better handle empty collections ([#7571](https://github.com/lbryio/lbry-desktop/pull/7571))
|
||||
- Better handle thumbnails in uploads/collections ([#7574](https://github.com/lbryio/lbry-desktop/pull/7574))
|
||||
- Work towards supporting collections of any claim type ([#7578](https://github.com/lbryio/lbry-desktop/pull/7578))
|
||||
@@ -22,7 +38,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
|
||||
## [0.53.3] - [2022-04-27]
|
||||
|
||||
## Fixed
|
||||
### Fixed
|
||||
- Reverted lbry.tv changes that broke production login ([#7569](https://github.com/lbryio/lbry-desktop/pull/7569))
|
||||
- Reverted lbry.tv changes that broke login ([#7570](https://github.com/lbryio/lbry-desktop/pull/7570))
|
||||
|
||||
@@ -33,7 +49,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- Removed some lbrytv references ([#7560](https://github.com/lbryio/lbry-desktop/pull/7560))
|
||||
- Removed some lbrytv player references ([#7552](https://github.com/lbryio/lbry-desktop/pull/7552))
|
||||
|
||||
## Fixed
|
||||
### Fixed
|
||||
- Repost style issues ([#7559](https://github.com/lbryio/lbry-desktop/pull/7559))
|
||||
- Disappearing sidebar thumbs ([#7556](https://github.com/lbryio/lbry-desktop/pull/7556))
|
||||
- Restore tags sidebar link ([#7555](https://github.com/lbryio/lbry-desktop/pull/7555))
|
||||
|
||||
@@ -70,12 +70,10 @@ _Note: If coming from a deb install, the directory structure is different and yo
|
||||
|
||||
## Usage
|
||||
|
||||
Double click the installed application to interact with the LBRY network.
|
||||
Start the installed application to interact with the LBRY network.
|
||||
|
||||
## Running from Source
|
||||
|
||||
You can run the web version (lbry.tv), the electron app, or both at the same time.
|
||||
|
||||
#### Prerequisites
|
||||
|
||||
- [Git](https://git-scm.com/downloads)
|
||||
|
||||
@@ -29,6 +29,10 @@
|
||||
"from": "./static/font",
|
||||
"to": "static/font",
|
||||
"filter": ["**/*"]
|
||||
},
|
||||
{
|
||||
"from": "./static/app-update.yml",
|
||||
"to": "app-update.yml"
|
||||
}
|
||||
],
|
||||
"publish": [
|
||||
|
||||
+173
-99
@@ -22,6 +22,7 @@ import { diskSpaceLinux, diskSpaceWindows, diskSpaceMac } from '../ui/util/disks
|
||||
const { download } = require('electron-dl');
|
||||
const remote = require('@electron/remote/main');
|
||||
const os = require('os');
|
||||
const sudo = require('sudo-prompt');
|
||||
|
||||
remote.initialize();
|
||||
const filePath = path.join(process.resourcesPath, 'static', 'upgradeDisabled');
|
||||
@@ -33,29 +34,23 @@ try {
|
||||
upgradeDisabled = false;
|
||||
}
|
||||
autoUpdater.autoDownload = !upgradeDisabled;
|
||||
autoUpdater.allowPrerelease = false;
|
||||
|
||||
// This is set to true if an auto update has been downloaded through the Electron
|
||||
// auto-update system and is ready to install. If the user declined an update earlier,
|
||||
// it will still install on shutdown.
|
||||
let autoUpdateDownloaded = false;
|
||||
const UPDATE_STATE_INIT = 0;
|
||||
const UPDATE_STATE_CHECKING = 1;
|
||||
const UPDATE_STATE_UPDATES_FOUND = 2;
|
||||
const UPDATE_STATE_NO_UPDATES_FOUND = 3;
|
||||
const UPDATE_STATE_DOWNLOADING = 4;
|
||||
const UPDATE_STATE_DOWNLOADED = 5;
|
||||
let updateState = UPDATE_STATE_INIT;
|
||||
let updateDownloadItem;
|
||||
|
||||
const isAutoUpdateSupported = ['win32', 'darwin'].includes(process.platform) || !!process.env.APPIMAGE;
|
||||
|
||||
// This is used to keep track of whether we are showing the special dialog
|
||||
// that we show on Windows after you decline an upgrade and close the app later.
|
||||
let showingAutoUpdateCloseAlert = false;
|
||||
|
||||
// This is used to prevent downloading updates multiple times when
|
||||
// using the auto updater API.
|
||||
// As read in the documentation:
|
||||
// "Calling autoUpdater.checkForUpdates() twice will download the update two times."
|
||||
// https://www.electronjs.org/docs/latest/api/auto-updater#autoupdatercheckforupdates
|
||||
let keepCheckingForUpdates = true;
|
||||
|
||||
// Auto updater doesn't support Linux installations (only trough AppImages)
|
||||
// this is why, for that case, we download a full executable (.deb package)
|
||||
// as a fallback support. This variable will be used to prevent
|
||||
// multiple downloads when auto updater isn't supported.
|
||||
let downloadUpgradeInProgress = false;
|
||||
|
||||
// Keep a global reference, if you don't, they will be closed automatically when the JavaScript
|
||||
// object is garbage collected.
|
||||
let rendererWindow;
|
||||
@@ -243,7 +238,8 @@ app.on('activate', () => {
|
||||
app.on('will-quit', event => {
|
||||
if (
|
||||
process.platform === 'win32' &&
|
||||
autoUpdateDownloaded &&
|
||||
updateState === UPDATE_STATE_DOWNLOADED &&
|
||||
isAutoUpdateSupported &&
|
||||
!appState.autoUpdateAccepted &&
|
||||
!showingAutoUpdateCloseAlert
|
||||
) {
|
||||
@@ -327,87 +323,6 @@ ipcMain.on('get-disk-space', async (event) => {
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.on('download-upgrade', async (event, params) => {
|
||||
if (downloadUpgradeInProgress) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { url, options } = params;
|
||||
const dir = fs.mkdtempSync(app.getPath('temp') + path.sep);
|
||||
options.onProgress = function(p) {
|
||||
rendererWindow.webContents.send('download-progress-update', p);
|
||||
};
|
||||
options.directory = dir;
|
||||
options.onCompleted = function(c) {
|
||||
downloadUpgradeInProgress = false;
|
||||
rendererWindow.webContents.send('download-update-complete', c);
|
||||
};
|
||||
const win = BrowserWindow.getFocusedWindow();
|
||||
downloadUpgradeInProgress = true;
|
||||
await download(win, url, options).catch(e => console.log('e', e));
|
||||
});
|
||||
|
||||
ipcMain.on('upgrade', (event, installerPath) => {
|
||||
app.on('quit', () => {
|
||||
console.log('Launching upgrade installer at', installerPath);
|
||||
// This gets triggered called after *all* other quit-related events, so
|
||||
// we'll only get here if we're fully prepared and quitting for real.
|
||||
shell.openPath(installerPath);
|
||||
});
|
||||
// what to do if no shutdown in a long time?
|
||||
console.log('Update downloaded to', installerPath);
|
||||
console.log('The app will close and you will be prompted to install the latest version of LBRY.');
|
||||
console.log('After the install is complete, please reopen the app.');
|
||||
app.quit();
|
||||
});
|
||||
|
||||
ipcMain.on('check-for-updates', (event, autoDownload) => {
|
||||
// Prevent downloading the same update multiple times.
|
||||
if (!keepCheckingForUpdates) {
|
||||
return;
|
||||
}
|
||||
|
||||
keepCheckingForUpdates = false;
|
||||
autoUpdater.autoDownload = autoDownload;
|
||||
autoUpdater.checkForUpdates();
|
||||
});
|
||||
|
||||
autoUpdater.on('update-downloaded', () => {
|
||||
autoUpdateDownloaded = true;
|
||||
|
||||
// If this download was trigger by
|
||||
// autoUpdateAccepted it means, the user
|
||||
// wants to install the new update but
|
||||
// needed to downloaded the files first.
|
||||
if (appState.autoUpdateAccepted) {
|
||||
autoUpdater.quitAndInstall();
|
||||
}
|
||||
});
|
||||
|
||||
autoUpdater.on('update-not-available', () => {
|
||||
keepCheckingForUpdates = true;
|
||||
});
|
||||
|
||||
ipcMain.on('autoUpdateAccepted', () => {
|
||||
appState.autoUpdateAccepted = true;
|
||||
|
||||
// quitAndInstall can only be called if the
|
||||
// update has been downloaded. Since the user
|
||||
// can disable auto updates, we have to make
|
||||
// sure it has been downloaded first.
|
||||
if (autoUpdateDownloaded) {
|
||||
autoUpdater.quitAndInstall();
|
||||
return;
|
||||
}
|
||||
|
||||
// If the update hasn't been downloaded,
|
||||
// start downloading it. After it's done, the
|
||||
// event 'update-downloaded' will be triggered,
|
||||
// where we will be able to resume the
|
||||
// update installation.
|
||||
autoUpdater.downloadUpdate();
|
||||
});
|
||||
|
||||
ipcMain.on('version-info-requested', () => {
|
||||
function formatRc(ver) {
|
||||
// Adds dash if needed to make RC suffix SemVer friendly
|
||||
@@ -500,3 +415,162 @@ process.on('uncaughtException', error => {
|
||||
if (daemon) daemon.quit();
|
||||
app.exit(1);
|
||||
});
|
||||
|
||||
// Auto updater
|
||||
autoUpdater.on('download-progress', () => {
|
||||
updateState = UPDATE_STATE_DOWNLOADING;
|
||||
});
|
||||
|
||||
autoUpdater.on('update-downloaded', () => {
|
||||
updateState = UPDATE_STATE_DOWNLOADED;
|
||||
|
||||
// If this download was trigger by
|
||||
// autoUpdateAccepted it means, the user
|
||||
// wants to install the new update but
|
||||
// needed to downloaded the files first.
|
||||
if (appState.autoUpdateAccepted) {
|
||||
autoUpdater.quitAndInstall();
|
||||
}
|
||||
});
|
||||
|
||||
autoUpdater.on('update-available', () => {
|
||||
if (updateState === UPDATE_STATE_DOWNLOADING) {
|
||||
return;
|
||||
}
|
||||
updateState = UPDATE_STATE_UPDATES_FOUND;
|
||||
});
|
||||
|
||||
autoUpdater.on('update-not-available', () => {
|
||||
updateState = UPDATE_STATE_NO_UPDATES_FOUND;
|
||||
});
|
||||
|
||||
autoUpdater.on('error', () => {
|
||||
if (updateState === UPDATE_STATE_DOWNLOADING) {
|
||||
updateState = UPDATE_STATE_UPDATES_FOUND;
|
||||
return;
|
||||
}
|
||||
updateState = UPDATE_STATE_INIT;
|
||||
});
|
||||
|
||||
// Manual (.deb) update
|
||||
ipcMain.on('cancel-download-upgrade', () => {
|
||||
if (updateDownloadItem) {
|
||||
// Cancel the download and execute the onCancel
|
||||
// callback set in the options.
|
||||
updateDownloadItem.cancel();
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.on('download-upgrade', (event, params) => {
|
||||
if (updateState !== UPDATE_STATE_UPDATES_FOUND) {
|
||||
return;
|
||||
}
|
||||
if (isAutoUpdateSupported) {
|
||||
updateState = UPDATE_STATE_DOWNLOADING;
|
||||
autoUpdater.downloadUpdate();
|
||||
return;
|
||||
}
|
||||
|
||||
const { url, options } = params;
|
||||
const dir = fs.mkdtempSync(app.getPath('temp') + path.sep);
|
||||
|
||||
updateState = UPDATE_STATE_DOWNLOADING;
|
||||
|
||||
// Grab the download item's handler to allow
|
||||
// cancelling the operation if required.
|
||||
options.onStarted = function(downloadItem) {
|
||||
updateDownloadItem = downloadItem;
|
||||
};
|
||||
options.onCancel = function() {
|
||||
updateState = UPDATE_STATE_UPDATES_FOUND;
|
||||
updateDownloadItem = undefined;
|
||||
};
|
||||
options.onProgress = function(p) {
|
||||
rendererWindow.webContents.send('download-progress-update', p);
|
||||
};
|
||||
options.onCompleted = function(c) {
|
||||
updateState = UPDATE_STATE_DOWNLOADED;
|
||||
updateDownloadItem = undefined;
|
||||
rendererWindow.webContents.send('download-update-complete', c);
|
||||
};
|
||||
options.directory = dir;
|
||||
const win = BrowserWindow.getFocusedWindow();
|
||||
download(win, url, options).catch(e => {
|
||||
updateState = UPDATE_STATE_UPDATES_FOUND;
|
||||
console.log('e', e);
|
||||
});
|
||||
});
|
||||
|
||||
// Update behavior
|
||||
ipcMain.on('autoUpdateAccepted', () => {
|
||||
appState.autoUpdateAccepted = true;
|
||||
|
||||
// quitAndInstall can only be called if the
|
||||
// update has been downloaded. Since the user
|
||||
// can disable auto updates, we have to make
|
||||
// sure it has been downloaded first.
|
||||
if (updateState === UPDATE_STATE_DOWNLOADED) {
|
||||
autoUpdater.quitAndInstall();
|
||||
return;
|
||||
}
|
||||
|
||||
if (updateState !== UPDATE_STATE_UPDATES_FOUND) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If the update hasn't been downloaded,
|
||||
// start downloading it. After it's done, the
|
||||
// event 'update-downloaded' will be triggered,
|
||||
// where we will be able to resume the
|
||||
// update installation.
|
||||
updateState = UPDATE_STATE_DOWNLOADING;
|
||||
autoUpdater.downloadUpdate();
|
||||
});
|
||||
|
||||
ipcMain.on('check-for-updates', (event, autoDownload) => {
|
||||
if (![UPDATE_STATE_INIT, UPDATE_STATE_NO_UPDATES_FOUND].includes(updateState)) {
|
||||
return;
|
||||
}
|
||||
|
||||
updateState = UPDATE_STATE_CHECKING;
|
||||
|
||||
// If autoDownload is true, checkForUpdates will begin the
|
||||
// download automatically.
|
||||
if (autoDownload) {
|
||||
updateState = UPDATE_STATE_DOWNLOADING;
|
||||
}
|
||||
|
||||
autoUpdater.autoDownload = autoDownload;
|
||||
autoUpdater.checkForUpdates();
|
||||
});
|
||||
|
||||
ipcMain.on('upgrade', (event, installerPath) => {
|
||||
// what to do if no shutdown in a long time?
|
||||
console.log('Update downloaded to', installerPath);
|
||||
console.log('The app will close and you will be prompted to install the latest version of LBRY.');
|
||||
console.log('After the install is complete, please reopen the app.');
|
||||
|
||||
// Prevent .deb package from opening with archive manager (Ubuntu >= 20)
|
||||
if (process.platform === 'linux' && !process.env.APPIMAGE) {
|
||||
sudo.exec(`dpkg -i ${installerPath}`, { name: app.name }, (err, stdout, stderr) => {
|
||||
if (err || stderr) {
|
||||
rendererWindow.webContents.send('upgrade-installing-error');
|
||||
return;
|
||||
}
|
||||
|
||||
// Re-launch the application when the installation finishes.
|
||||
app.relaunch();
|
||||
app.quit();
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
app.on('quit', () => {
|
||||
console.log('Launching upgrade installer at', installerPath);
|
||||
// This gets triggered called after *all* other quit-related events, so
|
||||
// we'll only get here if we're fully prepared and quitting for real.
|
||||
shell.openPath(installerPath);
|
||||
});
|
||||
app.quit();
|
||||
});
|
||||
+5
-8
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lbry",
|
||||
"version": "0.53.5-t109",
|
||||
"version": "0.53.4",
|
||||
"description": "A browser for the LBRY network, a digital marketplace controlled by its users.",
|
||||
"keywords": [
|
||||
"lbry"
|
||||
@@ -23,11 +23,8 @@
|
||||
"analyze": "source-map-explorer --only-mapped dist/electron/webpack/ui*.js --html dist/sourceMap.html",
|
||||
"compile:electron": "node --max_old_space_size=4096 ./node_modules/webpack/bin/webpack.js --config webpack.electron.config.js",
|
||||
"compile": "cross-env NODE_ENV=production yarn compile:electron",
|
||||
"copyenv": "copyfiles ./.env* web/",
|
||||
"dev": "yarn dev:electron",
|
||||
"dev:electron": "cross-env NODE_ENV=development node ./electron/devServer.js",
|
||||
"dev:internal-apis": "LBRY_API_URL='http://localhost:8080' yarn dev:electron",
|
||||
"dev:iatv": "LBRY_API_URL='http://localhost:15400' SDK_API_URL='http://localhost:15100' yarn dev:web",
|
||||
"pack": "electron-builder --dir",
|
||||
"dist": "electron-builder",
|
||||
"build": "cross-env NODE_ENV=production yarn compile:electron && electron-builder build",
|
||||
@@ -67,6 +64,7 @@
|
||||
"remove-markdown": "^0.3.0",
|
||||
"rss": "^1.2.2",
|
||||
"source-map-explorer": "^2.5.2",
|
||||
"sudo-prompt": "^9.2.1",
|
||||
"tempy": "^0.6.0",
|
||||
"videojs-logo": "^2.1.4"
|
||||
},
|
||||
@@ -126,7 +124,7 @@
|
||||
"dom-scroll-into-view": "^1.2.1",
|
||||
"dotenv-defaults": "^2.0.1",
|
||||
"dotenv-webpack": "^1.8.0",
|
||||
"electron": "15.4.0",
|
||||
"electron": "15.5.5",
|
||||
"electron-builder": "^22.10.5",
|
||||
"electron-devtools-installer": "^3.1.1",
|
||||
"electron-is-dev": "^0.3.0",
|
||||
@@ -238,11 +236,10 @@
|
||||
"yarn": "^1.3"
|
||||
},
|
||||
"lbrySettings": {
|
||||
"lbrynetDaemonVersion": "0.109.0",
|
||||
"lbrynetDaemonVersion": "0.107.2",
|
||||
"lbrynetDaemonUrlTemplate": "https://github.com/lbryio/lbry/releases/download/vDAEMONVER/lbrynet-OSNAME.zip",
|
||||
"lbrynetDaemonDir": "static/daemon",
|
||||
"lbrynetDaemonFileName": "lbrynet"
|
||||
},
|
||||
"packageManager": "yarn@3.2.0",
|
||||
"stableVersion": "0.53.4"
|
||||
"packageManager": "yarn@3.2.0"
|
||||
}
|
||||
@@ -2312,5 +2312,9 @@
|
||||
"Free --[legend, unused disk space]--": "Free",
|
||||
"Top content in %language%": "Top content in %language%",
|
||||
"Apply": "Apply",
|
||||
"Disable background": "Disable background",
|
||||
"Installing, please wait...": "Installing, please wait...",
|
||||
"There was an error during installation. Please, try again.": "There was an error during installation. Please, try again.",
|
||||
"Odysee Connect --[Section in Help Page]--": "Odysee Connect",
|
||||
"--end--": "--end--"
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
owner: lbryio
|
||||
repo: lbry-desktop
|
||||
provider: github
|
||||
@@ -94,10 +94,11 @@ function ChannelForm(props: Props) {
|
||||
const [nameError, setNameError] = React.useState(undefined);
|
||||
const [bidError, setBidError] = React.useState('');
|
||||
const [isUpload, setIsUpload] = React.useState({ cover: false, thumbnail: false });
|
||||
const [coverError, setCoverError] = React.useState(false);
|
||||
const [thumbError, setThumbError] = React.useState(false);
|
||||
const { claim_id: claimId } = claim || {};
|
||||
const [params, setParams]: [any, (any) => void] = React.useState(getChannelParams());
|
||||
const [coverError, setCoverError] = React.useState(false);
|
||||
const [coverPreview, setCoverPreview] = React.useState(params.coverUrl);
|
||||
const { channelName } = parseURI(uri);
|
||||
const name = params.name;
|
||||
const isNewChannel = !uri;
|
||||
@@ -206,7 +207,8 @@ function ChannelForm(props: Props) {
|
||||
setThumbError(false);
|
||||
}
|
||||
|
||||
function handleCoverChange(coverUrl: string, uploadSelected: boolean) {
|
||||
function handleCoverChange(coverUrl: string, uploadSelected: boolean, preview: ?string) {
|
||||
setCoverPreview(preview || '');
|
||||
setParams({ ...params, coverUrl });
|
||||
setIsUpload({ ...isUpload, cover: uploadSelected });
|
||||
setCoverError(false);
|
||||
@@ -259,7 +261,7 @@ function ChannelForm(props: Props) {
|
||||
}
|
||||
}, [hasClaimedInitialRewards, claimInitialRewards]);
|
||||
|
||||
const coverSrc = coverError ? ThumbnailBrokenImage : params.coverUrl;
|
||||
const coverSrc = coverError ? ThumbnailBrokenImage : coverPreview;
|
||||
|
||||
let thumbnailPreview;
|
||||
if (!params.thumbnailUrl) {
|
||||
@@ -281,7 +283,7 @@ function ChannelForm(props: Props) {
|
||||
title={__('Cover')}
|
||||
onClick={() =>
|
||||
openModal(MODALS.IMAGE_UPLOAD, {
|
||||
onUpdate: (coverUrl, isUpload) => handleCoverChange(coverUrl, isUpload),
|
||||
onUpdate: (coverUrl, isUpload, preview) => handleCoverChange(coverUrl, isUpload, preview),
|
||||
title: __('Edit Cover Image'),
|
||||
helpText: __('(6.25:1)'),
|
||||
assetName: __('Cover Image'),
|
||||
|
||||
@@ -50,6 +50,7 @@ function ChannelThumbnail(props: Props) {
|
||||
setThumbUploadError,
|
||||
ThumbUploadError,
|
||||
} = props;
|
||||
const [retries, setRetries] = React.useState(3);
|
||||
const [thumbLoadError, setThumbLoadError] = React.useState(ThumbUploadError);
|
||||
const shouldResolve = !isResolving && claim === undefined;
|
||||
const thumbnail = rawThumbnail && rawThumbnail.trim().replace(/^http:\/\//i, 'https://');
|
||||
@@ -58,6 +59,15 @@ function ChannelThumbnail(props: Props) {
|
||||
const channelThumbnail = thumbnailPreview || thumbnail || defaultAvatar;
|
||||
const isGif = channelThumbnail && channelThumbnail.endsWith('gif');
|
||||
const showThumb = (!obscure && !!thumbnail) || thumbnailPreview;
|
||||
const avatarSrc = React.useMemo(() => {
|
||||
if (retries <= 0) {
|
||||
return defaultAvatar;
|
||||
}
|
||||
if (!thumbLoadError) {
|
||||
return channelThumbnail;
|
||||
}
|
||||
return defaultAvatar;
|
||||
}, [retries, thumbLoadError, channelThumbnail, defaultAvatar]);
|
||||
|
||||
// Generate a random color class based on the first letter of the channel name
|
||||
const { channelName } = parseURI(uri);
|
||||
@@ -100,9 +110,10 @@ function ChannelThumbnail(props: Props) {
|
||||
<OptimizedImage
|
||||
alt={__('Channel profile picture')}
|
||||
className={!channelThumbnail ? 'channel-thumbnail__default' : 'channel-thumbnail__custom'}
|
||||
src={(!thumbLoadError && channelThumbnail) || defaultAvatar}
|
||||
src={avatarSrc}
|
||||
loading={noLazyLoad ? undefined : 'lazy'}
|
||||
onError={() => {
|
||||
setRetries((retries) => retries - 1);
|
||||
if (setThumbUploadError) {
|
||||
setThumbUploadError(true);
|
||||
} else {
|
||||
|
||||
@@ -28,7 +28,6 @@ import type { ElementRef } from 'react';
|
||||
import UriIndicator from 'component/uriIndicator';
|
||||
import usePersistedState from 'effects/use-persisted-state';
|
||||
import WalletTipAmountSelector from 'component/walletTipAmountSelector';
|
||||
|
||||
import { getStripeEnvironment } from 'util/stripe';
|
||||
const stripeEnvironment = getStripeEnvironment();
|
||||
|
||||
|
||||
@@ -23,6 +23,9 @@ import { doCommentReset, doCommentList, doCommentById, doCommentReactList } from
|
||||
import { selectActiveChannelClaim } from 'redux/selectors/app';
|
||||
import { getChannelIdFromClaim } from 'util/claim';
|
||||
import CommentsList from './view';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
import * as SETTINGS from 'constants/settings';
|
||||
import { doSetClientSetting } from 'redux/actions/settings';
|
||||
|
||||
const select = (state, props) => {
|
||||
const { uri } = props;
|
||||
@@ -56,15 +59,19 @@ const select = (state, props) => {
|
||||
myReactsByCommentId: selectMyReacts(state),
|
||||
othersReactsById: selectOthersReacts(state),
|
||||
activeChannelId: activeChannelClaim && activeChannelClaim.claim_id,
|
||||
customCommentServers: makeSelectClientSetting(SETTINGS.CUSTOM_COMMENTS_SERVERS)(state),
|
||||
commentServer: makeSelectClientSetting(SETTINGS.CUSTOM_COMMENTS_SERVER_URL)(state),
|
||||
};
|
||||
};
|
||||
|
||||
const perform = {
|
||||
fetchTopLevelComments: doCommentList,
|
||||
fetchComment: doCommentById,
|
||||
fetchReacts: doCommentReactList,
|
||||
resetComments: doCommentReset,
|
||||
doResolveUris,
|
||||
};
|
||||
const perform = (dispatch, ownProps) => ({
|
||||
fetchTopLevelComments: (uri, parentId, page, pageSize, sortBy) =>
|
||||
dispatch(doCommentList(uri, parentId, page, pageSize, sortBy)),
|
||||
fetchComment: (commentId) => dispatch(doCommentById(commentId)),
|
||||
fetchReacts: (commentIds) => dispatch(doCommentReactList(commentIds)),
|
||||
resetComments: (claimId) => dispatch(doCommentReset(claimId)),
|
||||
doResolveUris: (uris, returnCachedClaims) => dispatch(doResolveUris(uris, returnCachedClaims)),
|
||||
setCommentServer: (url) => dispatch(doSetClientSetting(SETTINGS.CUSTOM_COMMENTS_SERVER_URL, url, true)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(CommentsList);
|
||||
@@ -1,6 +1,6 @@
|
||||
// @flow
|
||||
import { COMMENT_PAGE_SIZE_TOP_LEVEL, SORT_BY } from 'constants/comment';
|
||||
import { ENABLE_COMMENT_REACTIONS } from 'config';
|
||||
import { ENABLE_COMMENT_REACTIONS, COMMENT_SERVER_API, COMMENT_SERVER_NAME } from 'config';
|
||||
import { useIsMobile, useIsMediumScreen } from 'effects/use-screensize';
|
||||
import { getCommentsListTitle } from 'util/comments';
|
||||
import * as ICONS from 'constants/icons';
|
||||
@@ -15,6 +15,8 @@ import Empty from 'component/common/empty';
|
||||
import React, { useEffect } from 'react';
|
||||
import Spinner from 'component/spinner';
|
||||
import usePersistedState from 'effects/use-persisted-state';
|
||||
import { FormField } from 'component/common/form';
|
||||
import Comments from 'comments';
|
||||
|
||||
const DEBOUNCE_SCROLL_HANDLER_MS = 200;
|
||||
|
||||
@@ -52,6 +54,9 @@ type Props = {
|
||||
fetchReacts: (commentIds: Array<string>) => Promise<any>,
|
||||
resetComments: (claimId: string) => void,
|
||||
doResolveUris: (uris: Array<string>, returnCachedClaims: boolean) => void,
|
||||
customCommentServers: Array<CommentServerDetails>,
|
||||
setCommentServer: (string) => void,
|
||||
commentServer: string,
|
||||
};
|
||||
|
||||
export default function CommentList(props: Props) {
|
||||
@@ -80,11 +85,17 @@ export default function CommentList(props: Props) {
|
||||
fetchReacts,
|
||||
resetComments,
|
||||
doResolveUris,
|
||||
customCommentServers,
|
||||
setCommentServer,
|
||||
commentServer,
|
||||
} = props;
|
||||
|
||||
const isMobile = useIsMobile();
|
||||
const isMediumScreen = useIsMediumScreen();
|
||||
|
||||
const defaultServer = { name: COMMENT_SERVER_NAME, url: COMMENT_SERVER_API };
|
||||
const allServers = [defaultServer, ...(customCommentServers || [])];
|
||||
|
||||
const spinnerRef = React.useRef();
|
||||
const DEFAULT_SORT = ENABLE_COMMENT_REACTIONS ? SORT_BY.POPULARITY : SORT_BY.NEWEST;
|
||||
const [sort, setSort] = usePersistedState('comment-sort-by', DEFAULT_SORT);
|
||||
@@ -255,7 +266,16 @@ export default function CommentList(props: Props) {
|
||||
}, [alreadyResolved, doResolveUris, topLevelComments]);
|
||||
|
||||
const commentProps = { isTopLevel: true, threadDepth: 3, uri, claimIsMine, linkedCommentId };
|
||||
const actionButtonsProps = { totalComments, sort, changeSort, setPage };
|
||||
const actionButtonsProps = {
|
||||
totalComments,
|
||||
sort,
|
||||
changeSort,
|
||||
setPage,
|
||||
allServers,
|
||||
commentServer,
|
||||
defaultServer,
|
||||
setCommentServer,
|
||||
};
|
||||
|
||||
return (
|
||||
<Card
|
||||
@@ -334,11 +354,15 @@ type ActionButtonsProps = {
|
||||
sort: string,
|
||||
changeSort: (string) => void,
|
||||
setPage: (number) => void,
|
||||
allServers: Array<CommentServerDetails>,
|
||||
commentServer: string,
|
||||
setCommentServer: (string) => void,
|
||||
defaultServer: CommentServerDetails,
|
||||
};
|
||||
|
||||
const CommentActionButtons = (actionButtonsProps: ActionButtonsProps) => {
|
||||
const { totalComments, sort, changeSort, setPage } = actionButtonsProps;
|
||||
|
||||
const { totalComments, sort, changeSort, setPage, allServers, commentServer, setCommentServer, defaultServer } =
|
||||
actionButtonsProps;
|
||||
const sortButtonProps = { activeSort: sort, changeSort };
|
||||
|
||||
return (
|
||||
@@ -355,8 +379,34 @@ const CommentActionButtons = (actionButtonsProps: ActionButtonsProps) => {
|
||||
<SortButton {...sortButtonProps} label={__('New')} icon={ICONS.NEW} sortOption={SORT_BY.NEWEST} />
|
||||
</span>
|
||||
)}
|
||||
|
||||
<Button button="alt" icon={ICONS.REFRESH} title={__('Refresh')} onClick={() => setPage(0)} />
|
||||
<div className="button_refresh">
|
||||
<Button button="alt" icon={ICONS.REFRESH} title={__('Refresh')} onClick={() => setPage(0)} />
|
||||
</div>
|
||||
{allServers.length >= 2 && (
|
||||
<div className="button_selectedServer">
|
||||
<FormField
|
||||
type="select-tiny"
|
||||
onChange={function (x) {
|
||||
const selectedServer = x.target.value;
|
||||
setCommentServer(selectedServer);
|
||||
if (selectedServer === defaultServer.url) {
|
||||
Comments.setServerUrl(undefined);
|
||||
} else {
|
||||
Comments.setServerUrl(selectedServer);
|
||||
}
|
||||
}}
|
||||
value={commentServer}
|
||||
>
|
||||
{allServers.map(function (server) {
|
||||
return (
|
||||
<option key={server.url} value={server.url}>
|
||||
{server.name}
|
||||
</option>
|
||||
);
|
||||
})}
|
||||
</FormField>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -47,7 +47,24 @@ class FileSelector extends React.PureComponent<Props> {
|
||||
};
|
||||
|
||||
handleDirectoryInputSelection = () => {
|
||||
remote.dialog.showOpenDialog({ properties: ['openDirectory'] }).then((result) => {
|
||||
let defaultPath;
|
||||
let properties;
|
||||
let isWin = process.platform === 'win32';
|
||||
let type = this.props.type;
|
||||
|
||||
if (isWin === true) {
|
||||
defaultPath = process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE;
|
||||
}
|
||||
|
||||
if (type === 'openFile') {
|
||||
properties = ['openFile'];
|
||||
}
|
||||
|
||||
if (type === 'openDirectory') {
|
||||
properties = ['openDirectory'];
|
||||
}
|
||||
|
||||
remote.dialog.showOpenDialog({ properties, defaultPath }).then((result) => {
|
||||
const path = result && result.filePaths[0];
|
||||
if (path) {
|
||||
// $FlowFixMe
|
||||
@@ -82,7 +99,11 @@ class FileSelector extends React.PureComponent<Props> {
|
||||
autoFocus={autoFocus}
|
||||
button="primary"
|
||||
disabled={disabled}
|
||||
onClick={type === 'openDirectory' ? this.handleDirectoryInputSelection : this.fileInputButton}
|
||||
onClick={
|
||||
type === 'openDirectory' || type === 'openFile'
|
||||
? this.handleDirectoryInputSelection
|
||||
: this.fileInputButton
|
||||
}
|
||||
label={__('Browse')}
|
||||
/>
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ export class FormField extends React.PureComponent<Props> {
|
||||
{!noEmojis && openEmoteMenu && (
|
||||
<Button
|
||||
type="alt"
|
||||
className="button--file-action"
|
||||
className="button--comment-icons"
|
||||
title="Emotes"
|
||||
onClick={openEmoteMenu}
|
||||
icon={ICONS.EMOJI}
|
||||
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
} from 'redux/selectors/claims';
|
||||
import { makeSelectPendingAmountByUri } from 'redux/selectors/wallet';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
import { selectUser } from 'redux/selectors/user';
|
||||
import FileDescription from './view';
|
||||
|
||||
const select = (state, props) => {
|
||||
@@ -17,7 +16,6 @@ const select = (state, props) => {
|
||||
claim,
|
||||
claimIsMine: selectClaimIsMine(state, claim),
|
||||
metadata: makeSelectMetadataForUri(props.uri)(state),
|
||||
user: selectUser(state),
|
||||
pendingAmount: makeSelectPendingAmountByUri(props.uri)(state),
|
||||
tags: makeSelectTagsForUri(props.uri)(state),
|
||||
};
|
||||
|
||||
@@ -15,7 +15,6 @@ type Props = {
|
||||
uri: string,
|
||||
claim: StreamClaim,
|
||||
metadata: StreamMetadata,
|
||||
user: ?any,
|
||||
tags: any,
|
||||
pendingAmount: number,
|
||||
doOpenModal: (id: string, {}) => void,
|
||||
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
} from 'redux/selectors/claims';
|
||||
import { makeSelectPendingAmountByUri } from 'redux/selectors/wallet';
|
||||
import { makeSelectFileInfoForUri } from 'redux/selectors/file_info';
|
||||
import { selectUser } from 'redux/selectors/user';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
|
||||
import FileValues from './view';
|
||||
@@ -20,7 +19,6 @@ const select = (state, props) => {
|
||||
contentType: makeSelectContentTypeForUri(props.uri)(state),
|
||||
fileInfo: makeSelectFileInfoForUri(props.uri)(state),
|
||||
metadata: makeSelectMetadataForUri(props.uri)(state),
|
||||
user: selectUser(state),
|
||||
pendingAmount: makeSelectPendingAmountByUri(props.uri)(state),
|
||||
claimIsMine: selectClaimIsMine(state, claim),
|
||||
};
|
||||
|
||||
@@ -15,7 +15,6 @@ type Props = {
|
||||
metadata: StreamMetadata,
|
||||
openFolder: (string) => void,
|
||||
contentType: string,
|
||||
user: ?any,
|
||||
pendingAmount: string,
|
||||
openModal: (id: string, { uri: string }) => void,
|
||||
claimIsMine: boolean,
|
||||
|
||||
@@ -6,12 +6,11 @@ import { selectClientSetting } from 'redux/selectors/settings';
|
||||
import { selectGetSyncErrorMessage } from 'redux/selectors/sync';
|
||||
import { selectHasNavigated } from 'redux/selectors/app';
|
||||
import { selectTotalBalance, selectBalance } from 'redux/selectors/wallet';
|
||||
import { selectUserVerifiedEmail, selectEmailToVerify, selectUser } from 'redux/selectors/user';
|
||||
import { selectEmailToVerify, selectUser } from 'redux/selectors/user';
|
||||
import * as SETTINGS from 'constants/settings';
|
||||
import Header from './view';
|
||||
|
||||
const select = (state) => ({
|
||||
authenticated: selectUserVerifiedEmail(state),
|
||||
balance: selectBalance(state),
|
||||
emailToVerify: selectEmailToVerify(state),
|
||||
hasNavigated: selectHasNavigated(state),
|
||||
|
||||
@@ -4,11 +4,10 @@ import { selectActiveChannelStakedLevel } from 'redux/selectors/app';
|
||||
import { selectClientSetting } from 'redux/selectors/settings';
|
||||
import * as SETTINGS from 'constants/settings';
|
||||
import HeaderMenuButtons from './view';
|
||||
import { selectUserVerifiedEmail, selectUser } from 'redux/selectors/user';
|
||||
import { selectUser } from 'redux/selectors/user';
|
||||
|
||||
const select = (state) => ({
|
||||
activeChannelStakedLevel: selectActiveChannelStakedLevel(state),
|
||||
authenticated: selectUserVerifiedEmail(state),
|
||||
automaticDarkModeEnabled: selectClientSetting(state, SETTINGS.AUTOMATIC_DARK_MODE_ENABLED),
|
||||
currentTheme: selectClientSetting(state, SETTINGS.THEME),
|
||||
user: selectUser(state),
|
||||
|
||||
@@ -12,7 +12,6 @@ import React from 'react';
|
||||
import Tooltip from 'component/common/tooltip';
|
||||
|
||||
type HeaderMenuButtonProps = {
|
||||
authenticated: boolean,
|
||||
automaticDarkModeEnabled: boolean,
|
||||
currentTheme: string,
|
||||
user: ?User,
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { selectReferralReward } from 'redux/selectors/rewards';
|
||||
import { selectUserInvitees, selectUserInviteStatusIsPending } from 'redux/selectors/user';
|
||||
import InviteList from './view';
|
||||
|
||||
const select = state => ({
|
||||
invitees: selectUserInvitees(state),
|
||||
isPending: selectUserInviteStatusIsPending(state),
|
||||
referralReward: selectReferralReward(state),
|
||||
});
|
||||
|
||||
const perform = () => ({});
|
||||
|
||||
export default connect(select, perform)(InviteList);
|
||||
@@ -1,99 +0,0 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import RewardLink from 'component/rewardLink';
|
||||
import Icon from 'component/common/icon';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import Card from 'component/common/card';
|
||||
import LbcMessage from 'component/common/lbc-message';
|
||||
|
||||
type Props = {
|
||||
invitees: ?Array<{
|
||||
email: string,
|
||||
invite_accepted: boolean,
|
||||
invite_reward_claimed: boolean,
|
||||
invite_reward_claimable: boolean,
|
||||
}>,
|
||||
referralReward: ?Reward,
|
||||
};
|
||||
|
||||
class InviteList extends React.PureComponent<Props> {
|
||||
render() {
|
||||
const { invitees, referralReward } = this.props;
|
||||
|
||||
if (!invitees || !invitees.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let rewardAmount = 0;
|
||||
let rewardHelp = __(
|
||||
"Woah, you have a lot of friends! You've claimed the maximum amount of invite rewards. Email %email% if you'd like to be whitelisted for more invites.",
|
||||
{ email: 'hello@lbry.com' }
|
||||
);
|
||||
|
||||
if (referralReward) {
|
||||
rewardAmount = referralReward.reward_amount;
|
||||
rewardHelp = referralReward.reward_description;
|
||||
}
|
||||
const showClaimable = invitees.some(invite => invite.invite_reward_claimable && !invite.invite_reward_claimed);
|
||||
|
||||
return (
|
||||
<Card
|
||||
title={<div className="table__header-text">{__('Invite History')}</div>}
|
||||
subtitle={
|
||||
<div className="table__header-text">
|
||||
<LbcMessage>{rewardHelp}</LbcMessage>
|
||||
</div>
|
||||
}
|
||||
titleActions={
|
||||
referralReward &&
|
||||
showClaimable && (
|
||||
<div className="card__actions--inline">
|
||||
<RewardLink
|
||||
button
|
||||
label={__(`Claim Your %reward_amount% Credit Invite Reward`, { reward_amount: rewardAmount })}
|
||||
claim_code={referralReward.claim_code}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
isBodyList
|
||||
body={
|
||||
<div className="table__wrapper">
|
||||
<table className="table section">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{__('Invitee Email')}</th>
|
||||
<th>{__('Invite Status')}</th>
|
||||
<th>{__('Reward')}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{invitees.map(invitee => (
|
||||
<tr key={invitee.email}>
|
||||
<td>{invitee.email}</td>
|
||||
<td>
|
||||
<span>{invitee.invite_accepted ? __('Accepted') : __('Not Accepted')}</span>
|
||||
</td>
|
||||
<td>
|
||||
{invitee.invite_reward_claimed && (
|
||||
<React.Fragment>
|
||||
<span>{__('Claimed')}</span>
|
||||
<Icon icon={ICONS.COMPLETE} />
|
||||
</React.Fragment>
|
||||
)}
|
||||
|
||||
{!invitee.invite_reward_claimed &&
|
||||
(invitee.invite_reward_claimable ? <span>{__('Claimable')}</span> : __('Unclaimable'))}
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default InviteList;
|
||||
@@ -1,29 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
selectUserInvitesRemaining,
|
||||
selectUserInviteNewIsPending,
|
||||
selectUserInviteNewErrorMessage,
|
||||
selectUserInviteReferralLink,
|
||||
selectUserInviteReferralCode,
|
||||
} from 'redux/selectors/user';
|
||||
// import { doUserInviteNew } from 'redux/actions/user';
|
||||
import { selectMyChannelClaims, selectFetchingMyChannels } from 'redux/selectors/claims';
|
||||
import { doFetchChannelListMine } from 'redux/actions/claims';
|
||||
import InviteNew from './view';
|
||||
|
||||
const select = (state) => ({
|
||||
errorMessage: selectUserInviteNewErrorMessage(state),
|
||||
invitesRemaining: selectUserInvitesRemaining(state),
|
||||
referralLink: selectUserInviteReferralLink(state),
|
||||
referralCode: selectUserInviteReferralCode(state),
|
||||
isPending: selectUserInviteNewIsPending(state),
|
||||
channels: selectMyChannelClaims(state),
|
||||
fetchingChannels: selectFetchingMyChannels(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
// inviteNew: (email) => dispatch(doUserInviteNew(email)),
|
||||
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(InviteNew);
|
||||
@@ -1,154 +0,0 @@
|
||||
// @flow
|
||||
import { URL, SITE_NAME } from 'config';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import Button from 'component/button';
|
||||
import { Form, FormField } from 'component/common/form';
|
||||
import CopyableText from 'component/copyableText';
|
||||
import Card from 'component/common/card';
|
||||
import analytics from 'analytics';
|
||||
import I18nMessage from 'component/i18nMessage';
|
||||
import LbcSymbol from 'component/common/lbc-symbol';
|
||||
|
||||
type Props = {
|
||||
errorMessage: ?string,
|
||||
inviteNew: (string) => void,
|
||||
isPending: boolean,
|
||||
referralLink: string,
|
||||
referralCode: string,
|
||||
channels: ?Array<ChannelClaim>,
|
||||
};
|
||||
|
||||
function InviteNew(props: Props) {
|
||||
const { inviteNew, errorMessage, isPending, referralCode = '', channels } = props;
|
||||
|
||||
// Email
|
||||
const [email, setEmail] = useState('');
|
||||
function handleSubmit() {
|
||||
inviteNew(email);
|
||||
}
|
||||
|
||||
function handleEmailChanged(event: any) {
|
||||
setEmail(event.target.value);
|
||||
}
|
||||
|
||||
// Referral link
|
||||
const [referralSource, setReferralSource] = useState(referralCode);
|
||||
|
||||
const handleReferralChange = React.useCallback(
|
||||
(code) => {
|
||||
setReferralSource(code);
|
||||
// TODO: keep track of this in an array?
|
||||
const matchingChannel = channels && channels.find((ch) => ch.name === code);
|
||||
if (matchingChannel) {
|
||||
analytics.apiLogPublish(matchingChannel);
|
||||
}
|
||||
},
|
||||
[setReferralSource]
|
||||
);
|
||||
|
||||
const topChannel =
|
||||
channels &&
|
||||
channels.reduce((top, channel) => {
|
||||
const topClaimCount = (top && top.meta && top.meta.claims_in_channel) || 0;
|
||||
const currentClaimCount = (channel && channel.meta && channel.meta.claims_in_channel) || 0;
|
||||
return topClaimCount >= currentClaimCount ? top : channel;
|
||||
});
|
||||
const referralString =
|
||||
channels && channels.length && referralSource !== referralCode
|
||||
? lookupUrlByClaimName(referralSource, channels)
|
||||
: referralSource;
|
||||
|
||||
const referral = `${URL}/$/invite/${referralString.replace('#', ':')}`;
|
||||
|
||||
useEffect(() => {
|
||||
// set default channel
|
||||
if (topChannel) {
|
||||
handleReferralChange(topChannel.name);
|
||||
}
|
||||
}, [topChannel, handleReferralChange]);
|
||||
|
||||
function lookupUrlByClaimName(name, channels) {
|
||||
const claim = channels.find((channel) => channel.name === name);
|
||||
return claim && claim.canonical_url ? claim.canonical_url.replace('lbry://', '') : name;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={'columns'}>
|
||||
<div className="column">
|
||||
<Card
|
||||
title={__('Invites')}
|
||||
subtitle={
|
||||
<I18nMessage tokens={{ SITE_NAME, lbc: <LbcSymbol /> }}>
|
||||
Earn %lbc% for inviting subscribers, followers, fans, friends, etc. to join and follow you on %SITE_NAME%.
|
||||
You can use invites just like affiliate links.
|
||||
</I18nMessage>
|
||||
}
|
||||
actions={
|
||||
<React.Fragment>
|
||||
<CopyableText label={__('Your invite link')} copyable={referral} />
|
||||
{channels && channels.length > 0 && (
|
||||
<FormField
|
||||
type="select"
|
||||
label={__('Customize link')}
|
||||
value={referralSource}
|
||||
onChange={(e) => handleReferralChange(e.target.value)}
|
||||
>
|
||||
{channels.map((channel) => (
|
||||
<option key={channel.claim_id} value={channel.name}>
|
||||
{channel.name}
|
||||
</option>
|
||||
))}
|
||||
<option value={referralCode}>{referralCode}</option>
|
||||
</FormField>
|
||||
)}
|
||||
</React.Fragment>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<div className="column">
|
||||
<Card
|
||||
title={__('Invite by email')}
|
||||
subtitle={
|
||||
<I18nMessage tokens={{ SITE_NAME, lbc: <LbcSymbol /> }}>
|
||||
Invite someone you know by email and earn %lbc% when they join %SITE_NAME%.
|
||||
</I18nMessage>
|
||||
}
|
||||
actions={
|
||||
<React.Fragment>
|
||||
<Form onSubmit={handleSubmit}>
|
||||
<FormField
|
||||
type="text"
|
||||
label={__('Email')}
|
||||
placeholder="youremail@example.org"
|
||||
name="email"
|
||||
value={email}
|
||||
error={errorMessage}
|
||||
inputButton={
|
||||
<Button button="secondary" type="submit" label={__('Invite')} disabled={isPending || !email} />
|
||||
}
|
||||
onChange={(event) => {
|
||||
handleEmailChanged(event);
|
||||
}}
|
||||
/>
|
||||
<p className="help">
|
||||
<I18nMessage
|
||||
tokens={{
|
||||
rewards_link: <Button button="link" navigate="/$/rewards" label={__('rewards')} />,
|
||||
referral_faq_link: (
|
||||
<Button button="link" label={__('FAQ')} href="https://lbry.com/faq/referrals" />
|
||||
),
|
||||
}}
|
||||
>
|
||||
Read our %referral_faq_link% to learn more about rewards.
|
||||
</I18nMessage>
|
||||
</p>
|
||||
</Form>
|
||||
</React.Fragment>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default InviteNew;
|
||||
@@ -1,30 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { withRouter } from 'react-router';
|
||||
import REWARDS from 'rewards';
|
||||
import { selectUser, selectSetReferrerPending, selectSetReferrerError } from 'redux/selectors/user';
|
||||
import { doClaimRewardType } from 'redux/actions/rewards';
|
||||
import { selectUnclaimedRewards } from 'redux/selectors/rewards';
|
||||
import { doUserSetReferrer } from 'redux/actions/user';
|
||||
import { selectIsSubscribedForUri } from 'redux/selectors/subscriptions';
|
||||
import { doChannelSubscribe } from 'redux/actions/subscriptions';
|
||||
import Invited from './view';
|
||||
|
||||
const select = (state, props) => {
|
||||
return {
|
||||
user: selectUser(state),
|
||||
referrerSetPending: selectSetReferrerPending(state),
|
||||
referrerSetError: selectSetReferrerError(state),
|
||||
rewards: selectUnclaimedRewards(state),
|
||||
isSubscribed: selectIsSubscribedForUri(state, props.fullUri),
|
||||
fullUri: props.fullUri,
|
||||
referrer: props.referrer,
|
||||
};
|
||||
};
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
claimReward: () => dispatch(doClaimRewardType(REWARDS.TYPE_REFEREE)),
|
||||
setReferrer: (referrer) => dispatch(doUserSetReferrer(referrer)),
|
||||
channelSubscribe: (uri) => dispatch(doChannelSubscribe(uri)),
|
||||
});
|
||||
|
||||
export default withRouter(connect(select, perform)(Invited));
|
||||
@@ -1,225 +0,0 @@
|
||||
// @flow
|
||||
import { SITE_NAME } from 'config';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import React, { useEffect } from 'react';
|
||||
import Button from 'component/button';
|
||||
import ClaimPreview from 'component/claimPreview';
|
||||
import Card from 'component/common/card';
|
||||
import { buildURI, parseURI } from 'util/lbryURI';
|
||||
import { ERRORS } from 'lbryinc';
|
||||
import REWARDS from 'rewards';
|
||||
import { formatLbryUrlForWeb } from 'util/url';
|
||||
import ChannelContent from 'component/channelContent';
|
||||
import I18nMessage from 'component/i18nMessage';
|
||||
|
||||
type Props = {
|
||||
user: any,
|
||||
claimReward: () => void,
|
||||
setReferrer: (string) => void,
|
||||
referrerSetPending: boolean,
|
||||
referrerSetError: string,
|
||||
channelSubscribe: (sub: Subscription) => void,
|
||||
history: { push: (string) => void },
|
||||
rewards: Array<Reward>,
|
||||
referrer: string,
|
||||
fullUri: string,
|
||||
isSubscribed: boolean,
|
||||
};
|
||||
|
||||
function Invited(props: Props) {
|
||||
const {
|
||||
user,
|
||||
claimReward,
|
||||
setReferrer,
|
||||
referrerSetPending,
|
||||
referrerSetError,
|
||||
channelSubscribe,
|
||||
history,
|
||||
rewards,
|
||||
fullUri,
|
||||
referrer,
|
||||
isSubscribed,
|
||||
} = props;
|
||||
|
||||
const refUri = referrer && 'lbry://' + referrer.replace(':', '#');
|
||||
const {
|
||||
isChannel: referrerIsChannel,
|
||||
claimName: referrerChannelName,
|
||||
channelClaimId: referrerChannelClaimId,
|
||||
} = parseURI(refUri);
|
||||
const channelUri =
|
||||
referrerIsChannel &&
|
||||
formatLbryUrlForWeb(buildURI({ channelName: referrerChannelName, channelClaimId: referrerChannelClaimId }));
|
||||
const rewardsApproved = user && user.is_reward_approved;
|
||||
const hasVerifiedEmail = user && user.has_verified_email;
|
||||
const referredRewardAvailable = rewards && rewards.some((reward) => reward.reward_type === REWARDS.TYPE_REFEREE);
|
||||
const redirect = channelUri || `/`;
|
||||
|
||||
// always follow if it's a channel
|
||||
useEffect(() => {
|
||||
if (fullUri && !isSubscribed && fullUri) {
|
||||
let channelName;
|
||||
try {
|
||||
const { claimName } = parseURI(fullUri);
|
||||
channelName = claimName;
|
||||
} catch (e) {}
|
||||
if (channelName) {
|
||||
channelSubscribe({
|
||||
channelName: channelName,
|
||||
uri: fullUri,
|
||||
});
|
||||
}
|
||||
}
|
||||
}, [fullUri, isSubscribed, channelSubscribe]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!referrerSetPending && hasVerifiedEmail) {
|
||||
claimReward();
|
||||
}
|
||||
}, [referrerSetPending, hasVerifiedEmail, claimReward]);
|
||||
|
||||
useEffect(() => {
|
||||
if (referrer) {
|
||||
setReferrer(referrer.replace(':', '#'));
|
||||
}
|
||||
}, [referrer, setReferrer]);
|
||||
|
||||
function handleDone() {
|
||||
history.push(redirect);
|
||||
}
|
||||
|
||||
if (referrerSetError === ERRORS.ALREADY_CLAIMED) {
|
||||
return (
|
||||
<Card
|
||||
title={__(`Whoa`)}
|
||||
subtitle={
|
||||
referrerIsChannel
|
||||
? __(`You've already claimed your referrer, but we've followed this channel for you.`)
|
||||
: __(`You've already claimed your referrer.`)
|
||||
}
|
||||
body={
|
||||
referrerIsChannel && (
|
||||
<div className="claim-preview--channel">
|
||||
<ClaimPreview key={refUri} uri={refUri} actions={''} type={'small'} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
actions={
|
||||
<div className="card__actions">
|
||||
<Button button="primary" label={__('Done!')} onClick={handleDone} />
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (referrerSetError && referredRewardAvailable) {
|
||||
return (
|
||||
<Card
|
||||
title={__(`Welcome!`)}
|
||||
subtitle={__(
|
||||
`Something went wrong with your invite link. You can set and claim your invite reward after signing in.`
|
||||
)}
|
||||
actions={
|
||||
<>
|
||||
<p className="error__text">{__('Not a valid invite')}</p>
|
||||
<div className="card__actions">
|
||||
<Button
|
||||
button="primary"
|
||||
label={hasVerifiedEmail ? __('Verify') : __('Create Account')}
|
||||
navigate={`/$/${PAGES.AUTH}?redirect=/$/${PAGES.REWARDS}`}
|
||||
/>
|
||||
<Button button="link" label={__('Explore')} onClick={handleDone} />
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (!rewardsApproved) {
|
||||
const signUpButton = (
|
||||
<Button
|
||||
button="link"
|
||||
label={hasVerifiedEmail ? __(`Finish verification `) : __(`Create an account `)}
|
||||
navigate={`/$/${PAGES.AUTH}?redirect=/$/${PAGES.INVITE}/${referrer}`}
|
||||
/>
|
||||
);
|
||||
|
||||
return (
|
||||
<Card
|
||||
title={
|
||||
referrerIsChannel
|
||||
? __('%channel_name% invites you to the party!', { channel_name: referrerChannelName })
|
||||
: __(`You're invited!`)
|
||||
}
|
||||
subtitle={
|
||||
<p>
|
||||
{referrerIsChannel ? (
|
||||
<I18nMessage
|
||||
tokens={{
|
||||
channel_name: referrerChannelName,
|
||||
signup_link: signUpButton,
|
||||
SITE_NAME,
|
||||
}}
|
||||
>
|
||||
%channel_name% is waiting for you on %SITE_NAME%. Create your account now.
|
||||
</I18nMessage>
|
||||
) : (
|
||||
<I18nMessage
|
||||
tokens={{
|
||||
signup_link: signUpButton,
|
||||
}}
|
||||
>
|
||||
Content freedom and a present are waiting for you. %signup_link% to claim it.
|
||||
</I18nMessage>
|
||||
)}
|
||||
</p>
|
||||
}
|
||||
body={
|
||||
referrerIsChannel && (
|
||||
<div className="claim-preview--channel">
|
||||
<div className="section">
|
||||
<ClaimPreview key={refUri} uri={refUri} actions={''} type={'small'} />
|
||||
</div>
|
||||
<div className="section">
|
||||
<ChannelContent uri={fullUri} defaultPageSize={3} defaultInfiniteScroll={false} />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
actions={
|
||||
<div className="section__actions">
|
||||
<Button
|
||||
button="primary"
|
||||
label={hasVerifiedEmail ? __('Finish Account') : __('Create Account')}
|
||||
navigate={`/$/${PAGES.AUTH}?redirect=/$/${PAGES.INVITE}/${referrer}`}
|
||||
/>
|
||||
<Button button="link" label={__('Skip')} onClick={handleDone} />
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Card
|
||||
title={__(`Welcome!`)}
|
||||
subtitle={referrerIsChannel ? __(`We've followed your invitee for you. Check them out!`) : __(`Congrats!`)}
|
||||
body={
|
||||
referrerIsChannel && (
|
||||
<div className="claim-preview--channel">
|
||||
<ClaimPreview key={refUri} uri={refUri} actions={''} type={'small'} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
actions={
|
||||
<div className="section__actions">
|
||||
<Button button="primary" label={__('Done')} onClick={handleDone} />
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default Invited;
|
||||
@@ -1,3 +1,11 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { selectRemoteVersion } from 'redux/selectors/app';
|
||||
import LastReleaseChanges from './view';
|
||||
|
||||
export default LastReleaseChanges;
|
||||
const select = (state) => ({
|
||||
releaseVersion: selectRemoteVersion(state),
|
||||
});
|
||||
|
||||
const perform = {};
|
||||
|
||||
export default connect(select, perform)(LastReleaseChanges);
|
||||
@@ -5,11 +5,12 @@ import Button from 'component/button';
|
||||
import I18nMessage from 'component/i18nMessage';
|
||||
|
||||
type Props = {
|
||||
releaseVersion: string,
|
||||
hideReleaseVersion?: boolean,
|
||||
};
|
||||
|
||||
const LastReleaseChanges = (props: Props) => {
|
||||
const { hideReleaseVersion } = props;
|
||||
const { hideReleaseVersion, releaseVersion } = props;
|
||||
const [releaseTag, setReleaseTag] = useState('');
|
||||
const [releaseChanges, setReleaseChanges] = useState('');
|
||||
const [fetchingReleaseChanges, setFetchingReleaseChanges] = useState(false);
|
||||
@@ -35,7 +36,7 @@ const LastReleaseChanges = (props: Props) => {
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
const lastReleaseUrl = 'https://api.github.com/repos/lbryio/lbry-desktop/releases/latest';
|
||||
const lastReleaseUrl = `https://api.github.com/repos/lbryio/lbry-desktop/releases/tags/${releaseVersion}`;
|
||||
const options = {
|
||||
method: 'GET',
|
||||
headers: { Accept: 'application/vnd.github.v3+json' },
|
||||
@@ -54,7 +55,7 @@ const LastReleaseChanges = (props: Props) => {
|
||||
setFetchingReleaseChanges(false);
|
||||
setFetchReleaseFailed(true);
|
||||
});
|
||||
}, []);
|
||||
}, [releaseVersion, setFetchingReleaseChanges, setReleaseTag, setReleaseChanges, setFetchReleaseFailed]);
|
||||
|
||||
if (fetchingReleaseChanges) {
|
||||
return <p>{__('Loading...')}</p>;
|
||||
|
||||
@@ -325,6 +325,7 @@ function PublishFile(props: Props) {
|
||||
{showFileUpload && (
|
||||
<>
|
||||
<FileSelector
|
||||
type="openFile"
|
||||
label={__('File')}
|
||||
disabled={disabled}
|
||||
currentPath={currentFile}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { selectUnclaimedRewardValue } from 'redux/selectors/rewards';
|
||||
import RewardAuthIntro from './view';
|
||||
|
||||
const select = state => ({
|
||||
totalRewardValue: selectUnclaimedRewardValue(state),
|
||||
});
|
||||
|
||||
export default connect(select, null)(RewardAuthIntro);
|
||||
@@ -1,46 +0,0 @@
|
||||
// @flow
|
||||
import { SITE_NAME } from 'config';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import React from 'react';
|
||||
import CreditAmount from 'component/common/credit-amount';
|
||||
import Button from 'component/button';
|
||||
import Card from 'component/common/card';
|
||||
import I18nMessage from 'component/i18nMessage';
|
||||
|
||||
type Props = {
|
||||
balance: number,
|
||||
totalRewardValue: number,
|
||||
title?: string,
|
||||
};
|
||||
|
||||
function RewardAuthIntro(props: Props) {
|
||||
const { totalRewardValue, title } = props;
|
||||
const totalRewardRounded = Math.floor(totalRewardValue / 10) * 10;
|
||||
|
||||
return (
|
||||
<Card
|
||||
title={title || __('Log in to %SITE_NAME% to earn rewards', { SITE_NAME })}
|
||||
subtitle={
|
||||
<I18nMessage
|
||||
tokens={{
|
||||
credit_amount: <CreditAmount inheritStyle amount={totalRewardRounded} />,
|
||||
site_name: SITE_NAME,
|
||||
}}
|
||||
>
|
||||
A %site_name% account allows you to earn more than %credit_amount% in rewards, backup your data, and get
|
||||
content and security updates.
|
||||
</I18nMessage>
|
||||
}
|
||||
actions={
|
||||
<Button
|
||||
requiresAuth
|
||||
button="primary"
|
||||
navigate={`/$/${PAGES.REWARDS_VERIFY}?redirect=/$/${PAGES.REWARDS}`}
|
||||
label={__('Unlock Rewards')}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default RewardAuthIntro;
|
||||
@@ -1,17 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectRewardByClaimCode, makeSelectIsRewardClaimPending } from 'redux/selectors/rewards';
|
||||
import { doClaimRewardType } from 'redux/actions/rewards';
|
||||
|
||||
import RewardLink from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
isPending: makeSelectIsRewardClaimPending()(state, props),
|
||||
reward: makeSelectRewardByClaimCode()(state, props.claim_code),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
claimReward: reward =>
|
||||
dispatch(doClaimRewardType(reward.reward_type, { notifyError: true, params: { claim_code: reward.claim_code } })),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(RewardLink);
|
||||
@@ -1,48 +0,0 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import Button from 'component/button';
|
||||
import LbcMessage from 'component/common/lbc-message';
|
||||
|
||||
type Reward = {
|
||||
reward_amount: number,
|
||||
reward_range: string,
|
||||
};
|
||||
|
||||
type Props = {
|
||||
isPending: boolean,
|
||||
label: ?string,
|
||||
reward: Reward,
|
||||
button: ?boolean,
|
||||
disabled: boolean,
|
||||
claimReward: (Reward) => void,
|
||||
};
|
||||
|
||||
const RewardLink = (props: Props) => {
|
||||
const { reward, claimReward, label, isPending, button, disabled = false } = props;
|
||||
let displayLabel = label;
|
||||
if (isPending) {
|
||||
displayLabel = __('Claiming...');
|
||||
} else if (label) {
|
||||
displayLabel = label;
|
||||
} else if (reward && reward.reward_range && reward.reward_range.includes('-')) {
|
||||
displayLabel = __('Claim %range% LBC', { range: reward.reward_range });
|
||||
} else if (reward && reward.reward_amount > 0) {
|
||||
displayLabel = __('Claim %amount% LBC', { amount: reward.reward_amount });
|
||||
} else {
|
||||
displayLabel = __('Claim ??? LBC');
|
||||
}
|
||||
|
||||
return !reward ? null : (
|
||||
<Button
|
||||
button={button ? 'primary' : 'link'}
|
||||
disabled={disabled || isPending}
|
||||
label={<LbcMessage>{displayLabel}</LbcMessage>}
|
||||
aria-label={displayLabel}
|
||||
onClick={() => {
|
||||
claimReward(reward);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default RewardLink;
|
||||
@@ -1,9 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { selectClaimedRewards } from 'redux/selectors/rewards';
|
||||
import RewardListClaimed from './view';
|
||||
|
||||
const select = state => ({
|
||||
rewards: selectClaimedRewards(state),
|
||||
});
|
||||
|
||||
export default connect(select, null)(RewardListClaimed);
|
||||
@@ -1,68 +0,0 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import ButtonTransaction from 'component/common/transaction-link';
|
||||
import moment from 'moment';
|
||||
import LbcSymbol from 'component/common/lbc-symbol';
|
||||
import Card from 'component/common/card';
|
||||
|
||||
type Reward = {
|
||||
id: string,
|
||||
reward_title: string,
|
||||
reward_amount: number,
|
||||
transaction_id: string,
|
||||
created_at: string,
|
||||
};
|
||||
|
||||
type Props = {
|
||||
rewards: Array<Reward>,
|
||||
};
|
||||
|
||||
const RewardListClaimed = (props: Props) => {
|
||||
const { rewards } = props;
|
||||
|
||||
if (!rewards || !rewards.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Card
|
||||
title={<div className="table__header-text">{__('Claimed Rewards')}</div>}
|
||||
subtitle={
|
||||
<div className="table__header-text">
|
||||
{__(
|
||||
'Reward history is tied to your email. In case of lost or multiple wallets, your balance may differ from the amounts claimed'
|
||||
)}
|
||||
</div>
|
||||
}
|
||||
isBodyList
|
||||
body={
|
||||
<div className="table__wrapper">
|
||||
<table className="table table--rewards">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{__('Title')}</th>
|
||||
<th>
|
||||
<LbcSymbol size={20} />
|
||||
</th>
|
||||
<th>{__('Transaction')}</th>
|
||||
<th>{__('Date')}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{rewards.reverse().map(reward => (
|
||||
<tr key={reward.id}>
|
||||
<td>{reward.reward_title}</td>
|
||||
<td>{reward.reward_amount}</td>
|
||||
<td>{reward.transaction_id && <ButtonTransaction id={reward.transaction_id} />}</td>
|
||||
<td>{moment(reward.created_at).format('LLL')}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default RewardListClaimed;
|
||||
@@ -1,10 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { selectUnclaimedRewardValue, selectFetchingRewards } from 'redux/selectors/rewards';
|
||||
import RewardSummary from './view';
|
||||
|
||||
const select = state => ({
|
||||
unclaimedRewardAmount: selectUnclaimedRewardValue(state),
|
||||
fetching: selectFetchingRewards(state),
|
||||
});
|
||||
|
||||
export default connect(select, null)(RewardSummary);
|
||||
@@ -1,52 +0,0 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import Button from 'component/button';
|
||||
import CreditAmount from 'component/common/credit-amount';
|
||||
import I18nMessage from 'component/i18nMessage';
|
||||
import Card from 'component/common/card';
|
||||
|
||||
type Props = {
|
||||
unclaimedRewardAmount: number,
|
||||
fetching: boolean,
|
||||
};
|
||||
|
||||
class RewardSummary extends React.Component<Props> {
|
||||
render() {
|
||||
const { unclaimedRewardAmount, fetching } = this.props;
|
||||
const hasRewards = unclaimedRewardAmount > 0;
|
||||
return (
|
||||
<Card
|
||||
title={__('Available rewards')}
|
||||
subtitle={
|
||||
<React.Fragment>
|
||||
{fetching && __('You have...')}
|
||||
{!fetching && hasRewards ? (
|
||||
<I18nMessage
|
||||
tokens={{
|
||||
credit_amount: <CreditAmount inheritStyle amount={unclaimedRewardAmount} precision={8} />,
|
||||
}}
|
||||
f
|
||||
>
|
||||
You have %credit_amount% in unclaimed rewards.
|
||||
</I18nMessage>
|
||||
) : (
|
||||
__('You have no rewards available.')
|
||||
)}
|
||||
</React.Fragment>
|
||||
}
|
||||
actions={
|
||||
<React.Fragment>
|
||||
<Button
|
||||
button="primary"
|
||||
navigate="/$/rewards"
|
||||
label={hasRewards ? __('Claim Rewards') : __('View Rewards')}
|
||||
/>
|
||||
<Button button="link" label={__('Learn more')} href="https://lbry.com/faq/rewards" />
|
||||
</React.Fragment>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default RewardSummary;
|
||||
@@ -1,15 +0,0 @@
|
||||
import * as MODALS from 'constants/modal_types';
|
||||
import { connect } from 'react-redux';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
import { selectUser } from 'redux/selectors/user';
|
||||
import RewardTile from './view';
|
||||
|
||||
const select = state => ({
|
||||
user: selectUser(state),
|
||||
});
|
||||
const perform = dispatch => ({
|
||||
openRewardCodeModal: () => dispatch(doOpenModal(MODALS.REWARD_GENERATED_CODE)),
|
||||
openSetReferrerModal: () => dispatch(doOpenModal(MODALS.SET_REFERRER)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(RewardTile);
|
||||
@@ -1,78 +0,0 @@
|
||||
// @flow
|
||||
import * as ICONS from 'constants/icons';
|
||||
import React from 'react';
|
||||
import Icon from 'component/common/icon';
|
||||
import RewardLink from 'component/rewardLink';
|
||||
import Button from 'component/button';
|
||||
import Card from 'component/common/card';
|
||||
import rewards from 'rewards';
|
||||
import LbcMessage from 'component/common/lbc-message';
|
||||
|
||||
type Props = {
|
||||
openRewardCodeModal: () => void,
|
||||
openSetReferrerModal: () => void,
|
||||
reward: {
|
||||
id: string,
|
||||
reward_title: string,
|
||||
reward_amount: number,
|
||||
reward_range?: string,
|
||||
transaction_id: string,
|
||||
created_at: string,
|
||||
reward_description: string,
|
||||
reward_type: string,
|
||||
claim_code: string,
|
||||
},
|
||||
user: User,
|
||||
disabled: boolean,
|
||||
};
|
||||
|
||||
const RewardTile = (props: Props) => {
|
||||
const { reward, openRewardCodeModal, openSetReferrerModal, user, disabled = false } = props;
|
||||
const referrerSet = user && user.invited_by_id;
|
||||
const claimed = !!reward.transaction_id;
|
||||
const customActionsRewards = [rewards.TYPE_REFERRAL, rewards.TYPE_REFEREE];
|
||||
|
||||
return (
|
||||
<Card
|
||||
title={__(reward.reward_title)}
|
||||
subtitle={<LbcMessage>{reward.reward_description}</LbcMessage>}
|
||||
actions={
|
||||
<div className="section__actions">
|
||||
{reward.reward_type === rewards.TYPE_GENERATED_CODE && (
|
||||
<Button button="primary" onClick={openRewardCodeModal} label={__('Enter Code')} disabled={disabled} />
|
||||
)}
|
||||
{reward.reward_type === rewards.TYPE_REFERRAL && (
|
||||
<Button
|
||||
button="primary"
|
||||
navigate="/$/invite"
|
||||
label={__('Go To Invites')}
|
||||
aria-hidden={disabled}
|
||||
tabIndex={disabled ? -1 : 0}
|
||||
/>
|
||||
)}
|
||||
{reward.reward_type === rewards.TYPE_REFEREE && (
|
||||
<>
|
||||
{referrerSet && <RewardLink button reward_type={reward.reward_type} disabled={disabled} />}
|
||||
<Button
|
||||
button={referrerSet ? 'link' : 'primary'}
|
||||
onClick={openSetReferrerModal}
|
||||
label={referrerSet ? __('Change Inviter') : __('Set Inviter')}
|
||||
disabled={disabled}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{!customActionsRewards.some((i) => i === reward.reward_type) &&
|
||||
(claimed ? (
|
||||
<span>
|
||||
<Icon icon={ICONS.COMPLETED} /> {__('Reward claimed.')}
|
||||
</span>
|
||||
) : (
|
||||
<RewardLink button claim_code={reward.claim_code} disabled={disabled} />
|
||||
))}
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default RewardTile;
|
||||
@@ -1,16 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { selectUnclaimedRewardValue, selectFetchingRewards, selectClaimedRewards } from 'redux/selectors/rewards';
|
||||
import { doRewardList } from 'redux/actions/rewards';
|
||||
import RewardSummary from './view';
|
||||
|
||||
const select = state => ({
|
||||
unclaimedRewardAmount: selectUnclaimedRewardValue(state),
|
||||
fetching: selectFetchingRewards(state),
|
||||
rewards: selectClaimedRewards(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
fetchRewards: () => dispatch(doRewardList()),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(RewardSummary);
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 46 KiB |
@@ -1,26 +0,0 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import TotalBackground from './total-background.png';
|
||||
import useTween from 'effects/use-tween';
|
||||
import I18nMessage from 'component/i18nMessage';
|
||||
import LbcSymbol from 'component/common/lbc-symbol';
|
||||
|
||||
type Props = {
|
||||
rewards: Array<Reward>,
|
||||
};
|
||||
|
||||
function RewardTotal(props: Props) {
|
||||
const { rewards } = props;
|
||||
const rewardTotal = rewards.reduce((acc, val) => acc + val.reward_amount, 0);
|
||||
const modifier = rewardTotal > 500 ? 1 : 15; // used to tweak the reward count speed
|
||||
const total = useTween(rewardTotal * modifier);
|
||||
const integer = Math.round(total * rewardTotal);
|
||||
|
||||
return (
|
||||
<section className="card card--section card--reward-total" style={{ backgroundImage: `url(${TotalBackground})` }}>
|
||||
<I18nMessage tokens={{ amount: integer, lbc: <LbcSymbol /> }}>%amount% %lbc% earned from rewards</I18nMessage>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
export default RewardTotal;
|
||||
@@ -37,7 +37,6 @@ import ChannelsPage from 'page/channels';
|
||||
import CreatorDashboard from 'page/creatorDashboard';
|
||||
import DiscoverPage from 'page/discover';
|
||||
import FileListPublished from 'page/fileListPublished';
|
||||
import FourOhFourPage from 'page/fourOhFour';
|
||||
import HelpPage from 'page/help';
|
||||
import LibraryPage from 'page/library';
|
||||
import ListBlockedPage from 'page/listBlocked';
|
||||
@@ -227,18 +226,20 @@ function AppRouter(props: Props) {
|
||||
/>
|
||||
))}
|
||||
|
||||
{/* Odysee signin */}
|
||||
<Route path={`/$/${PAGES.AUTH_SIGNIN}`} exact component={SignInPage} />
|
||||
<Route path={`/$/${PAGES.AUTH_PASSWORD_RESET}`} exact component={PasswordResetPage} />
|
||||
<Route path={`/$/${PAGES.AUTH_PASSWORD_SET}`} exact component={PasswordSetPage} />
|
||||
<Route path={`/$/${PAGES.AUTH}`} exact component={SignUpPage} />
|
||||
<Route path={`/$/${PAGES.AUTH}/*`} exact component={SignUpPage} />
|
||||
<Route path={`/$/${PAGES.AUTH_VERIFY}`} exact component={SignInVerifyPage} />
|
||||
|
||||
<Route path={`/$/${PAGES.WELCOME}`} exact component={Welcome} />
|
||||
|
||||
<Route path={`/$/${PAGES.HELP}`} exact component={HelpPage} />
|
||||
{/* @if TARGET='app' */}
|
||||
<Route path={`/$/${PAGES.BACKUP}`} exact component={BackupPage} />
|
||||
{/* @endif */}
|
||||
<Route path={`/$/${PAGES.AUTH_VERIFY}`} exact component={SignInVerifyPage} />
|
||||
<Route path={`/$/${PAGES.SEARCH}`} exact component={SearchPage} />
|
||||
<Route path={`/$/${PAGES.TOP}`} exact component={TopPage} />
|
||||
<Route path={`/$/${PAGES.SETTINGS}`} exact component={SettingsPage} />
|
||||
@@ -279,7 +280,6 @@ function AppRouter(props: Props) {
|
||||
{/* Below need to go at the end to make sure we don't match any of our pages first */}
|
||||
<Route path="/:claimName" exact component={ShowPage} />
|
||||
<Route path="/:claimName/:streamName" exact component={ShowPage} />
|
||||
<Route path="/*" component={FourOhFourPage} />
|
||||
</Switch>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -15,15 +15,35 @@ const SPEECH_UPLOADING = 'UPLOADING';
|
||||
type Props = {
|
||||
assetName: string,
|
||||
currentValue: ?string,
|
||||
onUpdate: (string, boolean) => void,
|
||||
onUpdate: (string, boolean, ?string) => void,
|
||||
recommended: string,
|
||||
title: string,
|
||||
onDone?: () => void,
|
||||
inline?: boolean,
|
||||
// When uploading pictures, the upload service
|
||||
// can return success but the image isn't ready
|
||||
// to be displayed yet. This is when a local preview
|
||||
// comes in handy. The preview (base 64) will be
|
||||
// passed to the onUpdate function after the
|
||||
// upload service returns success.
|
||||
buildImagePreview?: boolean,
|
||||
};
|
||||
|
||||
function filePreview(file) {
|
||||
return new Promise((resolve) => {
|
||||
const reader = new FileReader();
|
||||
reader.onload = () => {
|
||||
resolve(reader.result.toString());
|
||||
};
|
||||
reader.onerror = () => {
|
||||
resolve(undefined);
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
});
|
||||
}
|
||||
|
||||
function SelectAsset(props: Props) {
|
||||
const { onUpdate, onDone, assetName, currentValue, recommended, title, inline } = props;
|
||||
const { onUpdate, onDone, assetName, currentValue, recommended, title, inline, buildImagePreview } = props;
|
||||
const [pathSelected, setPathSelected] = React.useState('');
|
||||
const [fileSelected, setFileSelected] = React.useState<any>(null);
|
||||
const [uploadStatus, setUploadStatus] = React.useState(SPEECH_READY);
|
||||
@@ -36,9 +56,15 @@ function SelectAsset(props: Props) {
|
||||
setError(error);
|
||||
};
|
||||
|
||||
const onSuccess = (thumbnailUrl) => {
|
||||
const onSuccess = async (thumbnailUrl) => {
|
||||
let preview;
|
||||
setUploadStatus(SPEECH_READY);
|
||||
onUpdate(thumbnailUrl, !useUrl);
|
||||
|
||||
if (buildImagePreview) {
|
||||
preview = await filePreview(fileSelected);
|
||||
}
|
||||
|
||||
onUpdate(thumbnailUrl, !useUrl, preview);
|
||||
|
||||
if (onDone) {
|
||||
onDone();
|
||||
|
||||
@@ -53,9 +53,7 @@ export default function SettingAccount(props: Props) {
|
||||
</SettingsRow>
|
||||
)}
|
||||
|
||||
{/* @if TARGET='app' */}
|
||||
<SyncToggle disabled={walletEncrypted && !storedPassword && storedPassword !== ''} />
|
||||
{/* @endif */}
|
||||
|
||||
{hasChannels && (
|
||||
<SettingsRow title={__('Comments')} subtitle={__('View your past comments.')}>
|
||||
|
||||
@@ -5,6 +5,7 @@ import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
import SettingAppearance from './view';
|
||||
|
||||
const select = (state) => ({
|
||||
disableBackground: makeSelectClientSetting(SETTINGS.DISABLE_BACKGROUND)(state),
|
||||
clock24h: makeSelectClientSetting(SETTINGS.CLOCK_24H)(state),
|
||||
searchInLanguage: makeSelectClientSetting(SETTINGS.SEARCH_IN_LANGUAGE)(state),
|
||||
hideBalance: makeSelectClientSetting(SETTINGS.HIDE_BALANCE)(state),
|
||||
|
||||
@@ -12,6 +12,7 @@ import ThemeSelector from 'component/themeSelector';
|
||||
import homepages from 'homepages';
|
||||
|
||||
type Props = {
|
||||
disableBackground: boolean,
|
||||
clock24h: boolean,
|
||||
searchInLanguage: boolean,
|
||||
hideBalance: boolean,
|
||||
@@ -20,7 +21,7 @@ type Props = {
|
||||
};
|
||||
|
||||
export default function SettingAppearance(props: Props) {
|
||||
const { clock24h, searchInLanguage, hideBalance, setClientSetting, setSearchInLanguage } = props;
|
||||
const { clock24h, disableBackground, searchInLanguage, hideBalance, setClientSetting, setSearchInLanguage } = props;
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -63,6 +64,14 @@ export default function SettingAppearance(props: Props) {
|
||||
checked={clock24h}
|
||||
/>
|
||||
</SettingsRow>
|
||||
<SettingsRow title={__('Disable background')}>
|
||||
<FormField
|
||||
type="checkbox"
|
||||
name="background"
|
||||
onChange={() => setClientSetting(SETTINGS.DISABLE_BACKGROUND, !disableBackground)}
|
||||
checked={disableBackground}
|
||||
/>
|
||||
</SettingsRow>
|
||||
<SettingsRow title={__('Hide wallet balance in header')}>
|
||||
<FormField
|
||||
type="checkbox"
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
import { doSetDaemonSetting, doClearDaemonSetting, doFindFFmpeg } from 'redux/actions/settings';
|
||||
import { selectAllowAnalytics } from 'redux/selectors/app';
|
||||
import { selectDaemonSettings, selectFfmpegStatus, selectFindingFFmpeg } from 'redux/selectors/settings';
|
||||
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
||||
import { selectUserVerifiedEmail } from 'redux/selectors/user'; // here
|
||||
|
||||
import SettingSystem from './view';
|
||||
|
||||
|
||||
@@ -6,15 +6,13 @@ import * as KEYCODES from 'constants/keycodes';
|
||||
import React from 'react';
|
||||
import Button from 'component/button';
|
||||
import classnames from 'classnames';
|
||||
import Icon from 'component/common/icon';
|
||||
import NotificationBubble from 'component/notificationBubble';
|
||||
import DebouncedInput from 'component/common/debounced-input';
|
||||
import I18nMessage from 'component/i18nMessage';
|
||||
import ChannelThumbnail from 'component/channelThumbnail';
|
||||
import { useIsMobile, isTouch } from 'effects/use-screensize';
|
||||
import { IS_MAC } from 'component/app/view';
|
||||
import { useHistory } from 'react-router';
|
||||
import { DOMAIN, ENABLE_UI_NOTIFICATIONS } from 'config';
|
||||
import { ENABLE_UI_NOTIFICATIONS } from 'config';
|
||||
|
||||
const FOLLOWED_ITEM_INITIAL_LIMIT = 10;
|
||||
const touch = isTouch();
|
||||
@@ -184,7 +182,6 @@ function SideNavigation(props: Props) {
|
||||
];
|
||||
|
||||
const notificationsEnabled = ENABLE_UI_NOTIFICATIONS || (user && user.experimental_ui);
|
||||
const isAuthenticated = Boolean(email);
|
||||
|
||||
const [pulseLibrary, setPulseLibrary] = React.useState(false);
|
||||
const [expandSubscriptions, setExpandSubscriptions] = React.useState(false);
|
||||
@@ -357,23 +354,6 @@ function SideNavigation(props: Props) {
|
||||
return () => window.removeEventListener('keydown', handleKeydown);
|
||||
}, [sidebarOpen, setSidebarOpen, isAbsolute]);
|
||||
|
||||
const unAuthNudge =
|
||||
DOMAIN === 'lbry.tv' ? null : (
|
||||
<div className="navigation__auth-nudge">
|
||||
<span>
|
||||
<I18nMessage tokens={{ lbc: <Icon icon={ICONS.LBC} /> }}>
|
||||
Sign up to earn %lbc% for you and your favorite creators.
|
||||
</I18nMessage>
|
||||
</span>
|
||||
<Button
|
||||
button="secondary"
|
||||
label={__('Sign Up')}
|
||||
navigate={`/$/${PAGES.AUTH}?src=sidenav_nudge`}
|
||||
disabled={user === null}
|
||||
/>{' '}
|
||||
</div>
|
||||
);
|
||||
|
||||
const helpLinks = (
|
||||
<ul className="navigation__tertiary navigation-links--small">
|
||||
<li className="navigation-link">
|
||||
@@ -437,7 +417,6 @@ function SideNavigation(props: Props) {
|
||||
|
||||
{getSubscriptionSection()}
|
||||
{getFollowedTagsSection()}
|
||||
{!isAuthenticated && sidebarOpen && unAuthNudge}
|
||||
</div>
|
||||
)}
|
||||
{(!canDisposeMenu || sidebarOpen) && shouldRenderLargeMenu && helpLinks}
|
||||
|
||||
@@ -241,8 +241,12 @@ export default class SplashScreen extends React.PureComponent<Props, State> {
|
||||
|
||||
return (
|
||||
<div className="splash">
|
||||
<h1 className="splash__title">LBRY</h1>
|
||||
<div className="splash__details">{details}</div>
|
||||
{!error && (
|
||||
<>
|
||||
<h1 className="splash__title">LBRY</h1>
|
||||
<div className="splash__details">{details}</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
{!animationHidden && !error && (
|
||||
<css-doodle class="doodle">
|
||||
@@ -290,7 +294,7 @@ export default class SplashScreen extends React.PureComponent<Props, State> {
|
||||
)}
|
||||
{error && (
|
||||
<Card
|
||||
title={__('Error starting up')}
|
||||
title={<h1 className="splash__error-title">{__('Error starting up')}</h1>}
|
||||
subtitle={
|
||||
<React.Fragment>
|
||||
<p>
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { selectPhoneNewErrorMessage } from 'redux/selectors/user';
|
||||
import { doUserPhoneNew } from 'redux/actions/user';
|
||||
import UserPhoneNew from './view';
|
||||
|
||||
const select = state => ({
|
||||
phoneErrorMessage: selectPhoneNewErrorMessage(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
addUserPhone: (phone, countryCode) => dispatch(doUserPhoneNew(phone, countryCode)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(UserPhoneNew);
|
||||
@@ -1,124 +0,0 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import { Form, FormField, Submit } from 'component/common/form';
|
||||
import Card from 'component/common/card';
|
||||
|
||||
const os = require('os').type();
|
||||
const countryCodes = require('country-data')
|
||||
.callingCountries.all.filter(_ => _.emoji)
|
||||
.reduce((acc, cur) => acc.concat(cur.countryCallingCodes.map(_ => ({ ...cur, countryCallingCode: _ }))), [])
|
||||
.sort((a, b) => {
|
||||
if (a.countryCallingCode < b.countryCallingCode) {
|
||||
return -1;
|
||||
}
|
||||
if (a.countryCallingCode > b.countryCallingCode) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
|
||||
type Props = {
|
||||
addUserPhone: (string, string) => void,
|
||||
cancelButton: React.Node,
|
||||
phoneErrorMessage: ?string,
|
||||
isPending: boolean,
|
||||
};
|
||||
|
||||
type State = {
|
||||
phone: string,
|
||||
countryCode: string,
|
||||
};
|
||||
|
||||
class UserPhoneNew extends React.PureComponent<Props, State> {
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
phone: '',
|
||||
countryCode: '+1',
|
||||
};
|
||||
|
||||
(this: any).formatPhone = this.formatPhone.bind(this);
|
||||
(this: any).handleSubmit = this.handleSubmit.bind(this);
|
||||
(this: any).handleSelect = this.handleSelect.bind(this);
|
||||
}
|
||||
|
||||
formatPhone(value: string) {
|
||||
const { countryCode } = this.state;
|
||||
const formattedNumber = value.replace(/\D/g, '');
|
||||
|
||||
if (countryCode === '+1') {
|
||||
if (!formattedNumber) {
|
||||
return '';
|
||||
} else if (formattedNumber.length < 4) {
|
||||
return formattedNumber;
|
||||
} else if (formattedNumber.length < 7) {
|
||||
return `(${formattedNumber.substring(0, 3)}) ${formattedNumber.substring(3)}`;
|
||||
}
|
||||
const fullNumber = `(${formattedNumber.substring(0, 3)}) ${formattedNumber.substring(
|
||||
3,
|
||||
6
|
||||
)}-${formattedNumber.substring(6)}`;
|
||||
return fullNumber.length <= 14 ? fullNumber : fullNumber.substring(0, 14);
|
||||
}
|
||||
return formattedNumber;
|
||||
}
|
||||
|
||||
handleChanged(event: SyntheticInputEvent<*>) {
|
||||
this.setState({
|
||||
phone: this.formatPhone(event.target.value),
|
||||
});
|
||||
}
|
||||
|
||||
handleSelect(event: SyntheticInputEvent<*>) {
|
||||
this.setState({ countryCode: event.target.value });
|
||||
}
|
||||
|
||||
handleSubmit() {
|
||||
const { phone, countryCode } = this.state;
|
||||
this.props.addUserPhone(phone.replace(/\D/g, ''), countryCode.substring(1));
|
||||
}
|
||||
|
||||
render() {
|
||||
const { cancelButton, phoneErrorMessage, isPending } = this.props;
|
||||
|
||||
return (
|
||||
<Card
|
||||
title={__('Enter your phone number')}
|
||||
subtitle={__(
|
||||
'Enter your phone number and we will send you a verification code. We will not share your phone number with third parties.'
|
||||
)}
|
||||
actions={
|
||||
<Form onSubmit={this.handleSubmit}>
|
||||
<fieldset-group class="fieldset-group--smushed">
|
||||
<FormField label={__('Country')} type="select" name="country-codes" onChange={this.handleSelect}>
|
||||
{countryCodes.map((country, index) => (
|
||||
<option key={index} value={country.countryCallingCode}>
|
||||
{os === 'Darwin' ? country.emoji : `(${country.alpha2})`} {country.countryCallingCode}
|
||||
</option>
|
||||
))}
|
||||
</FormField>
|
||||
<FormField
|
||||
type="text"
|
||||
label={__('Number')}
|
||||
placeholder={this.state.countryCode === '+1' ? '(555) 555-5555' : '5555555555'}
|
||||
name="phone"
|
||||
value={this.state.phone}
|
||||
error={phoneErrorMessage}
|
||||
onChange={event => {
|
||||
this.handleChanged(event);
|
||||
}}
|
||||
/>
|
||||
</fieldset-group>
|
||||
<div className="card__actions">
|
||||
<Submit label="Submit" disabled={isPending} />
|
||||
{cancelButton}
|
||||
</div>
|
||||
</Form>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default UserPhoneNew;
|
||||
@@ -1,17 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doUserPhoneVerify, doUserPhoneReset } from 'redux/actions/user';
|
||||
import { selectPhoneToVerify, selectPhoneVerifyErrorMessage, selectUserCountryCode } from 'redux/selectors/user';
|
||||
import UserPhoneVerify from './view';
|
||||
|
||||
const select = state => ({
|
||||
phone: selectPhoneToVerify(state),
|
||||
countryCode: selectUserCountryCode(state),
|
||||
phoneErrorMessage: selectPhoneVerifyErrorMessage(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
resetPhone: () => dispatch(doUserPhoneReset()),
|
||||
verifyUserPhone: code => dispatch(doUserPhoneVerify(code)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(UserPhoneVerify);
|
||||
@@ -1,90 +0,0 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import Button from 'component/button';
|
||||
import { Form, FormField, Submit } from 'component/common/form';
|
||||
import I18nMessage from 'component/i18nMessage';
|
||||
import Card from 'component/common/card';
|
||||
import { SITE_HELP_EMAIL } from 'config';
|
||||
|
||||
type Props = {
|
||||
verifyUserPhone: (string) => void,
|
||||
resetPhone: () => void,
|
||||
phoneErrorMessage: string,
|
||||
phone: string,
|
||||
countryCode: string,
|
||||
};
|
||||
|
||||
type State = {
|
||||
code: string,
|
||||
};
|
||||
|
||||
class UserPhoneVerify extends React.PureComponent<Props, State> {
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
code: '',
|
||||
};
|
||||
}
|
||||
|
||||
handleCodeChanged(event: SyntheticInputEvent<*>) {
|
||||
this.setState({
|
||||
code: String(event.target.value).trim(),
|
||||
});
|
||||
}
|
||||
|
||||
handleSubmit() {
|
||||
const { code } = this.state;
|
||||
this.props.verifyUserPhone(code);
|
||||
}
|
||||
|
||||
reset() {
|
||||
const { resetPhone } = this.props;
|
||||
resetPhone();
|
||||
}
|
||||
|
||||
render() {
|
||||
const { phoneErrorMessage, phone, countryCode } = this.props;
|
||||
return (
|
||||
<Card
|
||||
title={__('Enter the verification code')}
|
||||
subtitle={
|
||||
<>
|
||||
{__(`Please enter the verification code sent to +${countryCode}${phone}. Didn't receive it? `)}
|
||||
<Button button="link" onClick={this.reset.bind(this)} label={__('Go back.')} />
|
||||
</>
|
||||
}
|
||||
actions={
|
||||
<>
|
||||
<Form onSubmit={this.handleSubmit.bind(this)}>
|
||||
<FormField
|
||||
type="text"
|
||||
name="code"
|
||||
placeholder="1234"
|
||||
value={this.state.code}
|
||||
onChange={(event) => {
|
||||
this.handleCodeChanged(event);
|
||||
}}
|
||||
label={__('Verification Code')}
|
||||
error={phoneErrorMessage}
|
||||
inputButton={<Submit label={__('Verify')} />}
|
||||
/>
|
||||
</Form>
|
||||
<p className="help">
|
||||
<I18nMessage
|
||||
tokens={{
|
||||
help_link: <Button button="link" href={`mailto:${SITE_HELP_EMAIL}`} label={`${SITE_HELP_EMAIL}`} />,
|
||||
chat_link: <Button button="link" href="https://chat.lbry.com" label={__('chat')} />,
|
||||
}}
|
||||
>
|
||||
Email %help_link% or join our %chat_link% if you encounter any trouble with your code.
|
||||
</I18nMessage>
|
||||
</p>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default UserPhoneVerify;
|
||||
@@ -1,26 +0,0 @@
|
||||
import * as MODALS from 'constants/modal_types';
|
||||
import { connect } from 'react-redux';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
import { doUserIdentityVerify, doUserFetch } from 'redux/actions/user';
|
||||
import { makeSelectRewardByType } from 'redux/selectors/rewards';
|
||||
import rewards from 'rewards';
|
||||
import { selectIdentityVerifyIsPending, selectIdentityVerifyErrorMessage } from 'redux/selectors/user';
|
||||
import UserVerify from './view';
|
||||
|
||||
const select = state => {
|
||||
const selectReward = makeSelectRewardByType();
|
||||
|
||||
return {
|
||||
isPending: selectIdentityVerifyIsPending(state),
|
||||
errorMessage: selectIdentityVerifyErrorMessage(state),
|
||||
reward: selectReward(state, rewards.TYPE_NEW_USER),
|
||||
};
|
||||
};
|
||||
|
||||
const perform = dispatch => ({
|
||||
verifyUserIdentity: token => dispatch(doUserIdentityVerify(token)),
|
||||
verifyPhone: () => dispatch(doOpenModal(MODALS.PHONE_COLLECTION)),
|
||||
fetchUser: () => dispatch(doUserFetch()),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(UserVerify);
|
||||
@@ -1,164 +0,0 @@
|
||||
// @flow
|
||||
import { SITE_NAME } from 'config';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import React, { Fragment } from 'react';
|
||||
import Button from 'component/button';
|
||||
import CardVerify from 'component/cardVerify';
|
||||
import { Lbryio } from 'lbryinc';
|
||||
import Card from 'component/common/card';
|
||||
import I18nMessage from 'component/i18nMessage';
|
||||
import LbcSymbol from 'component/common/lbc-symbol';
|
||||
|
||||
type Props = {
|
||||
errorMessage: ?string,
|
||||
isPending: boolean,
|
||||
verifyUserIdentity: (string) => void,
|
||||
verifyPhone: () => void,
|
||||
fetchUser: () => void,
|
||||
skipLink?: string,
|
||||
onSkip: () => void,
|
||||
};
|
||||
|
||||
class UserVerify extends React.PureComponent<Props> {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
(this: any).onToken = this.onToken.bind(this);
|
||||
}
|
||||
|
||||
onToken(data: { id: string }) {
|
||||
this.props.verifyUserIdentity(data.id);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { errorMessage, isPending, verifyPhone, fetchUser, onSkip } = this.props;
|
||||
const skipButtonProps = {
|
||||
onClick: onSkip,
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="main__auth-content">
|
||||
<section className="section__header">
|
||||
<h1 className="section__title--large">
|
||||
{''}
|
||||
<I18nMessage
|
||||
tokens={{
|
||||
lbc: <LbcSymbol size={48} />,
|
||||
}}
|
||||
>
|
||||
Verify to earn %lbc%
|
||||
</I18nMessage>
|
||||
</h1>
|
||||
<p>
|
||||
<I18nMessage
|
||||
tokens={{
|
||||
rewards_program: (
|
||||
<Button button="link" label={__('other rewards')} href="https://lbry.com/faq/rewards" />
|
||||
),
|
||||
Refresh: <Button onClick={() => fetchUser()} button="link" label={__('Refresh')} />,
|
||||
Skip: <Button {...skipButtonProps} button="link" label={__('Skip')} />,
|
||||
SITE_NAME,
|
||||
}}
|
||||
>
|
||||
Verified accounts are eligible to earn LBRY Credits for views, watching and reposting content, sharing
|
||||
invite links etc. Verifying also helps us keep the %SITE_NAME% community safe too! %Refresh% or %Skip%.
|
||||
</I18nMessage>
|
||||
</p>
|
||||
<p className="help">
|
||||
{__('This step is not mandatory and not required in order for you to use %SITE_NAME%.', { SITE_NAME })}
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<div className="section">
|
||||
<Card
|
||||
icon={ICONS.PHONE}
|
||||
title={__('Verify phone number')}
|
||||
subtitle={__(
|
||||
'You will receive an SMS text message confirming your phone number is valid. May not be available in all regions.'
|
||||
)}
|
||||
actions={
|
||||
<Fragment>
|
||||
<Button
|
||||
onClick={() => {
|
||||
verifyPhone();
|
||||
}}
|
||||
button="primary"
|
||||
label={__('Verify Via Text')}
|
||||
/>
|
||||
<p className="help">
|
||||
{__('Standard messaging rates apply. Having trouble?')}{' '}
|
||||
<Button button="link" href="https://lbry.com/faq/phone" label={__('Read more')} />.
|
||||
</p>
|
||||
</Fragment>
|
||||
}
|
||||
/>
|
||||
|
||||
<div className="section__divider">
|
||||
<hr />
|
||||
<p>{__('OR')}</p>
|
||||
</div>
|
||||
|
||||
<Card
|
||||
icon={ICONS.WALLET}
|
||||
title={__('Verify via credit card')}
|
||||
subtitle={__('Your card information will not be stored or charged, now or in the future.')}
|
||||
actions={
|
||||
<Fragment>
|
||||
{errorMessage && <p className="error__text">{errorMessage}</p>}
|
||||
<CardVerify
|
||||
label={__('Verify Card')}
|
||||
disabled={isPending}
|
||||
token={this.onToken}
|
||||
stripeKey={Lbryio.getStripeToken()}
|
||||
/>
|
||||
<p className="help">
|
||||
{__('A $1 authorization may temporarily appear with your provider.')}{' '}
|
||||
<Button button="link" href="https://lbry.com/faq/identity-requirements" label={__('Read more')} />.
|
||||
</p>
|
||||
</Fragment>
|
||||
}
|
||||
/>
|
||||
|
||||
<div className="section__divider">
|
||||
<hr />
|
||||
<p>{__('OR')}</p>
|
||||
</div>
|
||||
|
||||
<Card
|
||||
icon={ICONS.CHAT}
|
||||
title={__('Verify via chat')}
|
||||
subtitle={
|
||||
<>
|
||||
<p>
|
||||
{__(
|
||||
'A moderator can approve you within our discord server. Please review the instructions within #rewards-approval carefully.'
|
||||
)}
|
||||
</p>
|
||||
<p>{__('You will be asked to provide proof of identity.')}</p>
|
||||
</>
|
||||
}
|
||||
actions={<Button href="https://chat.lbry.com" button="primary" label={__('Join LBRY Chat')} />}
|
||||
/>
|
||||
|
||||
<div className="section__divider">
|
||||
<hr />
|
||||
<p>{__('OR')}</p>
|
||||
</div>
|
||||
|
||||
<Card
|
||||
icon={ICONS.REMOVE}
|
||||
title={__('Skip')}
|
||||
subtitle={__("Verifying is optional. If you skip this, it just means you can't earn LBRY Credits.")}
|
||||
actions={
|
||||
<Fragment>
|
||||
<Button {...skipButtonProps} button="primary" label={__('Continue Without Verifying')} />
|
||||
</Fragment>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default UserVerify;
|
||||
@@ -43,7 +43,6 @@ type Props = {
|
||||
toggleVideoTheaterMode: () => void,
|
||||
toggleAutoplayNext: () => void,
|
||||
setVideoPlaybackRate: (number) => void,
|
||||
authenticated: boolean,
|
||||
userId: number,
|
||||
homepageData?: { [string]: HomepageCat },
|
||||
shareTelemetry: boolean,
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
import { connect } from 'react-redux';
|
||||
// import { makeSelectCoverForUri, makeSelectAvatarForUri } from 'redux/selectors/claims';
|
||||
import Wallpaper from './view';
|
||||
import * as SETTINGS from 'constants/settings';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
|
||||
/*
|
||||
const select = (state, props) => {
|
||||
if (props.uri && (props.uri.indexOf('@') !== -1 || props.uri.indexOf('#') !== -1)) {
|
||||
return {
|
||||
cover: makeSelectCoverForUri(props.uri)(state),
|
||||
avatar: makeSelectAvatarForUri(props.uri)(state),
|
||||
};
|
||||
} else return {};
|
||||
};
|
||||
*/
|
||||
const select = (state) => ({
|
||||
disableBackground: makeSelectClientSetting(SETTINGS.DISABLE_BACKGROUND)(state),
|
||||
});
|
||||
|
||||
export default connect()(Wallpaper);
|
||||
const perform = {};
|
||||
|
||||
export default connect(select, perform)(Wallpaper);
|
||||
@@ -8,10 +8,11 @@ type Props = {
|
||||
// cover: ?string,
|
||||
// avatar: ?string,
|
||||
reset: ?boolean,
|
||||
disableBackground: ?boolean,
|
||||
};
|
||||
|
||||
const Wallpaper = (props: Props) => {
|
||||
// const { cover, avatar } = props;
|
||||
const { disableBackground } = props;
|
||||
|
||||
/*
|
||||
if (avatar) {
|
||||
@@ -227,12 +228,13 @@ const Wallpaper = (props: Props) => {
|
||||
}}
|
||||
/>
|
||||
*/
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
className={'background-image'}
|
||||
style={{
|
||||
backgroundImage: `url(${freeezepeach})`,
|
||||
backgroundImage: disableBackground ? `none` : `url(${freeezepeach})`,
|
||||
}}
|
||||
/>
|
||||
<div className={'theme'} />
|
||||
|
||||
@@ -3,14 +3,12 @@ import { doSetDaemonSetting } from 'redux/actions/settings';
|
||||
import { doSetWelcomeVersion } from 'redux/actions/app';
|
||||
import * as DAEMON_SETTINGS from 'constants/daemon_settings';
|
||||
import { WELCOME_VERSION } from 'config.js';
|
||||
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
||||
import { selectDaemonSettings, selectDaemonStatus } from 'redux/selectors/settings';
|
||||
|
||||
import WelcomeSplash from './view';
|
||||
import { selectDiskSpace } from 'redux/selectors/app';
|
||||
|
||||
const select = (state) => ({
|
||||
authenticated: selectUserVerifiedEmail(state),
|
||||
diskSpace: selectDiskSpace(state),
|
||||
daemonSettings: selectDaemonSettings(state),
|
||||
daemonStatus: selectDaemonStatus(state),
|
||||
|
||||
@@ -9,7 +9,6 @@ import YrblHappy from 'static/img/yrblhappy.svg';
|
||||
type Props = {
|
||||
setWelcomeVersion: (number) => void,
|
||||
setShareDataInternal: (boolean) => void,
|
||||
authenticated: boolean,
|
||||
handleNextPage: () => void,
|
||||
diskSpace?: DiskSpace,
|
||||
};
|
||||
|
||||
@@ -45,6 +45,8 @@ export const DOWNLOAD_UPGRADE = 'DOWNLOAD_UPGRADE';
|
||||
export const UPGRADE_DOWNLOAD_STARTED = 'UPGRADE_DOWNLOAD_STARTED';
|
||||
export const UPGRADE_DOWNLOAD_COMPLETED = 'UPGRADE_DOWNLOAD_COMPLETED';
|
||||
export const UPGRADE_DOWNLOAD_PROGRESSED = 'UPGRADE_DOWNLOAD_PROGRESSED';
|
||||
export const UPGRADE_INIT_INSTALL = 'UPGRADE_INIT_INSTALL';
|
||||
export const UPGRADE_INSTALL_ERROR = 'UPGRADE_INSTALL_ERROR';
|
||||
export const CHECK_UPGRADE_AVAILABLE = 'CHECK_UPGRADE_AVAILABLE';
|
||||
export const CHECK_UPGRADE_START = 'CHECK_UPGRADE_START';
|
||||
export const CHECK_UPGRADE_SUCCESS = 'CHECK_UPGRADE_SUCCESS';
|
||||
@@ -55,7 +57,10 @@ export const UPDATE_REMOTE_VERSION = 'UPDATE_REMOTE_VERSION';
|
||||
export const SKIP_UPGRADE = 'SKIP_UPGRADE';
|
||||
export const START_UPGRADE = 'START_UPGRADE';
|
||||
export const AUTO_UPDATE_DECLINED = 'AUTO_UPDATE_DECLINED';
|
||||
export const AUTO_UPDATE_RESET = 'AUTO_UPDATE_RESET';
|
||||
export const AUTO_UPDATE_FAILED = 'AUTO_UPDATE_FAILED';
|
||||
export const AUTO_UPDATE_DOWNLOADED = 'AUTO_UPDATE_DOWNLOADED';
|
||||
export const AUTO_UPDATE_DOWNLOADING = 'AUTO_UPDATE_DOWNLOADING';
|
||||
export const CLEAR_UPGRADE_TIMER = 'CLEAR_UPGRADE_TIMER';
|
||||
|
||||
// Wallet
|
||||
|
||||
@@ -33,12 +33,9 @@ export const WALLET_UNLOCK = 'wallet_unlock';
|
||||
export const WALLET_SYNC = 'wallet_sync';
|
||||
export const WALLET_PASSWORD_UNSAVE = 'wallet_password_unsave';
|
||||
export const CREATE_CHANNEL = 'create_channel';
|
||||
export const YOUTUBE_WELCOME = 'youtube_welcome';
|
||||
export const SET_REFERRER = 'set_referrer';
|
||||
export const SIGN_OUT = 'sign_out';
|
||||
export const LIQUIDATE_SUPPORTS = 'liquidate_supports';
|
||||
export const MASS_TIP_UNLOCK = 'mass_tip_unlock';
|
||||
export const CONFIRM_AGE = 'confirm_age';
|
||||
export const SYNC_ENABLE = 'SYNC_ENABLE';
|
||||
export const IMAGE_UPLOAD = 'image_upload';
|
||||
export const MOBILE_SEARCH = 'mobile_search';
|
||||
|
||||
@@ -14,6 +14,7 @@ export const THEME = 'theme';
|
||||
export const THEMES = 'themes';
|
||||
export const AUTOMATIC_DARK_MODE_ENABLED = 'automatic_dark_mode_enabled';
|
||||
export const CLOCK_24H = 'clock_24h';
|
||||
export const DISABLE_BACKGROUND = 'disableBackground';
|
||||
export const AUTOPLAY_MEDIA = 'autoplay';
|
||||
export const AUTOPLAY_NEXT = 'autoplay_next';
|
||||
export const OS_NOTIFICATIONS_ENABLED = 'os_notifications_enabled';
|
||||
|
||||
@@ -21,6 +21,10 @@ import {
|
||||
doToggle3PAnalytics,
|
||||
doUpdateDownloadProgress,
|
||||
doNotifyUpdateAvailable,
|
||||
doShowUpgradeInstallationError,
|
||||
doAutoUpdateDownloading,
|
||||
doAutoUpdateReset,
|
||||
doAutoUpdateFail,
|
||||
} from 'redux/actions/app';
|
||||
import { isURIValid } from 'util/lbryURI';
|
||||
import { setSearchApi } from 'redux/actions/search';
|
||||
@@ -128,10 +132,30 @@ ipcRenderer.on('open-uri-requested', (event, url, newSession) => {
|
||||
handleError();
|
||||
});
|
||||
|
||||
autoUpdater.on('download-progress', () => {
|
||||
app.store.dispatch(doAutoUpdateDownloading());
|
||||
});
|
||||
|
||||
autoUpdater.on('checking-for-update', () => {
|
||||
app.store.dispatch(doAutoUpdateReset());
|
||||
});
|
||||
|
||||
autoUpdater.on('update-available', (e) => {
|
||||
app.store.dispatch(doNotifyUpdateAvailable(e));
|
||||
});
|
||||
|
||||
autoUpdater.on('update-downloaded', () => {
|
||||
app.store.dispatch(doAutoUpdateReset());
|
||||
});
|
||||
|
||||
autoUpdater.on('error', () => {
|
||||
app.store.dispatch(doAutoUpdateFail());
|
||||
});
|
||||
|
||||
ipcRenderer.on('upgrade-installing-error', () => {
|
||||
app.store.dispatch(doShowUpgradeInstallationError());
|
||||
});
|
||||
|
||||
ipcRenderer.on('download-progress-update', (e, p) => {
|
||||
app.store.dispatch(doUpdateDownloadProgress(Math.round(p.percent * 100)));
|
||||
});
|
||||
@@ -208,6 +232,8 @@ function AppWrapper() {
|
||||
const enabled = makeSelectClientSetting(SETTINGS.ENABLE_PRERELEASE_UPDATES)(state);
|
||||
if (enabled) {
|
||||
autoUpdater.allowPrerelease = true;
|
||||
} else {
|
||||
autoUpdater.allowPrerelease = false;
|
||||
}
|
||||
}
|
||||
}, [persistDone]);
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doAutoUpdateDeclined, doHideModal } from 'redux/actions/app';
|
||||
import { selectAutoUpdateFailed, selectAutoUpdateDownloading, selectIsUpgradeAvailable } from 'redux/selectors/app';
|
||||
import ModalAutoUpdateDownloaded from './view';
|
||||
|
||||
const perform = dispatch => ({
|
||||
const select = (state, props) => ({
|
||||
errorWhileUpdating: selectAutoUpdateFailed(state),
|
||||
isDownloading: selectAutoUpdateDownloading(state),
|
||||
isUpdateAvailable: selectIsUpgradeAvailable(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
closeModal: () => dispatch(doHideModal()),
|
||||
declineAutoUpdate: () => dispatch(doAutoUpdateDeclined()),
|
||||
});
|
||||
|
||||
export default connect(
|
||||
null,
|
||||
perform
|
||||
)(ModalAutoUpdateDownloaded);
|
||||
export default connect(select, perform)(ModalAutoUpdateDownloaded);
|
||||
@@ -1,5 +1,5 @@
|
||||
// @flow
|
||||
import React, { useState } from 'react';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
// @if TARGET='app'
|
||||
import { ipcRenderer } from 'electron';
|
||||
// @endif
|
||||
@@ -7,16 +7,19 @@ import { Modal } from 'modal/modal';
|
||||
import LastReleaseChanges from 'component/lastReleaseChanges';
|
||||
|
||||
type Props = {
|
||||
closeModal: any => any,
|
||||
closeModal: (any) => any,
|
||||
declineAutoUpdate: () => any,
|
||||
errorWhileUpdating: boolean,
|
||||
isDownloading: boolean,
|
||||
isUpdateAvailable: boolean,
|
||||
};
|
||||
|
||||
const ModalAutoUpdateDownloaded = (props: Props) => {
|
||||
const { closeModal, declineAutoUpdate } = props;
|
||||
const [disabled, setDisabled] = useState(false);
|
||||
const { closeModal, declineAutoUpdate, errorWhileUpdating, isDownloading, isUpdateAvailable } = props;
|
||||
const [waitingForAutoUpdateResponse, setWaitingForAutoUpdateResponse] = useState(false);
|
||||
|
||||
const handleConfirm = () => {
|
||||
setDisabled(true);
|
||||
setWaitingForAutoUpdateResponse(true);
|
||||
ipcRenderer.send('autoUpdateAccepted');
|
||||
};
|
||||
|
||||
@@ -25,19 +28,24 @@ const ModalAutoUpdateDownloaded = (props: Props) => {
|
||||
closeModal();
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
setWaitingForAutoUpdateResponse(false);
|
||||
}, [errorWhileUpdating, isDownloading, isUpdateAvailable]);
|
||||
|
||||
return (
|
||||
<Modal
|
||||
isOpen
|
||||
type="confirm"
|
||||
contentLabel={__('Upgrade Downloaded')}
|
||||
title={__('LBRY leveled up')}
|
||||
confirmButtonLabel={__('Upgrade Now')}
|
||||
abortButtonLabel={__('Not Now')}
|
||||
confirmButtonDisabled={disabled}
|
||||
confirmButtonLabel={isDownloading ? __('Downloading...') : __('Upgrade Now')}
|
||||
abortButtonLabel={isDownloading ? __('Keep browsing') : __('Not Now')}
|
||||
confirmButtonDisabled={!isUpdateAvailable || isDownloading || waitingForAutoUpdateResponse}
|
||||
onConfirmed={handleConfirm}
|
||||
onAborted={handleAbort}
|
||||
>
|
||||
<LastReleaseChanges />
|
||||
{errorWhileUpdating && <p>{__('There was an error while updating. Please try again.')}</p>}
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doHideModal } from 'redux/actions/app';
|
||||
import { doSetClientSetting } from 'redux/actions/settings';
|
||||
import ModalAffirmPurchase from './view';
|
||||
|
||||
export default connect(null, {
|
||||
doHideModal,
|
||||
doSetClientSetting,
|
||||
})(ModalAffirmPurchase);
|
||||
@@ -1,52 +0,0 @@
|
||||
// @flow
|
||||
import * as SETTINGS from 'constants/settings';
|
||||
import React from 'react';
|
||||
import { Modal } from 'modal/modal';
|
||||
import Card from 'component/common/card';
|
||||
import Button from 'component/button';
|
||||
import { FormField } from 'component/common/form';
|
||||
|
||||
type Props = {
|
||||
doHideModal: () => void,
|
||||
doSetClientSetting: (string, any) => void,
|
||||
};
|
||||
|
||||
function ModalAffirmPurchase(props: Props) {
|
||||
const { doHideModal, doSetClientSetting } = props;
|
||||
const [confirmed, setConfirmed] = React.useState(false);
|
||||
|
||||
function handleConfirmAge() {
|
||||
doSetClientSetting(SETTINGS.SHOW_MATURE, true);
|
||||
doHideModal();
|
||||
}
|
||||
|
||||
const title = __('Confirm Your Age');
|
||||
|
||||
return (
|
||||
<Modal type="card" isOpen contentLabel={title} onAborted={doHideModal}>
|
||||
<Card
|
||||
title={title}
|
||||
actions={
|
||||
<>
|
||||
<div className="section">
|
||||
<FormField
|
||||
name="age-confirmation"
|
||||
type="checkbox"
|
||||
label={__('I confirm I am over 18 years old.')}
|
||||
helper={__('This is only for regulatory compliance and the data will not be stored.')}
|
||||
checked={confirmed}
|
||||
onChange={() => setConfirmed(!confirmed)}
|
||||
/>
|
||||
</div>
|
||||
<div className="section__actions">
|
||||
<Button button="primary" label={'Confirm'} onClick={handleConfirmAge} disabled={!confirmed} />
|
||||
<Button button="link" label={__('Cancel')} onClick={doHideModal} />
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
export default ModalAffirmPurchase;
|
||||
@@ -1,15 +1,23 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doStartUpgrade, doCancelUpgrade, doHideModal } from 'redux/actions/app';
|
||||
import { selectDownloadProgress, selectDownloadComplete, selectUpgradeDownloadPath } from 'redux/selectors/app';
|
||||
import {
|
||||
selectDownloadProgress,
|
||||
selectDownloadComplete,
|
||||
selectUpgradeDownloadPath,
|
||||
selectUpgradeInitialized,
|
||||
selectUpgradeFailedInstallation,
|
||||
} from 'redux/selectors/app';
|
||||
import ModalDownloading from './view';
|
||||
|
||||
const select = state => ({
|
||||
const select = (state) => ({
|
||||
downloadProgress: selectDownloadProgress(state),
|
||||
downloadComplete: selectDownloadComplete(state),
|
||||
downloadItem: selectUpgradeDownloadPath(state),
|
||||
upgradeInitialized: selectUpgradeInitialized(state),
|
||||
failedInstallation: selectUpgradeFailedInstallation(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
const perform = (dispatch) => ({
|
||||
startUpgrade: () => dispatch(doStartUpgrade()),
|
||||
cancelUpgrade: () => {
|
||||
dispatch(doHideModal());
|
||||
@@ -17,7 +25,4 @@ const perform = dispatch => ({
|
||||
},
|
||||
});
|
||||
|
||||
export default connect(
|
||||
select,
|
||||
perform
|
||||
)(ModalDownloading);
|
||||
export default connect(select, perform)(ModalDownloading);
|
||||
@@ -10,11 +10,21 @@ type Props = {
|
||||
downloadItem: string,
|
||||
startUpgrade: () => void,
|
||||
cancelUpgrade: () => void,
|
||||
upgradeInitialized: boolean,
|
||||
failedInstallation: boolean,
|
||||
};
|
||||
|
||||
class ModalDownloading extends React.PureComponent<Props> {
|
||||
render() {
|
||||
const { downloadProgress, downloadComplete, downloadItem, startUpgrade, cancelUpgrade } = this.props;
|
||||
const {
|
||||
downloadProgress,
|
||||
downloadComplete,
|
||||
downloadItem,
|
||||
startUpgrade,
|
||||
cancelUpgrade,
|
||||
upgradeInitialized,
|
||||
failedInstallation,
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
<Modal title={__('Downloading update')} isOpen contentLabel={__('Downloading update')} type="custom">
|
||||
@@ -40,9 +50,18 @@ class ModalDownloading extends React.PureComponent<Props> {
|
||||
</React.Fragment>
|
||||
) : null}
|
||||
|
||||
{failedInstallation && <p>{__('There was an error during installation. Please, try again.')}</p>}
|
||||
|
||||
<div className="card__actions">
|
||||
{downloadComplete ? <Button button="primary" label={__('Begin Upgrade')} onClick={startUpgrade} /> : null}
|
||||
<Button button="link" label={__('Cancel')} onClick={cancelUpgrade} />
|
||||
{downloadComplete ? (
|
||||
<Button
|
||||
disabled={upgradeInitialized}
|
||||
button="primary"
|
||||
label={__(upgradeInitialized ? 'Installing, please wait...' : 'Begin Upgrade')}
|
||||
onClick={startUpgrade}
|
||||
/>
|
||||
) : null}
|
||||
<Button disabled={upgradeInitialized} button="link" label={__('Cancel')} onClick={cancelUpgrade} />
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
|
||||
@@ -8,7 +8,7 @@ type Props = {
|
||||
currentValue: string,
|
||||
title: string,
|
||||
helpText: string,
|
||||
onUpdate: (string, boolean) => void,
|
||||
onUpdate: (string, boolean, ?string) => void,
|
||||
assetName: string,
|
||||
};
|
||||
|
||||
@@ -18,11 +18,12 @@ function ModalImageUpload(props: Props) {
|
||||
return (
|
||||
<Modal isOpen type="card" onAborted={closeModal} contentLabel={title}>
|
||||
<SelectAsset
|
||||
onUpdate={(a, b) => onUpdate(a, b)}
|
||||
onUpdate={onUpdate}
|
||||
currentValue={currentValue}
|
||||
assetName={assetName}
|
||||
recommended={helpText}
|
||||
onDone={closeModal}
|
||||
buildImagePreview
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doHideModal } from 'redux/actions/app';
|
||||
import { selectPhoneToVerify, selectUser } from 'redux/selectors/user';
|
||||
import ModalPhoneCollection from './view';
|
||||
|
||||
const select = state => ({
|
||||
phone: selectPhoneToVerify(state),
|
||||
user: selectUser(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => () => ({
|
||||
closeModal: () => dispatch(doHideModal()),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(ModalPhoneCollection);
|
||||
@@ -1,50 +0,0 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import { Modal } from 'modal/modal';
|
||||
import Button from 'component/button';
|
||||
import UserPhoneVerify from 'component/userPhoneVerify';
|
||||
import UserPhoneNew from 'component/userPhoneNew';
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
type Props = {
|
||||
phone: ?number,
|
||||
user: {
|
||||
is_identity_verified: boolean,
|
||||
},
|
||||
closeModal: () => void,
|
||||
history: { push: string => void },
|
||||
};
|
||||
|
||||
class ModalPhoneCollection extends React.PureComponent<Props> {
|
||||
renderInner() {
|
||||
const { closeModal, phone, user } = this.props;
|
||||
|
||||
const cancelButton = <Button button="link" onClick={closeModal} label={__('Not Now')} />;
|
||||
|
||||
if (!user.is_identity_verified && !phone) {
|
||||
return <UserPhoneNew cancelButton={cancelButton} />;
|
||||
} else if (!user.is_identity_verified) {
|
||||
return <UserPhoneVerify cancelButton={cancelButton} />;
|
||||
}
|
||||
|
||||
closeModal();
|
||||
return <Redirect to="/$/rewards" />;
|
||||
}
|
||||
|
||||
render() {
|
||||
const { user, closeModal } = this.props;
|
||||
|
||||
// this shouldn't happen
|
||||
if (!user) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Modal type="card" isOpen contentLabel="Phone" onAborted={closeModal}>
|
||||
{this.renderInner()}
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default ModalPhoneCollection;
|
||||
@@ -15,7 +15,6 @@ import ModalClaimCollectionAdd from 'modal/modalClaimCollectionAdd';
|
||||
|
||||
import ModalCommentAcknowledgement from 'modal/modalCommentAcknowledgement';
|
||||
|
||||
import ModalConfirmAge from 'modal/modalConfirmAge';
|
||||
import ModalConfirmThumbnailUpload from 'modal/modalConfirmThumbnailUpload';
|
||||
|
||||
import ModalConfirmTransaction from 'modal/modalConfirmTransaction';
|
||||
@@ -39,8 +38,6 @@ import ModalOpenExternalResource from 'modal/modalOpenExternalResource';
|
||||
|
||||
import ModalPasswordUnsave from 'modal/modalPasswordUnsave';
|
||||
|
||||
import ModalPhoneCollection from 'modal/modalPhoneCollection';
|
||||
|
||||
import ModalPublish from 'modal/modalPublish';
|
||||
import ModalPublishPreview from 'modal/modalPublishPreview';
|
||||
|
||||
@@ -54,7 +51,6 @@ import ModalRevokeClaim from 'modal/modalRevokeClaim';
|
||||
import ModalRewardCode from 'modal/modalRewardCode';
|
||||
import ModalSendTip from 'modal/modalSendTip';
|
||||
import ModalRepost from 'modal/modalRepost';
|
||||
import ModalSetReferrer from 'modal/modalSetReferrer';
|
||||
import ModalSignOut from 'modal/modalSignOut';
|
||||
import ModalSocialShare from 'modal/modalSocialShare';
|
||||
import ModalSupportsLiquidate from 'modal/modalSupportsLiquidate';
|
||||
@@ -70,8 +66,6 @@ import ModalWalletEncrypt from 'modal/modalWalletEncrypt';
|
||||
|
||||
import ModalWalletUnlock from 'modal/modalWalletUnlock';
|
||||
|
||||
import ModalYoutubeWelcome from 'modal/modalYoutubeWelcome';
|
||||
|
||||
function getModal(id) {
|
||||
switch (id) {
|
||||
case MODALS.UPGRADE:
|
||||
@@ -96,8 +90,7 @@ function getModal(id) {
|
||||
return ModalAffirmPurchase;
|
||||
case MODALS.CONFIRM_CLAIM_REVOKE:
|
||||
return ModalRevokeClaim;
|
||||
case MODALS.PHONE_COLLECTION:
|
||||
return ModalPhoneCollection;
|
||||
|
||||
case MODALS.FIRST_SUBSCRIPTION:
|
||||
return ModalFirstSubscription;
|
||||
case MODALS.SEND_TIP:
|
||||
@@ -128,14 +121,8 @@ function getModal(id) {
|
||||
return ModalRewardCode;
|
||||
case MODALS.COMMENT_ACKNOWEDGEMENT:
|
||||
return ModalCommentAcknowledgement;
|
||||
case MODALS.YOUTUBE_WELCOME:
|
||||
return ModalYoutubeWelcome;
|
||||
case MODALS.SET_REFERRER:
|
||||
return ModalSetReferrer;
|
||||
case MODALS.SIGN_OUT:
|
||||
return ModalSignOut;
|
||||
case MODALS.CONFIRM_AGE:
|
||||
return ModalConfirmAge;
|
||||
case MODALS.FILE_SELECTION:
|
||||
return ModalFileSelection;
|
||||
case MODALS.LIQUIDATE_SUPPORTS:
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doHideModal } from 'redux/actions/app';
|
||||
import { selectSetReferrerError, selectSetReferrerPending } from 'redux/selectors/user';
|
||||
import { doUserSetReferrer, doUserSetReferrerReset } from 'redux/actions/user';
|
||||
import ModalSetReferrer from './view';
|
||||
|
||||
const select = state => ({
|
||||
referrerSetPending: selectSetReferrerPending(state),
|
||||
referrerSetError: selectSetReferrerError(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
closeModal: () => dispatch(doHideModal()),
|
||||
setReferrer: (referrer, doClaim) => dispatch(doUserSetReferrer(referrer, doClaim)),
|
||||
resetReferrerError: () => dispatch(doUserSetReferrerReset()),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(ModalSetReferrer);
|
||||
@@ -1,101 +0,0 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import { FormField, Form } from 'component/common/form';
|
||||
import { Modal } from 'modal/modal';
|
||||
import Button from 'component/button';
|
||||
import HelpLink from 'component/common/help-link';
|
||||
import Card from 'component/common/card';
|
||||
|
||||
type Props = {
|
||||
closeModal: () => void,
|
||||
error: ?string,
|
||||
rewardIsPending: boolean,
|
||||
setReferrer: (string, boolean) => void,
|
||||
referrerSetPending: boolean,
|
||||
referrerSetError?: string,
|
||||
resetReferrerError: () => void,
|
||||
};
|
||||
|
||||
type State = {
|
||||
referrer: string,
|
||||
};
|
||||
|
||||
class ModalSetReferrer extends React.PureComponent<Props, State> {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.state = {
|
||||
referrer: '',
|
||||
};
|
||||
|
||||
(this: any).handleSubmit = this.handleSubmit.bind(this);
|
||||
(this: any).handleClose = this.handleClose.bind(this);
|
||||
(this: any).handleTextChange = this.handleTextChange.bind(this);
|
||||
}
|
||||
|
||||
handleSubmit() {
|
||||
const { referrer } = this.state;
|
||||
const { setReferrer } = this.props;
|
||||
setReferrer(referrer, true);
|
||||
}
|
||||
|
||||
handleClose() {
|
||||
const { referrerSetError, resetReferrerError, closeModal } = this.props;
|
||||
if (referrerSetError) {
|
||||
resetReferrerError();
|
||||
}
|
||||
closeModal();
|
||||
}
|
||||
|
||||
handleTextChange(e: SyntheticInputEvent<*>) {
|
||||
const { referrerSetError, resetReferrerError } = this.props;
|
||||
|
||||
this.setState({ referrer: e.target.value });
|
||||
if (referrerSetError) {
|
||||
resetReferrerError();
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { closeModal, rewardIsPending, referrerSetError, referrerSetPending } = this.props;
|
||||
const { referrer } = this.state;
|
||||
|
||||
return (
|
||||
<Modal isOpen contentLabel={__('Enter inviter')} type="card" onAborted={closeModal}>
|
||||
<Card
|
||||
title={__('Enter inviter')}
|
||||
subtitle={
|
||||
<React.Fragment>
|
||||
{__('Did someone invite you to use LBRY? Tell us who and you both get a reward!')}
|
||||
<HelpLink href="https://lbry.com/faq/referrals" />
|
||||
</React.Fragment>
|
||||
}
|
||||
actions={
|
||||
<React.Fragment>
|
||||
<Form onSubmit={this.handleSubmit}>
|
||||
<FormField
|
||||
autoFocus
|
||||
type="text"
|
||||
name="referrer-code"
|
||||
inputButton={
|
||||
<Button button="primary" type="submit" disabled={!referrer || rewardIsPending} label={__('Set')} />
|
||||
}
|
||||
label={__('Code or channel')}
|
||||
placeholder="0123abc"
|
||||
value={referrer}
|
||||
onChange={this.handleTextChange}
|
||||
error={!referrerSetPending && referrerSetError}
|
||||
/>
|
||||
</Form>
|
||||
<div className="card__actions">
|
||||
<Button button="primary" label={__('Done')} onClick={this.handleClose} />
|
||||
</div>
|
||||
</React.Fragment>
|
||||
}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default ModalSetReferrer;
|
||||
@@ -1,14 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doHideModal } from 'redux/actions/app';
|
||||
import WalletSend from './view';
|
||||
|
||||
const select = state => ({});
|
||||
|
||||
const perform = {
|
||||
doHideModal,
|
||||
};
|
||||
|
||||
export default connect(
|
||||
select,
|
||||
perform
|
||||
)(WalletSend);
|
||||
@@ -1,47 +0,0 @@
|
||||
// @flow
|
||||
import * as PAGES from 'constants/pages';
|
||||
import React from 'react';
|
||||
import { Modal } from 'modal/modal';
|
||||
import Card from 'component/common/card';
|
||||
import Confetti from 'react-confetti';
|
||||
import Button from 'component/button';
|
||||
|
||||
type Props = { doHideModal: () => void };
|
||||
|
||||
const YoutubeWelcome = (props: Props) => {
|
||||
const { doHideModal } = props;
|
||||
|
||||
return (
|
||||
<Modal isOpen type="card" onAborted={doHideModal}>
|
||||
<Confetti recycle={false} style={{ position: 'fixed' }} numberOfPieces={100} />
|
||||
<Card
|
||||
title={__("You're free!")}
|
||||
subtitle={
|
||||
<React.Fragment>
|
||||
<p>
|
||||
{__("You've escaped the land of spying, censorship, and exploitation.")}
|
||||
<span className="emoji"> 💩</span>
|
||||
</p>
|
||||
<p>
|
||||
{__('Welcome to the land of content freedom.')}
|
||||
<span className="emoji"> 🌈</span>
|
||||
</p>
|
||||
</React.Fragment>
|
||||
}
|
||||
actions={
|
||||
<div className="card__actions">
|
||||
<Button
|
||||
button="primary"
|
||||
label={__('Create an Account')}
|
||||
navigate={`/$/${PAGES.AUTH}`}
|
||||
onClick={doHideModal}
|
||||
/>
|
||||
<Button button="link" label={__('Not Yet')} onClick={doHideModal} />
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
export default YoutubeWelcome;
|
||||
@@ -3,7 +3,6 @@ import { connect } from 'react-redux';
|
||||
import { doResolveUri } from 'redux/actions/claims';
|
||||
import { selectClaimForUri } from 'redux/selectors/claims';
|
||||
import * as SETTINGS from 'constants/settings';
|
||||
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
||||
import { selectFollowedTags } from 'redux/selectors/tags';
|
||||
import { doToggleTagFollowDesktop } from 'redux/actions/tags';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
@@ -18,7 +17,6 @@ const select = (state, props) => {
|
||||
followedTags: selectFollowedTags(state),
|
||||
repostedUri: repostedUri,
|
||||
repostedClaim: repostedUri ? selectClaimForUri(state, repostedUri) : null,
|
||||
isAuthenticated: selectUserVerifiedEmail(state),
|
||||
tileLayout: makeSelectClientSetting(SETTINGS.TILE_LAYOUT)(state),
|
||||
};
|
||||
};
|
||||
|
||||
@@ -24,7 +24,6 @@ type Props = {
|
||||
repostedClaim: ?GenericClaim,
|
||||
doToggleTagFollowDesktop: (string) => void,
|
||||
doResolveUri: (string) => void,
|
||||
isAuthenticated: boolean,
|
||||
dynamicRouteProps: RowDataItem,
|
||||
tileLayout: boolean,
|
||||
};
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import FourOhFourPage from './view';
|
||||
|
||||
const select = state => ({});
|
||||
|
||||
export default connect(
|
||||
select,
|
||||
null
|
||||
)(FourOhFourPage);
|
||||
@@ -1,16 +0,0 @@
|
||||
import React from 'react';
|
||||
import Page from 'component/page';
|
||||
import Yrbl from 'component/yrbl';
|
||||
|
||||
const FourOhFourPage = () => (
|
||||
<Page notcontained>
|
||||
<div className="main main--empty">
|
||||
<Yrbl type="sad" title={__('404')} subtitle={<p>{__('Page Not Found')}</p>} />
|
||||
<p>{__('Four-Oh-Four-Oh-Four-Oh-Four! Four-Oh-Four!')}</p>
|
||||
<p>{__('Four-Oh-Four, Oh, Four...')}</p>
|
||||
<p>{__('Four-Oh-Four-Oh-Four-Oh-Four, Oh-Four, Oh-Four...')}</p>
|
||||
</div>
|
||||
</Page>
|
||||
);
|
||||
|
||||
export default FourOhFourPage;
|
||||
+94
-86
@@ -183,7 +183,6 @@ class HelpPage extends React.PureComponent<Props, State> {
|
||||
}
|
||||
/>
|
||||
|
||||
{/* @if TARGET='app' */}
|
||||
<Card
|
||||
title={__('View your log')}
|
||||
subtitle={
|
||||
@@ -214,92 +213,101 @@ class HelpPage extends React.PureComponent<Props, State> {
|
||||
/>
|
||||
|
||||
<WalletBackup />
|
||||
{/* @endif */}
|
||||
<>
|
||||
<Card
|
||||
title={__('About --[About section in Help Page]--')}
|
||||
subtitle={
|
||||
this.state.upgradeAvailable !== null && this.state.upgradeAvailable ? (
|
||||
<span>
|
||||
{__('A newer version of LBRY is available.')}{' '}
|
||||
<Button button="link" href={newVerLink} label={__('Download now!')} />
|
||||
</span>
|
||||
) : null
|
||||
}
|
||||
isBodyList
|
||||
body={
|
||||
<div className="table__wrapper">
|
||||
<table className="table table--stretch">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{__('App')}</td>
|
||||
<td>
|
||||
{this.state.uiVersion ? this.state.uiVersion + ' - ' : ''}
|
||||
<Button
|
||||
button="link"
|
||||
label={__('Changelog')}
|
||||
href="https://github.com/lbryio/lbry-desktop/blob/master/CHANGELOG.md"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{__('Daemon (lbrynet)')}</td>
|
||||
<td>{ver ? ver.lbrynet_version : __('Loading...')}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{__('Connected Email')}</td>
|
||||
<td>
|
||||
{user && user.primary_email ? (
|
||||
<React.Fragment>
|
||||
{user.primary_email}{' '}
|
||||
<Button
|
||||
button="link"
|
||||
navigate={`/$/${PAGES.SETTINGS_NOTIFICATIONS}`}
|
||||
label={__('Update mailing preferences')}
|
||||
/>
|
||||
</React.Fragment>
|
||||
) : (
|
||||
<React.Fragment>
|
||||
<span className="empty">{__('none')} </span>
|
||||
<Button button="link" onClick={() => doAuth()} label={__('set email')} />
|
||||
</React.Fragment>
|
||||
)}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{__('Reward Eligible')}</td>
|
||||
<td>{user && user.is_reward_approved ? __('Yes') : __('No')}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{__('Platform')}</td>
|
||||
<td>{platform}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{__('Installation ID')}</td>
|
||||
<td>{this.state.lbryId}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{__('Access Token')}</td>
|
||||
<td>
|
||||
{this.state.accessTokenHidden && (
|
||||
<Button button="link" label={__('View')} onClick={this.showAccessToken} />
|
||||
)}
|
||||
{!this.state.accessTokenHidden && accessToken && (
|
||||
<div>
|
||||
<p>{accessToken}</p>
|
||||
<div className="help--warning">
|
||||
{__('This is equivalent to a password. Do not post or share this.')}
|
||||
</div>
|
||||
<Card
|
||||
title={__('Odysee Connect --[Section in Help Page]--')}
|
||||
isBodyList
|
||||
body={
|
||||
<div className="table__wrapper">
|
||||
<table className="table table--stretch">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{__('Connected Email')}</td>
|
||||
<td>
|
||||
{user && user.primary_email ? (
|
||||
<React.Fragment>
|
||||
{user.primary_email}{' '}
|
||||
<Button
|
||||
button="link"
|
||||
navigate={`/$/${PAGES.SETTINGS_NOTIFICATIONS}`}
|
||||
label={__('Update mailing preferences')}
|
||||
/>
|
||||
</React.Fragment>
|
||||
) : (
|
||||
<React.Fragment>
|
||||
<span className="empty">{__('none')} </span>
|
||||
<Button button="link" onClick={() => doAuth()} label={__('set email')} />
|
||||
</React.Fragment>
|
||||
)}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{__('Reward Eligible')}</td>
|
||||
<td>{user && user.is_reward_approved ? __('Yes') : __('No')}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{__('Access Token')}</td>
|
||||
<td>
|
||||
{this.state.accessTokenHidden && (
|
||||
<Button button="link" label={__('View')} onClick={this.showAccessToken} />
|
||||
)}
|
||||
{!this.state.accessTokenHidden && accessToken && (
|
||||
<div>
|
||||
<p>{accessToken}</p>
|
||||
<div className="help--warning">
|
||||
{__('This is equivalent to a password. Do not post or share this.')}
|
||||
</div>
|
||||
)}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</div>
|
||||
)}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
<Card
|
||||
title={__('About --[About section in Help Page]--')}
|
||||
subtitle={
|
||||
this.state.upgradeAvailable !== null && this.state.upgradeAvailable ? (
|
||||
<span>
|
||||
{__('A newer version of LBRY is available.')}{' '}
|
||||
<Button button="link" href={newVerLink} label={__('Download now!')} />
|
||||
</span>
|
||||
) : null
|
||||
}
|
||||
isBodyList
|
||||
body={
|
||||
<div className="table__wrapper">
|
||||
<table className="table table--stretch">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{__('App')}</td>
|
||||
<td>
|
||||
{this.state.uiVersion ? this.state.uiVersion + ' - ' : ''}
|
||||
<Button
|
||||
button="link"
|
||||
label={__('Changelog')}
|
||||
href="https://github.com/lbryio/lbry-desktop/blob/master/CHANGELOG.md"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{__('Daemon (lbrynet)')}</td>
|
||||
<td>{ver ? ver.lbrynet_version : __('Loading...')}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{__('Platform')}</td>
|
||||
<td>{platform}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{__('Installation ID')}</td>
|
||||
<td>{this.state.lbryId}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { selectFollowedTags } from 'redux/selectors/tags';
|
||||
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
||||
import { selectSubscriptions } from 'redux/selectors/subscriptions';
|
||||
import { selectShowMatureContent, selectHomepageData } from 'redux/selectors/settings';
|
||||
|
||||
@@ -9,7 +8,6 @@ import DiscoverPage from './view';
|
||||
const select = (state) => ({
|
||||
followedTags: selectFollowedTags(state),
|
||||
subscribedChannels: selectSubscriptions(state),
|
||||
authenticated: selectUserVerifiedEmail(state),
|
||||
showNsfw: selectShowMatureContent(state),
|
||||
homepageData: selectHomepageData(state),
|
||||
});
|
||||
|
||||
@@ -13,7 +13,6 @@ import { useIsLargeScreen } from 'effects/use-screensize';
|
||||
import { GetLinksData } from 'util/buildHomepage';
|
||||
|
||||
type Props = {
|
||||
authenticated: boolean,
|
||||
followedTags: Array<Tag>,
|
||||
subscribedChannels: Array<Subscription>,
|
||||
showNsfw: boolean,
|
||||
@@ -21,7 +20,7 @@ type Props = {
|
||||
};
|
||||
|
||||
function HomePage(props: Props) {
|
||||
const { followedTags, subscribedChannels, authenticated, showNsfw, homepageData } = props;
|
||||
const { followedTags, subscribedChannels, showNsfw, homepageData } = props;
|
||||
const showPersonalizedChannels = subscribedChannels && subscribedChannels.length > 0;
|
||||
const showPersonalizedTags = followedTags && followedTags.length > 0;
|
||||
const showIndividualTags = showPersonalizedTags && followedTags.length < 5;
|
||||
@@ -31,7 +30,6 @@ function HomePage(props: Props) {
|
||||
homepageData,
|
||||
isLargeScreen,
|
||||
true,
|
||||
authenticated,
|
||||
showPersonalizedChannels,
|
||||
showPersonalizedTags,
|
||||
subscribedChannels,
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
import * as SETTINGS from 'constants/settings';
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
selectUserInviteStatusFailed,
|
||||
selectUserInviteStatusIsPending,
|
||||
selectUserVerifiedEmail,
|
||||
} from 'redux/selectors/user';
|
||||
// import { doFetchInviteStatus } from 'redux/actions/user';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
import { doSetClientSetting } from 'redux/actions/settings';
|
||||
import InvitePage from './view';
|
||||
|
||||
const select = (state) => ({
|
||||
isFailed: selectUserInviteStatusFailed(state),
|
||||
isPending: selectUserInviteStatusIsPending(state),
|
||||
inviteAcknowledged: makeSelectClientSetting(SETTINGS.INVITE_ACKNOWLEDGED)(state),
|
||||
authenticated: selectUserVerifiedEmail(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
// fetchInviteStatus: () => dispatch(doFetchInviteStatus()),
|
||||
acknowledgeInivte: () => dispatch(doSetClientSetting(SETTINGS.INVITE_ACKNOWLEDGED, true)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(InvitePage);
|
||||
@@ -1,55 +0,0 @@
|
||||
// @flow
|
||||
import { SITE_NAME } from 'config';
|
||||
import React from 'react';
|
||||
import BusyIndicator from 'component/common/busy-indicator';
|
||||
import InviteNew from 'component/inviteNew';
|
||||
import InviteList from 'component/inviteList';
|
||||
import Page from 'component/page';
|
||||
import RewardAuthIntro from 'component/rewardAuthIntro';
|
||||
|
||||
type Props = {
|
||||
isPending: boolean,
|
||||
isFailed: boolean,
|
||||
inviteAcknowledged: boolean,
|
||||
authenticated: boolean,
|
||||
acknowledgeInivte: () => void,
|
||||
fetchInviteStatus: () => void,
|
||||
};
|
||||
|
||||
class InvitePage extends React.PureComponent<Props> {
|
||||
componentDidMount() {
|
||||
const { fetchInviteStatus, inviteAcknowledged, acknowledgeInivte } = this.props;
|
||||
fetchInviteStatus();
|
||||
|
||||
if (!inviteAcknowledged) {
|
||||
acknowledgeInivte();
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { isPending, isFailed, authenticated } = this.props;
|
||||
|
||||
return (
|
||||
<Page>
|
||||
{!authenticated ? (
|
||||
<RewardAuthIntro
|
||||
title={__('Log in to %SITE_NAME% to earn rewards From Inviting Your Friends', { SITE_NAME })}
|
||||
/>
|
||||
) : (
|
||||
<React.Fragment>
|
||||
{isPending && <BusyIndicator message={__('Checking your invite status')} />}
|
||||
{!isPending && isFailed && <span className="empty">{__('Failed to retrieve invite status.')}</span>}
|
||||
{!isPending && !isFailed && (
|
||||
<React.Fragment>
|
||||
<InviteNew />
|
||||
<InviteList />
|
||||
</React.Fragment>
|
||||
)}
|
||||
</React.Fragment>
|
||||
)}
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default InvitePage;
|
||||
@@ -1,19 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import InvitedPage from './view';
|
||||
import { makeSelectPermanentUrlForUri } from 'redux/selectors/claims';
|
||||
import { withRouter } from 'react-router';
|
||||
|
||||
const select = (state, props) => {
|
||||
const { match } = props;
|
||||
const { params } = match;
|
||||
const { referrer } = params;
|
||||
const sanitizedReferrer = referrer ? referrer.replace(':', '#') : '';
|
||||
const uri = `lbry://${sanitizedReferrer}`;
|
||||
return {
|
||||
fullUri: makeSelectPermanentUrlForUri(uri)(state),
|
||||
referrer: referrer,
|
||||
};
|
||||
};
|
||||
const perform = () => ({});
|
||||
|
||||
export default withRouter(connect(select, perform)(InvitedPage));
|
||||
@@ -1,18 +0,0 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import Page from 'component/page';
|
||||
import Invited from 'component/invited';
|
||||
|
||||
type Props = {
|
||||
fullUri: string,
|
||||
referrer: string,
|
||||
};
|
||||
export default function ReferredPage(props: Props) {
|
||||
const { fullUri, referrer } = props;
|
||||
|
||||
return (
|
||||
<Page authPage>
|
||||
<Invited fullUri={fullUri} referrer={referrer} />
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { selectUser } from 'redux/selectors/user';
|
||||
import { selectFetchingRewards, selectUnclaimedRewards, selectClaimedRewards } from 'redux/selectors/rewards';
|
||||
import { doUserFetch } from 'redux/actions/user';
|
||||
import { doRewardList } from 'redux/actions/rewards';
|
||||
import { selectDaemonSettings } from 'redux/selectors/settings';
|
||||
import RewardsPage from './view';
|
||||
|
||||
const select = state => ({
|
||||
daemonSettings: selectDaemonSettings(state),
|
||||
fetching: selectFetchingRewards(state),
|
||||
rewards: selectUnclaimedRewards(state),
|
||||
claimed: selectClaimedRewards(state),
|
||||
user: selectUser(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
fetchRewards: () => dispatch(doRewardList()),
|
||||
fetchUser: () => dispatch(doUserFetch()),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(RewardsPage);
|
||||
@@ -1,185 +0,0 @@
|
||||
// @flow
|
||||
import * as PAGES from 'constants/pages';
|
||||
import React, { PureComponent } from 'react';
|
||||
import BusyIndicator from 'component/common/busy-indicator';
|
||||
import RewardListClaimed from 'component/rewardListClaimed';
|
||||
import RewardTile from 'component/rewardTile';
|
||||
import Button from 'component/button';
|
||||
import Page from 'component/page';
|
||||
import classnames from 'classnames';
|
||||
import REWARD_TYPES from 'rewards';
|
||||
import RewardAuthIntro from 'component/rewardAuthIntro';
|
||||
import Card from 'component/common/card';
|
||||
import I18nMessage from 'component/i18nMessage';
|
||||
import { SITE_HELP_EMAIL, SITE_NAME } from 'config';
|
||||
|
||||
type Props = {
|
||||
doAuth: () => void,
|
||||
fetchRewards: () => void,
|
||||
fetchUser: () => void,
|
||||
fetching: boolean,
|
||||
rewards: Array<Reward>,
|
||||
claimed: Array<Reward>,
|
||||
user: ?{
|
||||
is_identity_verified: boolean,
|
||||
is_reward_approved: boolean,
|
||||
primary_email: string,
|
||||
has_verified_email: boolean,
|
||||
},
|
||||
daemonSettings: {
|
||||
share_usage_data: boolean,
|
||||
},
|
||||
};
|
||||
|
||||
class RewardsPage extends PureComponent<Props> {
|
||||
componentDidMount() {
|
||||
const { user, fetchUser, fetchRewards } = this.props;
|
||||
const rewardsApproved = user && user.is_reward_approved;
|
||||
|
||||
fetchRewards();
|
||||
if (!rewardsApproved) {
|
||||
fetchUser();
|
||||
}
|
||||
}
|
||||
|
||||
renderPageHeader() {
|
||||
const { user, daemonSettings, fetchUser } = this.props;
|
||||
const rewardsEnabled = daemonSettings && daemonSettings.share_usage_data;
|
||||
|
||||
if (user && !user.is_reward_approved && rewardsEnabled) {
|
||||
if (!user.primary_email || !user.has_verified_email || !user.is_identity_verified) {
|
||||
return (
|
||||
<div className="section">
|
||||
<RewardAuthIntro />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Card
|
||||
className="section"
|
||||
title={__('Reward validation pending')}
|
||||
body={
|
||||
<React.Fragment>
|
||||
<p>
|
||||
{__(
|
||||
'This account must undergo review before you can participate in the rewards program. Not all users and regions may qualify.'
|
||||
)}{' '}
|
||||
{__('This can take anywhere from a few hours to several days. Please be patient.')}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
{__(
|
||||
'We apologize for this inconvenience, but have added this additional step to prevent abuse. Users on VPN or shared connections will continue to see this message and are not eligible for Rewards.'
|
||||
)}
|
||||
</p>
|
||||
<p>
|
||||
<I18nMessage
|
||||
tokens={{
|
||||
rewards_faq: <Button button="link" label={__('Rewards FAQ')} href="https://lbry.com/faq/support" />,
|
||||
help_email: SITE_HELP_EMAIL,
|
||||
site_name: SITE_NAME,
|
||||
}}
|
||||
>
|
||||
Please review the %rewards_faq% for eligibility, and send us an email to %help_email% if you continue
|
||||
to see this message. You can continue to use %site_name% without this feature.
|
||||
</I18nMessage>
|
||||
{`${__('Enjoy all the awesome free content in the meantime!')}`}
|
||||
</p>
|
||||
</React.Fragment>
|
||||
}
|
||||
actions={
|
||||
<div className="section__actions">
|
||||
<Button navigate="/" button="primary" label="Return Home" />
|
||||
<Button onClick={() => fetchUser()} button="link" label="Refresh" />
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
renderCustomRewardCode() {
|
||||
const { user } = this.props;
|
||||
const isNotEligible = !user || !user.primary_email || !user.has_verified_email || !user.is_reward_approved;
|
||||
return (
|
||||
<RewardTile
|
||||
key={REWARD_TYPES.TYPE_GENERATED_CODE}
|
||||
reward={{
|
||||
reward_type: REWARD_TYPES.TYPE_GENERATED_CODE,
|
||||
reward_title: __('Custom Code'),
|
||||
reward_description: __('Are you a supermodel or rockstar that received a custom reward code? Claim it here.'),
|
||||
}}
|
||||
disabled={isNotEligible}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
renderUnclaimedRewards() {
|
||||
const { fetching, rewards, user, daemonSettings, claimed } = this.props;
|
||||
|
||||
if (daemonSettings && !daemonSettings.share_usage_data) {
|
||||
return (
|
||||
<section className="card card--section">
|
||||
<h2 className="card__title card__title--deprecated">{__('Rewards Disabled')}</h2>
|
||||
<p className="error__text">
|
||||
<I18nMessage tokens={{ settings: <Button button="link" navigate="/$/settings" label="Settings" /> }}>
|
||||
Rewards are currently disabled for your account. Turn on diagnostic data sharing, in %settings%, to
|
||||
re-enable them.
|
||||
</I18nMessage>
|
||||
</p>
|
||||
</section>
|
||||
);
|
||||
} else if (fetching) {
|
||||
return <BusyIndicator message={__('Fetching rewards')} />;
|
||||
} else if (user === null) {
|
||||
return (
|
||||
<p className="help">{__('This application is unable to earn rewards due to an authentication failure.')}</p>
|
||||
);
|
||||
} else if (!rewards || rewards.length <= 0) {
|
||||
return (
|
||||
<Card
|
||||
title={__('No rewards available')}
|
||||
subtitle={
|
||||
claimed && claimed.length
|
||||
? __(
|
||||
"You have claimed all available rewards! We're regularly adding more so be sure to check back later."
|
||||
)
|
||||
: __('There are no rewards available at this time, please check back later.')
|
||||
}
|
||||
actions={<Button button="primary" navigate={`/$/${PAGES.DISCOVER}`} label={__('Go Home')} />}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
const isNotEligible = !user || !user.primary_email || !user.has_verified_email || !user.is_reward_approved;
|
||||
|
||||
return (
|
||||
<div
|
||||
aria-hidden={isNotEligible}
|
||||
className={classnames('card__list', {
|
||||
'card--disabled': isNotEligible,
|
||||
})}
|
||||
>
|
||||
{rewards.map((reward) => (
|
||||
<RewardTile disabled={isNotEligible} key={reward.claim_code} reward={reward} />
|
||||
))}
|
||||
{this.renderCustomRewardCode()}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Page>
|
||||
{this.renderPageHeader()}
|
||||
<div className="section">{this.renderUnclaimedRewards()}</div>
|
||||
<RewardListClaimed />
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default RewardsPage;
|
||||
@@ -1,9 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { selectUser } from 'redux/selectors/user';
|
||||
import RewardsVerifyPage from './view';
|
||||
|
||||
const select = state => ({
|
||||
user: selectUser(state),
|
||||
});
|
||||
|
||||
export default connect(select, null)(RewardsVerifyPage);
|
||||
@@ -1,29 +0,0 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import UserVerify from 'component/userVerify';
|
||||
import Page from 'component/page';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
|
||||
type Props = {
|
||||
user: ?User,
|
||||
};
|
||||
|
||||
function RewardsVerifyPage(props: Props) {
|
||||
const { user } = props;
|
||||
const { goBack } = useHistory();
|
||||
const rewardsApproved = user && user.is_reward_approved;
|
||||
|
||||
React.useEffect(() => {
|
||||
if (rewardsApproved) {
|
||||
goBack();
|
||||
}
|
||||
}, [rewardsApproved]);
|
||||
|
||||
return (
|
||||
<Page>
|
||||
<UserVerify onSkip={() => goBack()} />
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
export default RewardsVerifyPage;
|
||||
@@ -8,7 +8,6 @@ import {
|
||||
makeSelectHasReachedMaxResultsLength,
|
||||
} from 'redux/selectors/search';
|
||||
import { selectShowMatureContent } from 'redux/selectors/settings';
|
||||
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
||||
import { getSearchQueryString } from 'util/query-params';
|
||||
import SearchPage from './view';
|
||||
|
||||
@@ -36,7 +35,6 @@ const select = (state, props) => {
|
||||
searchOptions,
|
||||
isSearching: selectIsSearching(state),
|
||||
uris: uris,
|
||||
isAuthenticated: selectUserVerifiedEmail(state),
|
||||
hasReachedMaxResultsLength: hasReachedMaxResultsLength,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -16,7 +16,6 @@ type Props = {
|
||||
search: (string, SearchOptions) => void,
|
||||
isSearching: boolean,
|
||||
uris: Array<string>,
|
||||
isAuthenticated: boolean,
|
||||
hasReachedMaxResultsLength: boolean,
|
||||
};
|
||||
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doEnterSettingsPage, doExitSettingsPage } from 'redux/actions/settings';
|
||||
import { selectDaemonSettings } from 'redux/selectors/settings';
|
||||
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
||||
|
||||
import SettingsPage from './view';
|
||||
|
||||
const select = (state) => ({
|
||||
daemonSettings: selectDaemonSettings(state),
|
||||
isAuthenticated: selectUserVerifiedEmail(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
|
||||
@@ -14,7 +14,6 @@ type DaemonSettings = {
|
||||
|
||||
type Props = {
|
||||
daemonSettings: DaemonSettings,
|
||||
isAuthenticated: boolean,
|
||||
enterSettings: () => void,
|
||||
exitSettings: () => void,
|
||||
};
|
||||
|
||||
Loaded 100 of 118 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user