mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-25 14:34:19 +00:00
✨ Add page routing
This commit is contained in:
parent
bf73bc4a7b
commit
882de3bac8
9 changed files with 79 additions and 21 deletions
|
@ -9,6 +9,11 @@ import InputWithIcon from "./components/InputWithIcon"
|
|||
import Layout from "./components/Layout"
|
||||
import ContextTheme from "./contexts/ContextTheme"
|
||||
import { BrowserRouter } from "react-router-dom"
|
||||
import { Route, Switch } from "react-router"
|
||||
import PageHome from "./routes/PageHome"
|
||||
import PageRepositories from "./routes/PageRepositories"
|
||||
import PageAlerts from "./routes/PageAlerts"
|
||||
import PageSettings from "./routes/PageSettings"
|
||||
|
||||
|
||||
export default function App() {
|
||||
|
@ -20,27 +25,20 @@ export default function App() {
|
|||
|
||||
<div className={classNames(Style.App, theme)}>
|
||||
<Layout>
|
||||
<BoxWithHeader
|
||||
header={"Sto provando i bottoni!"}
|
||||
>
|
||||
<div>
|
||||
<div>
|
||||
Ammirate:
|
||||
</div>
|
||||
<div>
|
||||
<Button color={"Green"} icon={faArrowRight}>Verde</Button>
|
||||
<Button color={"Grey"} icon={faArchive}>Grigio</Button>
|
||||
<Button color={"Yellow"} icon={faExclamationTriangle}>Giallo</Button>
|
||||
<Button color={"Red"} icon={faTrash}>Rosso</Button>
|
||||
</div>
|
||||
<div>
|
||||
E già che ci siamo, un Input, con e senza icona:
|
||||
</div>
|
||||
<div>
|
||||
<Input/> <InputWithIcon icon={faSearch}/>
|
||||
</div>
|
||||
</div>
|
||||
</BoxWithHeader>
|
||||
<Switch>
|
||||
<Route path={"/"}>
|
||||
<PageHome/>
|
||||
</Route>
|
||||
<Route path={"/repositories"}>
|
||||
<PageRepositories/>
|
||||
</Route>
|
||||
<Route path={"/alerts"}>
|
||||
<PageAlerts/>
|
||||
</Route>
|
||||
<Route path={"/settings"}>
|
||||
<PageSettings/>
|
||||
</Route>
|
||||
</Switch>
|
||||
</Layout>
|
||||
</div>
|
||||
|
||||
|
|
12
code/frontend/src/routes/PageAlerts.js
Normal file
12
code/frontend/src/routes/PageAlerts.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
import React from "react"
|
||||
import Style from "./PageAlerts.module.css"
|
||||
import classNames from "classnames"
|
||||
|
||||
|
||||
export default function PageAlerts({ children, className, ...props }) {
|
||||
return (
|
||||
<div className={classNames(Style.PageAlerts, className)} {...props}>
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
3
code/frontend/src/routes/PageAlerts.module.css
Normal file
3
code/frontend/src/routes/PageAlerts.module.css
Normal file
|
@ -0,0 +1,3 @@
|
|||
.PageAlerts {
|
||||
|
||||
}
|
12
code/frontend/src/routes/PageHome.js
Normal file
12
code/frontend/src/routes/PageHome.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
import React from "react"
|
||||
import Style from "./PageHome.module.css"
|
||||
import classNames from "classnames"
|
||||
|
||||
|
||||
export default function PageHome({ children, className, ...props }) {
|
||||
return (
|
||||
<div className={classNames(Style.PageHome, className)} {...props}>
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
3
code/frontend/src/routes/PageHome.module.css
Normal file
3
code/frontend/src/routes/PageHome.module.css
Normal file
|
@ -0,0 +1,3 @@
|
|||
.PageHome {
|
||||
|
||||
}
|
12
code/frontend/src/routes/PageRepositories.js
Normal file
12
code/frontend/src/routes/PageRepositories.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
import React from "react"
|
||||
import Style from "./PageRepositories.module.css"
|
||||
import classNames from "classnames"
|
||||
|
||||
|
||||
export default function PageRepositories({ children, className, ...props }) {
|
||||
return (
|
||||
<div className={classNames(Style.PageRepositories, className)} {...props}>
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
3
code/frontend/src/routes/PageRepositories.module.css
Normal file
3
code/frontend/src/routes/PageRepositories.module.css
Normal file
|
@ -0,0 +1,3 @@
|
|||
.PageRepositories {
|
||||
|
||||
}
|
12
code/frontend/src/routes/PageSettings.js
Normal file
12
code/frontend/src/routes/PageSettings.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
import React from "react"
|
||||
import Style from "./PageSettings.module.css"
|
||||
import classNames from "classnames"
|
||||
|
||||
|
||||
export default function PageSettings({ children, className, ...props }) {
|
||||
return (
|
||||
<div className={classNames(Style.PageSettings, className)} {...props}>
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
3
code/frontend/src/routes/PageSettings.module.css
Normal file
3
code/frontend/src/routes/PageSettings.module.css
Normal file
|
@ -0,0 +1,3 @@
|
|||
.PageSettings {
|
||||
|
||||
}
|
Loading…
Reference in a new issue