mirror of
https://github.com/hyperspacedev/hyperspace
synced 2025-02-09 16:28:43 +01:00
Add 404 redirect, essentially
This commit is contained in:
parent
55cc89a386
commit
8536dedf2c
32
src/App.tsx
32
src/App.tsx
@ -3,7 +3,7 @@ import {MuiThemeProvider, CssBaseline, withStyles } from '@material-ui/core';
|
|||||||
import { setHyperspaceTheme, darkMode } from './utilities/themes';
|
import { setHyperspaceTheme, darkMode } from './utilities/themes';
|
||||||
import AppLayout from './components/AppLayout';
|
import AppLayout from './components/AppLayout';
|
||||||
import {styles} from './App.styles';
|
import {styles} from './App.styles';
|
||||||
import {Route} from 'react-router-dom';
|
import {Route, Switch} from 'react-router-dom';
|
||||||
import AboutPage from './pages/About';
|
import AboutPage from './pages/About';
|
||||||
import Settings from './pages/Settings';
|
import Settings from './pages/Settings';
|
||||||
import { getUserDefaultBool, getUserDefaultTheme } from './utilities/settings';
|
import { getUserDefaultBool, getUserDefaultTheme } from './utilities/settings';
|
||||||
@ -18,6 +18,7 @@ import Composer from './pages/Compose';
|
|||||||
import WelcomePage from './pages/Welcome';
|
import WelcomePage from './pages/Welcome';
|
||||||
import MessagesPage from './pages/Messages';
|
import MessagesPage from './pages/Messages';
|
||||||
import RecommendationsPage from './pages/Recommendations';
|
import RecommendationsPage from './pages/Recommendations';
|
||||||
|
import Missingno from './pages/Missingno';
|
||||||
import {withSnackbar} from 'notistack';
|
import {withSnackbar} from 'notistack';
|
||||||
import {PrivateRoute} from './interfaces/overrides';
|
import {PrivateRoute} from './interfaces/overrides';
|
||||||
import { userLoggedIn } from './utilities/accounts';
|
import { userLoggedIn } from './utilities/accounts';
|
||||||
@ -49,19 +50,22 @@ class App extends Component<any, any> {
|
|||||||
<Route path="/welcome" component={WelcomePage}/>
|
<Route path="/welcome" component={WelcomePage}/>
|
||||||
<div>
|
<div>
|
||||||
{ userLoggedIn()? <AppLayout/>: null}
|
{ userLoggedIn()? <AppLayout/>: null}
|
||||||
<PrivateRoute exact path="/" component={HomePage}/>
|
<Switch>
|
||||||
<PrivateRoute path="/home" component={HomePage}/>
|
<PrivateRoute exact path="/" component={HomePage}/>
|
||||||
<PrivateRoute path="/local" component={LocalPage}/>
|
<PrivateRoute path="/home" component={HomePage}/>
|
||||||
<PrivateRoute path="/public" component={PublicPage}/>
|
<PrivateRoute path="/local" component={LocalPage}/>
|
||||||
<PrivateRoute path="/messages" component={MessagesPage}/>
|
<PrivateRoute path="/public" component={PublicPage}/>
|
||||||
<PrivateRoute path="/notifications" component={NotificationsPage}/>
|
<PrivateRoute path="/messages" component={MessagesPage}/>
|
||||||
<PrivateRoute path="/profile/:profileId" component={ProfilePage}/>
|
<PrivateRoute path="/notifications" component={NotificationsPage}/>
|
||||||
<PrivateRoute path="/conversation/:conversationId" component={Conversation}/>
|
<PrivateRoute path="/profile/:profileId" component={ProfilePage}/>
|
||||||
<PrivateRoute path="/search" component={SearchPage}/>
|
<PrivateRoute path="/conversation/:conversationId" component={Conversation}/>
|
||||||
<PrivateRoute path="/settings" component={Settings}/>
|
<PrivateRoute path="/search" component={SearchPage}/>
|
||||||
<PrivateRoute path="/about" component={AboutPage}/>
|
<PrivateRoute path="/settings" component={Settings}/>
|
||||||
<PrivateRoute path="/compose" component={Composer}/>
|
<PrivateRoute path="/about" component={AboutPage}/>
|
||||||
<PrivateRoute path="/recommended" component={RecommendationsPage}/>
|
<PrivateRoute path="/compose" component={Composer}/>
|
||||||
|
<PrivateRoute path="/recommended" component={RecommendationsPage}/>
|
||||||
|
<PrivateRoute component={Missingno}/>
|
||||||
|
</Switch>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</MuiThemeProvider>
|
</MuiThemeProvider>
|
||||||
|
25
src/pages/Missingno.tsx
Normal file
25
src/pages/Missingno.tsx
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import React, {Component} from 'react';
|
||||||
|
import {withStyles, Typography} from '@material-ui/core';
|
||||||
|
import {styles} from './PageLayout.styles';
|
||||||
|
import {LinkableButton} from '../interfaces/overrides';
|
||||||
|
|
||||||
|
class Missingno extends Component<any, any> {
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const {classes} = this.props;
|
||||||
|
return (
|
||||||
|
<div className={classes.pageLayoutConstraints}>
|
||||||
|
<div>
|
||||||
|
<Typography variant="h4" component="h1"><b>Uh oh!</b></Typography>
|
||||||
|
<Typography variant="h6" component="p">The part of Hyperspace you're looking for isn't here.</Typography>
|
||||||
|
<br/>
|
||||||
|
<LinkableButton to="/home" color="primary" variant="contained">
|
||||||
|
Go back to home timeline
|
||||||
|
</LinkableButton>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default withStyles(styles)(Missingno);
|
Loading…
x
Reference in New Issue
Block a user