kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
ErrorBoundary: improve icons and styles
rodzic
e19c2d8547
commit
b1e10f3db2
|
@ -2,6 +2,7 @@ import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
import { captureException } from 'soapbox/monitoring';
|
import { captureException } from 'soapbox/monitoring';
|
||||||
|
import Icon from 'soapbox/components/icon';
|
||||||
|
|
||||||
export default class ErrorBoundary extends React.PureComponent {
|
export default class ErrorBoundary extends React.PureComponent {
|
||||||
|
|
||||||
|
@ -67,12 +68,14 @@ export default class ErrorBoundary extends React.PureComponent {
|
||||||
return (
|
return (
|
||||||
<div className='error-boundary'>
|
<div className='error-boundary'>
|
||||||
<div>
|
<div>
|
||||||
<i className='fa fa-frown-o' aria-hidden='true' />
|
<Icon src={require('@tabler/icons/icons/mood-sad.svg')} className='sad-face' />
|
||||||
<FormattedMessage id='alert.unexpected.message' defaultMessage='An unexpected error occurred.' />
|
<FormattedMessage id='alert.unexpected.message' defaultMessage='An unexpected error occurred.' />
|
||||||
<a href='/' className='return-home'>
|
<div className='return-home'>
|
||||||
<i className='fa fa-reply' aria-hidden='true' />
|
<a a href='/'>
|
||||||
<FormattedMessage id='alert.unexpected.return_home' defaultMessage='Return Home' />
|
<Icon src={require('@tabler/icons/icons/arrow-back.svg')} />
|
||||||
</a>
|
<FormattedMessage id='alert.unexpected.return_home' defaultMessage='Return Home' />
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
{errorText && <textarea
|
{errorText && <textarea
|
||||||
ref={this.setTextareaRef}
|
ref={this.setTextareaRef}
|
||||||
className='error-boundary__component-stack'
|
className='error-boundary__component-stack'
|
||||||
|
|
|
@ -5,12 +5,29 @@
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 10px 10px 80px;
|
padding: 10px 10px 80px;
|
||||||
|
|
||||||
i.fa.fa-frown-o {
|
* {
|
||||||
display: block;
|
box-sizing: border-box;
|
||||||
text-align: center;
|
}
|
||||||
font-size: 70px;
|
|
||||||
margin: 20px 0;
|
::selection {
|
||||||
|
background-color: #000;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sad-face {
|
||||||
|
width: 70px;
|
||||||
|
height: 70px;
|
||||||
|
margin: 20px auto;
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
|
transition: 0.8s;
|
||||||
|
|
||||||
|
svg {
|
||||||
|
stroke-width: 1.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
|
@ -26,10 +43,23 @@
|
||||||
color: var(--primary-text-color--faint);
|
color: var(--primary-text-color--faint);
|
||||||
}
|
}
|
||||||
|
|
||||||
a.return-home {
|
.return-home {
|
||||||
display: block;
|
display: flex;
|
||||||
margin: 15px auto;
|
margin: 15px auto;
|
||||||
text-align: center;
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
a {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.svg-icon {
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue