Skip to content
Extraits de code Groupes Projets
Valider 1e9d2c4b rédigé par Eugen Rochko's avatar Eugen Rochko
Parcourir les fichiers

Add "not found" component to UI

parent a1db2a19
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
import { FormattedMessage } from 'react-intl'; import { FormattedMessage } from 'react-intl';
const LoadingIndicator = () => { const style = {
const style = { textAlign: 'center',
textAlign: 'center', fontSize: '16px',
fontSize: '16px', fontWeight: '500',
fontWeight: '500', color: '#616b86',
color: '#616b86', paddingTop: '120px'
paddingTop: '120px'
};
return <div style={style}><FormattedMessage id='loading_indicator.label' defaultMessage='Loading...' /></div>;
}; };
const LoadingIndicator = () => (
<div style={style}>
<FormattedMessage id='loading_indicator.label' defaultMessage='Loading...' />
</div>
);
export default LoadingIndicator; export default LoadingIndicator;
import { FormattedMessage } from 'react-intl';
const style = {
textAlign: 'center',
fontSize: '16px',
fontWeight: '500',
color: '#616b86',
paddingTop: '120px'
};
const MissingIndicator = () => (
<div style={style}>
<FormattedMessage id='missing_indicator.label' defaultMessage='Not found' />
</div>
);
export default MissingIndicator;
...@@ -33,6 +33,7 @@ import Favourites from '../features/favourites'; ...@@ -33,6 +33,7 @@ import Favourites from '../features/favourites';
import HashtagTimeline from '../features/hashtag_timeline'; import HashtagTimeline from '../features/hashtag_timeline';
import Notifications from '../features/notifications'; import Notifications from '../features/notifications';
import FollowRequests from '../features/follow_requests'; import FollowRequests from '../features/follow_requests';
import GenericNotFound from '../features/generic_not_found';
import { IntlProvider, addLocaleData } from 'react-intl'; import { IntlProvider, addLocaleData } from 'react-intl';
import en from 'react-intl/locale-data/en'; import en from 'react-intl/locale-data/en';
import de from 'react-intl/locale-data/de'; import de from 'react-intl/locale-data/de';
...@@ -125,6 +126,7 @@ const Mastodon = React.createClass({ ...@@ -125,6 +126,7 @@ const Mastodon = React.createClass({
</Route> </Route>
<Route path='follow_requests' component={FollowRequests} /> <Route path='follow_requests' component={FollowRequests} />
<Route path='*' component={GenericNotFound} />
</Route> </Route>
</Router> </Router>
</Provider> </Provider>
......
import Column from '../ui/components/column';
import MissingIndicator from '../../components/missing_indicator';
const GenericNotFound = () => (
<Column>
<MissingIndicator />
</Column>
);
export default GenericNotFound;
...@@ -48,7 +48,8 @@ const Status = React.createClass({ ...@@ -48,7 +48,8 @@ const Status = React.createClass({
dispatch: React.PropTypes.func.isRequired, dispatch: React.PropTypes.func.isRequired,
status: ImmutablePropTypes.map, status: ImmutablePropTypes.map,
ancestorsIds: ImmutablePropTypes.list, ancestorsIds: ImmutablePropTypes.list,
descendantsIds: ImmutablePropTypes.list descendantsIds: ImmutablePropTypes.list,
me: React.PropTypes.number
}, },
mixins: [PureRenderMixin], mixins: [PureRenderMixin],
...@@ -81,6 +82,7 @@ const Status = React.createClass({ ...@@ -81,6 +82,7 @@ const Status = React.createClass({
handleMentionClick (account) { handleMentionClick (account) {
this.props.dispatch(mentionCompose(account)); this.props.dispatch(mentionCompose(account));
if (isMobile(window.innerWidth)) { if (isMobile(window.innerWidth)) {
this.context.router.push('/statuses/new'); this.context.router.push('/statuses/new');
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter