-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add basic file structure and routing
- Loading branch information
Showing
6 changed files
with
61 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,33 @@ | ||
import { createHashRouter, RouterProvider } from 'react-router-dom'; | ||
|
||
import MainLayout from '@/layouts/MainLayout'; | ||
import LoginPage from '@pages/LoginPage'; | ||
import MainPage from '@pages/MainPage'; | ||
import WelcomePage from '@pages/WelcomePage'; | ||
|
||
const router = createHashRouter([ | ||
{ | ||
path: '/', | ||
element: <MainLayout />, | ||
children: [ | ||
{ | ||
path: '/', | ||
element: <WelcomePage />, | ||
}, | ||
{ | ||
path: 'login', | ||
element: <LoginPage />, | ||
}, | ||
{ | ||
path: 'mainpage', | ||
element: <MainPage />, | ||
}, | ||
], | ||
}, | ||
]); | ||
|
||
function App() { | ||
return ( | ||
<div className="h-[100dvh] bg-[green] text-3xl"> | ||
<div>Hello, I'm the future graphiql app!</div> | ||
<div>Trulala</div> | ||
</div> | ||
); | ||
return <RouterProvider router={router} />; | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Outlet } from 'react-router-dom'; | ||
|
||
export default function MainLayout() { | ||
return ( | ||
<main> | ||
<header>Here will be header</header> | ||
<section> | ||
<Outlet /> | ||
</section> | ||
<footer>Here will be footer</footer> | ||
</main> | ||
); | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function LoginPage() { | ||
return <section>Here is my fancy login page!</section>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function LoginPage() { | ||
return <section>Here is my fancy main page!</section>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Link } from 'react-router-dom'; | ||
|
||
export default function LoginPage() { | ||
return ( | ||
<section> | ||
Here is my fancy welcome page! | ||
<div className="flex flex-col"> | ||
<Link to="../login">login</Link> | ||
<Link to="../mainpage">main page</Link> | ||
</div> | ||
</section> | ||
); | ||
} |