feat: profile page
This commit is contained in:
20
src/app.tsx
20
src/app.tsx
@@ -2,6 +2,7 @@ import { FunctionComponent } from "preact";
|
||||
import { ErrorBoundary, LocationProvider, Route, Router, useLocation } from "preact-iso";
|
||||
import "preact/debug";
|
||||
import LoginPage from "./pages/login";
|
||||
import ProfilePage from "./pages/profile";
|
||||
|
||||
const HomePage: FunctionComponent = () => {
|
||||
const location = useLocation();
|
||||
@@ -11,15 +12,14 @@ const HomePage: FunctionComponent = () => {
|
||||
|
||||
export function App() {
|
||||
return (
|
||||
<>
|
||||
<LocationProvider>
|
||||
<ErrorBoundary>
|
||||
<Router>
|
||||
<Route path="/" component={HomePage} />
|
||||
<Route path="/login" component={LoginPage} />
|
||||
</Router>
|
||||
</ErrorBoundary>
|
||||
</LocationProvider>
|
||||
</>
|
||||
<LocationProvider>
|
||||
<ErrorBoundary>
|
||||
<Router>
|
||||
<Route path="/" component={HomePage} />
|
||||
<Route path="/login" component={LoginPage} />
|
||||
<Route path="/profile" component={ProfilePage} />
|
||||
</Router>
|
||||
</ErrorBoundary>
|
||||
</LocationProvider>
|
||||
);
|
||||
}
|
||||
|
||||
13
src/components/layout.tsx
Normal file
13
src/components/layout.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { FunctionComponent } from "preact";
|
||||
import Menu from "./menu";
|
||||
|
||||
const Layout: FunctionComponent = (props) => {
|
||||
return (
|
||||
<div class="flex min-w-screen flex-row justify-between">
|
||||
{props.children}
|
||||
<Menu />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Layout;
|
||||
1
src/pages/profile.module.scss
Normal file
1
src/pages/profile.module.scss
Normal file
@@ -0,0 +1 @@
|
||||
@reference "../index.scss";
|
||||
12
src/pages/profile.tsx
Normal file
12
src/pages/profile.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import Layout from "@/components/layout";
|
||||
import { FunctionComponent } from "preact";
|
||||
|
||||
const ProfilePage: FunctionComponent = () => {
|
||||
return (
|
||||
<Layout>
|
||||
<p>Profile</p>
|
||||
</Layout>
|
||||
);
|
||||
};
|
||||
|
||||
export default ProfilePage;
|
||||
Reference in New Issue
Block a user