1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-22 13:04:19 +00:00

Add page routing

This commit is contained in:
Stefano Pigozzi 2021-04-21 18:21:30 +02:00
parent bf73bc4a7b
commit 882de3bac8
Signed by untrusted user who does not match committer: steffo
GPG key ID: 6965406171929D01
9 changed files with 79 additions and 21 deletions

View file

@ -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>

View 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>
)
}

View file

@ -0,0 +1,3 @@
.PageAlerts {
}

View 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>
)
}

View file

@ -0,0 +1,3 @@
.PageHome {
}

View 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>
)
}

View file

@ -0,0 +1,3 @@
.PageRepositories {
}

View 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>
)
}

View file

@ -0,0 +1,3 @@
.PageSettings {
}