This commit is contained in:
Sean Yesmunt 2019-08-09 13:12:28 -04:00
parent 5e72ef920f
commit 96ca28019f
4 changed files with 31 additions and 57 deletions

View file

@ -70,7 +70,6 @@ const Button = forwardRef<any, {}>((props: Props, ref: any) => {
'button--disabled': disabled, 'button--disabled': disabled,
'button--link': button === 'link', 'button--link': button === 'link',
'button--constrict': constrict, 'button--constrict': constrict,
'button--splash': button === 'splash',
} }
: 'button--no-style', : 'button--no-style',
className className

View file

@ -11,7 +11,6 @@ import ModalDownloading from 'modal/modalDownloading';
import 'css-doodle'; import 'css-doodle';
const FORTY_FIVE_SECONDS = 45 * 1000; const FORTY_FIVE_SECONDS = 45 * 1000;
type SetDaemonSettingArg = boolean | string | number;
type Props = { type Props = {
checkDaemonVersion: () => Promise<any>, checkDaemonVersion: () => Promise<any>,
@ -24,7 +23,7 @@ type Props = {
id: string, id: string,
}, },
animationHidden: boolean, animationHidden: boolean,
setClientSetting: (string, SetDaemonSettingArg) => void, setClientSetting: (string, boolean) => void,
}; };
type State = { type State = {
@ -147,22 +146,13 @@ export default class SplashScreen extends React.PureComponent<Props, State> {
message: __('Blockchain Sync'), message: __('Blockchain Sync'),
details: `${__('Catching up...')} (${blockchainHeaders.download_progress}%)`, details: `${__('Catching up...')} (${blockchainHeaders.download_progress}%)`,
}); });
if (this.timeout) {
clearTimeout(this.timeout);
}
} }
} else if (wallet && wallet.blocks_behind > 0) { } else if (wallet && wallet.blocks_behind > 0) {
const format = wallet.blocks_behind === 1 ? '%s block behind' : '%s blocks behind'; const format = wallet.blocks_behind === 1 ? '%s block behind' : '%s blocks behind';
// Only show blocks behind if it takes more than a few seconds.
setTimeout(() => {
this.setState({ this.setState({
message: __('Blockchain Sync'), message: __('Blockchain Sync'),
details: `${__('Catching up...')} (${__(format, wallet.blocks_behind)})`, details: `${__('Catching up...')} (${__(format, wallet.blocks_behind)})`,
}); });
}, 5000);
if (this.timeout) {
clearTimeout(this.timeout);
}
} else if ( } else if (
wallet && wallet &&
wallet.blocks_behind === 0 && wallet.blocks_behind === 0 &&
@ -170,15 +160,10 @@ export default class SplashScreen extends React.PureComponent<Props, State> {
!status.is_running && !status.is_running &&
startupStatus.database startupStatus.database
) { ) {
// Usually the transaction sync state, there's no status for this yet
// Only show after user has been waiting 10 seconds
// https://github.com/lbryio/lbry-sdk/issues/2314
setTimeout(() => {
this.setState({ this.setState({
message: 'Finalizing', message: 'Finalizing',
details: 'Almost done...', details: 'Almost ready...',
}); });
}, 10000);
} }
setTimeout(() => { setTimeout(() => {
@ -278,14 +263,15 @@ export default class SplashScreen extends React.PureComponent<Props, State> {
</css-doodle> </css-doodle>
)} )}
<Button <Button
className="splash__controls" className="splash__animation-toggle"
button="splash" label={!animationHidden ? __('I feel woosy! Stop spinning!') : __('Spin Spin Sugar')}
label={!animationHidden ? __('I feel woosy! Stop spinning!') : 'Spin Spin Sugar'}
onClick={() => setClientSetting(SETTINGS.HIDE_SPLASH_ANIMATION, !animationHidden)} onClick={() => setClientSetting(SETTINGS.HIDE_SPLASH_ANIMATION, !animationHidden)}
/> />
{error && ( {error && (
<div className="splash__error card card--section"> <div className="splash__error card card--section">
<h3>{__('Uh oh. The flux in our Retro Encabulator must be out of whack. Try refreshing to fix it.')}</h3> <p className="card__subtitle">
{__('Uh oh. The flux in our Retro Encabulator must be out of whack. Try refreshing to fix it.')}
</p>
<div className="card__actions--top-space card__actions--center"> <div className="card__actions--top-space card__actions--center">
<Button button="primary" label={__('Refresh')} onClick={() => window.location.reload()} /> <Button button="primary" label={__('Refresh')} onClick={() => window.location.reload()} />
</div> </div>

View file

@ -31,14 +31,11 @@
} }
.button--primary, .button--primary,
.button--inverse, .button--inverse {
.button--splash {
height: var(--button-height); height: var(--button-height);
border-radius: var(--button-radius); border-radius: var(--button-radius);
padding-top: 0; padding-top: 0;
padding-bottom: 0; padding-bottom: 0;
padding-right: 1em;
padding-left: 1em;
box-sizing: border-box; box-sizing: border-box;
} }
@ -55,21 +52,6 @@
} }
} }
.button--splash {
border-color: $lbry-white;
color: $lbry-white;
background-color: rgba($lbry-white, 0.2);
font-size: var(--font-label);
&:hover {
color: $lbry-white;
background-color: rgba($lbry-white, 0.5);
.icon {
stroke: $lbry-white;
}
}
}
.button--alt { .button--alt {
padding: 0; padding: 0;
} }

View file

@ -10,11 +10,6 @@
overflow: hidden; overflow: hidden;
} }
// .splash__actions {
// margin-top: var(--spacing-medium);
// align-items: center;
// }
.splash__button { .splash__button {
border-bottom: 1px solid $lbry-white; border-bottom: 1px solid $lbry-white;
color: $lbry-white; color: $lbry-white;
@ -28,7 +23,6 @@
.splash__details { .splash__details {
position: absolute; position: absolute;
font-size: 12px;
line-height: 1; line-height: 1;
font-weight: 300; font-weight: 300;
color: $lbry-white; color: $lbry-white;
@ -44,10 +38,23 @@
margin-top: -1rem; margin-top: -1rem;
} }
.splash__controls { .splash__animation-toggle {
position: fixed; position: fixed;
bottom: 30px; bottom: var(--spacing-large);
right: 30px; right: var(--spacing-large);
padding: var(--spacing-medium);
border-color: $lbry-white;
color: $lbry-white;
background-color: rgba($lbry-white, 0.2);
font-size: var(--font-label);
&:hover {
color: $lbry-white;
background-color: rgba($lbry-white, 0.5);
.icon {
stroke: $lbry-white;
}
}
} }
.splash__error { .splash__error {