feat: profile page

This commit is contained in:
2025-04-02 16:46:20 +03:00
parent f3c983be6f
commit 0843e4b20d
4 changed files with 36 additions and 10 deletions

View File

@@ -2,6 +2,7 @@ import { FunctionComponent } from "preact";
import { ErrorBoundary, LocationProvider, Route, Router, useLocation } from "preact-iso"; import { ErrorBoundary, LocationProvider, Route, Router, useLocation } from "preact-iso";
import "preact/debug"; import "preact/debug";
import LoginPage from "./pages/login"; import LoginPage from "./pages/login";
import ProfilePage from "./pages/profile";
const HomePage: FunctionComponent = () => { const HomePage: FunctionComponent = () => {
const location = useLocation(); const location = useLocation();
@@ -11,15 +12,14 @@ const HomePage: FunctionComponent = () => {
export function App() { export function App() {
return ( return (
<>
<LocationProvider> <LocationProvider>
<ErrorBoundary> <ErrorBoundary>
<Router> <Router>
<Route path="/" component={HomePage} /> <Route path="/" component={HomePage} />
<Route path="/login" component={LoginPage} /> <Route path="/login" component={LoginPage} />
<Route path="/profile" component={ProfilePage} />
</Router> </Router>
</ErrorBoundary> </ErrorBoundary>
</LocationProvider> </LocationProvider>
</>
); );
} }

13
src/components/layout.tsx Normal file
View 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;

View File

@@ -0,0 +1 @@
@reference "../index.scss";

12
src/pages/profile.tsx Normal file
View 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;