2021-05-11 14:37:15 +00:00
|
|
|
import React from "react"
|
2021-04-26 20:08:52 +00:00
|
|
|
import { Route, Switch } from "react-router"
|
|
|
|
import PageLogin from "./routes/PageLogin"
|
2021-05-24 01:51:14 +00:00
|
|
|
import PageRepositoriesList from "./routes/PageRepositoriesList"
|
|
|
|
import PageRepositoryAlerts from "./routes/PageRepositoryAlerts"
|
2021-04-26 20:08:52 +00:00
|
|
|
import PageSettings from "./routes/PageSettings"
|
2021-05-24 01:51:14 +00:00
|
|
|
import PageRepositoryCreate from "./routes/PageRepositoryCreate"
|
|
|
|
import PageRepositoryEdit from "./routes/PageRepositoryEdit"
|
2021-05-11 21:27:42 +00:00
|
|
|
import PageUsers from "./routes/PageUsers"
|
2021-05-24 01:51:14 +00:00
|
|
|
import PageRepositoryAnalyze from "./routes/PageRepositoryAnalyze"
|
2021-05-23 14:32:28 +00:00
|
|
|
import PageShare from "./routes/PageShare"
|
2021-05-25 02:06:14 +00:00
|
|
|
import { faQuestionCircle } from "@fortawesome/free-solid-svg-icons"
|
|
|
|
import makeIcon from "./utils/makeIcon"
|
|
|
|
import useStrings from "./hooks/useStrings"
|
|
|
|
import Alert from "./components/base/Alert"
|
2021-05-25 02:28:51 +00:00
|
|
|
import PageRepositoryAlertsCreate from "./routes/PageRepositoryAlertsCreate"
|
2021-04-26 20:08:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
export default function PageSwitcher({ ...props }) {
|
2021-05-25 02:06:14 +00:00
|
|
|
const strings = useStrings()
|
|
|
|
|
2021-04-26 20:08:52 +00:00
|
|
|
return (
|
|
|
|
<Switch {...props}>
|
2021-05-24 03:02:07 +00:00
|
|
|
<Route path={"/repositories/create"} exact={true}>
|
|
|
|
<PageRepositoryCreate/>
|
|
|
|
</Route>
|
2021-05-25 02:28:51 +00:00
|
|
|
<Route path={"/repositories/:id/alerts/create"} exact={true}>
|
|
|
|
<PageRepositoryAlertsCreate/>
|
|
|
|
</Route>
|
2021-05-24 01:42:30 +00:00
|
|
|
<Route path={"/repositories/:id/alerts"} exact={true}>
|
2021-05-24 01:51:14 +00:00
|
|
|
<PageRepositoryAlerts/>
|
2021-05-24 01:42:30 +00:00
|
|
|
</Route>
|
2021-05-23 14:32:28 +00:00
|
|
|
<Route path={"/repositories/:id/share"} exact={true}>
|
|
|
|
<PageShare/>
|
|
|
|
</Route>
|
2021-05-11 21:27:42 +00:00
|
|
|
<Route path={"/repositories/:id/edit"} exact={true}>
|
2021-05-24 01:51:14 +00:00
|
|
|
<PageRepositoryEdit/>
|
2021-05-11 21:27:42 +00:00
|
|
|
</Route>
|
2021-05-15 16:05:13 +00:00
|
|
|
<Route path={"/repositories/:id"} exact={true}>
|
2021-05-24 01:51:14 +00:00
|
|
|
<PageRepositoryAnalyze/>
|
2021-04-26 20:08:52 +00:00
|
|
|
</Route>
|
2021-05-11 21:27:42 +00:00
|
|
|
<Route path={"/users"} exact={true}>
|
|
|
|
<PageUsers/>
|
2021-05-10 13:22:07 +00:00
|
|
|
</Route>
|
2021-04-26 20:08:52 +00:00
|
|
|
<Route path={"/repositories"} exact={true}>
|
2021-05-24 01:51:14 +00:00
|
|
|
<PageRepositoriesList/>
|
2021-04-26 20:08:52 +00:00
|
|
|
</Route>
|
|
|
|
<Route path={"/settings"} exact={true}>
|
|
|
|
<PageSettings/>
|
|
|
|
</Route>
|
2021-05-25 02:06:14 +00:00
|
|
|
<Route path={"/"} exact={true}>
|
2021-05-24 01:51:14 +00:00
|
|
|
<PageLogin/>
|
2021-04-26 20:08:52 +00:00
|
|
|
</Route>
|
2021-05-25 02:06:14 +00:00
|
|
|
<Route>
|
|
|
|
<Alert color={"Red"}>{makeIcon(faQuestionCircle)} {strings.errorPageNotFound}</Alert>
|
|
|
|
</Route>
|
2021-04-26 20:08:52 +00:00
|
|
|
</Switch>
|
|
|
|
)
|
|
|
|
}
|