feat: client dev landing page

This commit is contained in:
Lin Onetwo
2023-01-04 18:03:57 +08:00
parent fae43e90da
commit 4adf4f886f
5 changed files with 80 additions and 9 deletions
+8
View File
@@ -8,3 +8,11 @@ export function AffineBasicPage() {
}, []);
return null;
}
export function AffineDevPage() {
useEffect(() => {
location.href = 'http://localhost:8080';
redirect('http://localhost:8080');
}, []);
return null;
}
+22 -1
View File
@@ -1,3 +1,24 @@
import styled from '@emotion/styled';
import { Link } from 'react-router-dom';
const Container = styled.div`
display: flex;
flex-direction: column;
& > a {
color: #333;
padding: 10px;
&:hover {
opacity: 0.7;
}
}
`;
export function LandingPage() {
return <div>TBD</div>;
return (
<Container>
<Link to="/affine-dev">Affine Dev Build</Link>
<Link to="/affine">Affine Dist Bundle</Link>
</Container>
);
}
+6 -1
View File
@@ -1,5 +1,5 @@
import { createBrowserRouter } from 'react-router-dom';
import { AffineBasicPage } from './AFFiNE/index.js';
import { AffineBasicPage, AffineDevPage } from './AFFiNE/index.js';
import { LandingPage } from './Landing/index.js';
import { RootLayout } from './Root.js';
@@ -14,6 +14,11 @@ export const routes = [
name: 'AFFiNE Basic',
element: <AffineBasicPage />,
},
{
path: '/affine-dev',
name: 'AFFiNE Dev',
element: <AffineDevPage />,
},
];
export const router = createBrowserRouter([
{ path: '/', element: <RootLayout />, children: routes },