mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-22 21:14:18 +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 Layout from "./components/Layout"
|
||||||
import ContextTheme from "./contexts/ContextTheme"
|
import ContextTheme from "./contexts/ContextTheme"
|
||||||
import { BrowserRouter } from "react-router-dom"
|
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() {
|
export default function App() {
|
||||||
|
@ -20,27 +25,20 @@ export default function App() {
|
||||||
|
|
||||||
<div className={classNames(Style.App, theme)}>
|
<div className={classNames(Style.App, theme)}>
|
||||||
<Layout>
|
<Layout>
|
||||||
<BoxWithHeader
|
<Switch>
|
||||||
header={"Sto provando i bottoni!"}
|
<Route path={"/"}>
|
||||||
>
|
<PageHome/>
|
||||||
<div>
|
</Route>
|
||||||
<div>
|
<Route path={"/repositories"}>
|
||||||
Ammirate:
|
<PageRepositories/>
|
||||||
</div>
|
</Route>
|
||||||
<div>
|
<Route path={"/alerts"}>
|
||||||
<Button color={"Green"} icon={faArrowRight}>Verde</Button>
|
<PageAlerts/>
|
||||||
<Button color={"Grey"} icon={faArchive}>Grigio</Button>
|
</Route>
|
||||||
<Button color={"Yellow"} icon={faExclamationTriangle}>Giallo</Button>
|
<Route path={"/settings"}>
|
||||||
<Button color={"Red"} icon={faTrash}>Rosso</Button>
|
<PageSettings/>
|
||||||
</div>
|
</Route>
|
||||||
<div>
|
</Switch>
|
||||||
E già che ci siamo, un Input, con e senza icona:
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<Input/> <InputWithIcon icon={faSearch}/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</BoxWithHeader>
|
|
||||||
</Layout>
|
</Layout>
|
||||||
</div>
|
</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