mirror of
https://github.com/morten-olsen/parcel.git
synced 2026-02-08 01:36:24 +01:00
update
This commit is contained in:
33
src/App.tsx
33
src/App.tsx
@@ -1,25 +1,26 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { hot } from 'react-hot-loader/root';
|
import { hot } from 'react-hot-loader/root';
|
||||||
import { Layout, Menu } from 'antd';
|
import { Layout } from 'antd';
|
||||||
|
import { HashRouter as Router } from 'react-router-dom';
|
||||||
import { GithubProvider } from './contexts/Github';
|
import { GithubProvider } from './contexts/Github';
|
||||||
import { EncryptionProvider } from './contexts/Encryption';
|
import { EncryptionProvider } from './contexts/Encryption';
|
||||||
import { DecryptionProvider } from './contexts/Decryption';
|
import { DecryptionProvider } from './contexts/Decryption';
|
||||||
import AppRouter from './Router';
|
import AppRouter from './Router';
|
||||||
|
|
||||||
const App: React.FC = () => (
|
const App: React.FC = () => {
|
||||||
<GithubProvider>
|
return (
|
||||||
<EncryptionProvider>
|
<GithubProvider>
|
||||||
<DecryptionProvider>
|
<EncryptionProvider>
|
||||||
<Layout style={{minHeight:"100vh"}}>
|
<DecryptionProvider>
|
||||||
<Layout.Header>
|
<Layout style={{minHeight:"100vh"}}>
|
||||||
</Layout.Header>
|
<Router>
|
||||||
<Layout.Content style={{ padding: '25px', maxWidth: '800px', width: '100%', margin: 'auto' }}>
|
<AppRouter/>
|
||||||
<AppRouter/>
|
</Router>
|
||||||
</Layout.Content>
|
</Layout>
|
||||||
</Layout>
|
</DecryptionProvider>
|
||||||
</DecryptionProvider>
|
</EncryptionProvider>
|
||||||
</EncryptionProvider>
|
</GithubProvider>
|
||||||
</GithubProvider>
|
);
|
||||||
);
|
};
|
||||||
|
|
||||||
export default hot(App);
|
export default hot(App);
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {
|
import {
|
||||||
HashRouter as Router,
|
|
||||||
Switch,
|
Switch,
|
||||||
Route,
|
Route,
|
||||||
|
useHistory,
|
||||||
} from 'react-router-dom';
|
} from 'react-router-dom';
|
||||||
|
import { HomeFilled } from '@ant-design/icons';
|
||||||
|
import { Layout, Button, Space } from 'antd';
|
||||||
|
|
||||||
import Intro from './screens/Intro';
|
import Intro from './screens/Intro';
|
||||||
import Encrypt from './screens/Encrypt';
|
import Encrypt from './screens/Encrypt';
|
||||||
@@ -12,29 +14,44 @@ import SetupKey from './screens/SetupKey';
|
|||||||
import Welcome from './screens/Welcome';
|
import Welcome from './screens/Welcome';
|
||||||
import Debug from './screens/Debug';
|
import Debug from './screens/Debug';
|
||||||
|
|
||||||
const AppRouter: React.FC = () => (
|
const AppRouter: React.FC = () => {
|
||||||
<Router>
|
const history = useHistory();
|
||||||
<Switch>
|
return (
|
||||||
<Route path="/debug">
|
<>
|
||||||
<Debug />
|
<Layout style={{ textAlign: 'center' }}>
|
||||||
</Route>
|
<Space>
|
||||||
<Route path="/welcome">
|
<Button
|
||||||
<Welcome />
|
onClick={() => history.push('/')}
|
||||||
</Route>
|
icon={<HomeFilled />}
|
||||||
<Route path="/key">
|
>
|
||||||
<SetupKey />
|
Home
|
||||||
</Route>
|
</Button>
|
||||||
<Route path="/receive">
|
</Space>
|
||||||
<Decrypt />
|
</Layout>
|
||||||
</Route>
|
<Layout.Content style={{ padding: '25px', maxWidth: '800px', width: '100%', margin: 'auto' }}>
|
||||||
<Route path="/send">
|
<Switch>
|
||||||
<Encrypt />
|
<Route path="/debug">
|
||||||
</Route>
|
<Debug />
|
||||||
<Route path="/">
|
</Route>
|
||||||
<Intro />
|
<Route path="/welcome">
|
||||||
</Route>
|
<Welcome />
|
||||||
</Switch>
|
</Route>
|
||||||
</Router>
|
<Route path="/key">
|
||||||
);
|
<SetupKey />
|
||||||
|
</Route>
|
||||||
|
<Route path="/receive">
|
||||||
|
<Decrypt />
|
||||||
|
</Route>
|
||||||
|
<Route path="/send">
|
||||||
|
<Encrypt />
|
||||||
|
</Route>
|
||||||
|
<Route path="/">
|
||||||
|
<Intro />
|
||||||
|
</Route>
|
||||||
|
</Switch>
|
||||||
|
</Layout.Content>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export default AppRouter;
|
export default AppRouter;
|
||||||
|
|||||||
@@ -21,9 +21,8 @@ const Thumb: React.FC = ({
|
|||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
size="large"
|
size="large"
|
||||||
shape="round"
|
|
||||||
type="link"
|
|
||||||
icon={<Icon />}
|
icon={<Icon />}
|
||||||
|
type="link"
|
||||||
onClick={() => history.push(link)}
|
onClick={() => history.push(link)}
|
||||||
>
|
>
|
||||||
{title}
|
{title}
|
||||||
|
|||||||
Reference in New Issue
Block a user