Skip to content

Instantly share code, notes, and snippets.

@gufakto
Created April 13, 2023 05:02
Show Gist options
  • Save gufakto/a90bf37dadf2d454440958c4a23b7d29 to your computer and use it in GitHub Desktop.
Save gufakto/a90bf37dadf2d454440958c4a23b7d29 to your computer and use it in GitHub Desktop.
import {
BrowserRouter as Router,
Switch,
Route
} from "react-router-dom";
import { ToastProvider } from "react-toast-notifications";
import PublicRoute from "./utils/PublicRoute";
import PrivateRoute from "./utils/PrivateRoute";
import SuperAdminRoute from "./utils/SuperAdminRoute";
import HomePage from "./components/dashboard";
import Login from "./components/auth/login";
import User from "./components/users/list";
import AccessDenied from "./components/denied_access/AccessDenied";
import Logout from "./components/auth/logout";
import UserAdd from "./components/users/userAdd";
import UserEdit from "./components/users/userEdit";
import GalleryPage from "./components/galleries";
import AddGallery from "./components/galleries/add";
import EditGallery from "./components/galleries/edit";
import SayingPage from "./components/sayings";
import EditSayingPage from './components/sayings/edit';
import ParticipantsPage from "./components/invites";
import AddParticipantPage from "./components/invites/add";
import EditParticipantPage from "./components/invites/edit";
import SettingPage from "./components/settings";
import KehadiranPage from "./components/kehadiran/index";
function App() {
return (<ToastProvider placement="bottom-right">
<Router>
<Switch>
<PublicRoute path="/auth" component={Login} />
<PrivateRoute exact path="/" component={HomePage} />
<PrivateRoute exact path="/galleries" component={GalleryPage} />
<PrivateRoute exact path="/add-gallery" component={AddGallery} />
<PrivateRoute exact path="/edit-gallery/:id" component={EditGallery} />
<PrivateRoute exact path="/saying" component={SayingPage} />
<PrivateRoute exact path="/edit-saying/:id" component={EditSayingPage} />
<PrivateRoute exact path="/participant" component={ParticipantsPage} />
<PrivateRoute exact path="/add-participant" component={AddParticipantPage} />
<PrivateRoute exact path="/edit-participant/:id" component={EditParticipantPage} />
<PrivateRoute exact path="/settings" component={SettingPage} />
<PrivateRoute exact path="/kehadiran" component={KehadiranPage} />
<SuperAdminRoute exact path="/add-user" component={UserAdd} />
<SuperAdminRoute exact path="/edit-user/:id" component={UserEdit} />
<SuperAdminRoute exact path="/users" component={User} />
<Route exact path="/logout" component={Logout} />
<Route component={AccessDenied} />
</Switch>
</Router>
</ToastProvider>);
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment