once startup has failed, stop animations and strip UI

This commit is contained in:
Jeremy Kauffman 2020-03-02 09:42:43 -05:00 committed by Sean Yesmunt
parent 41c9ba4869
commit 619ab3d1de
3 changed files with 23 additions and 25 deletions

View file

@ -225,7 +225,7 @@ export default class SplashScreen extends React.PureComponent<Props, State> {
<h1 className="splash__title">LBRY</h1> <h1 className="splash__title">LBRY</h1>
<div className="splash__details">{details}</div> <div className="splash__details">{details}</div>
{!animationHidden && ( {!animationHidden && !error && (
<css-doodle class="doodle"> <css-doodle class="doodle">
{` {`
--color: @p(var(--color-primary), var(--color-secondary), var(--color-focus), var(--color-nothing)); --color: @p(var(--color-primary), var(--color-secondary), var(--color-focus), var(--color-nothing));
@ -262,21 +262,24 @@ export default class SplashScreen extends React.PureComponent<Props, State> {
`} `}
</css-doodle> </css-doodle>
)} )}
{!error && (
<Button <Button
className="splash__animation-toggle" className="splash__animation-toggle"
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 && (
<Card <Card
className="splash__error"
title={__('Error Starting Up')} title={__('Error Starting Up')}
subtitle={ subtitle={
<React.Fragment> <React.Fragment>
<p> <p>
Try refreshing to fix it. If you still have issues, your anti-virus software or firewall may be {__(
preventing startup. 'You can try refreshing to fix it. If you still have issues, your anti-virus software or firewall may be preventing startup.'
)}
</p> </p>
<p>
<I18nMessage <I18nMessage
tokens={{ tokens={{
help_link: ( help_link: (
@ -286,6 +289,7 @@ export default class SplashScreen extends React.PureComponent<Props, State> {
> >
Reach out to hello@lbry.com for help, or check out %help_link%. Reach out to hello@lbry.com for help, or check out %help_link%.
</I18nMessage> </I18nMessage>
</p>
</React.Fragment> </React.Fragment>
} }
actions={<Button button="primary" label={__('Refresh')} onClick={() => window.location.reload()} />} actions={<Button button="primary" label={__('Refresh')} onClick={() => window.location.reload()} />}

View file

@ -46,12 +46,6 @@
} }
} }
.splash__error {
position: absolute;
margin-top: 20rem;
background-color: #fff;
}
.doodle { .doodle {
position: fixed; position: fixed;
} }