This repository has been archived by the owner on Aug 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8581179
commit f9454ea
Showing
7 changed files
with
118 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Redirect, Route } from "react-router-dom"; | ||
import { IonRouterOutlet, IonTabs, IonTabBar, IonTabButton, IonLabel } from "@ionic/react"; | ||
import { Icons } from "@trashtrack/ui"; | ||
|
||
import OperatorDashboard from "../pages/operator/dashboard"; | ||
import OperatorTrashbinDisplay from "../pages/operator/trash-bin/display"; | ||
import OperatorUserDisplay from "../pages/operator/user/display"; | ||
|
||
const OperatorTabs: React.FC = () => { | ||
return ( | ||
<IonTabs> | ||
<IonRouterOutlet animated={false} mode="ios"> | ||
<Route path="/operator/tabs/dashboard" render={() => <OperatorDashboard />} exact={true} /> | ||
<Route path="/operator/tabs/trash-bin" render={() => <OperatorTrashbinDisplay />} exact={true} /> | ||
<Route path="/operator/tabs/user" render={() => <OperatorUserDisplay />} exact={true} /> | ||
<Route path="/operator/tabs" render={() => <Redirect to="/operator/tabs/dashboard" />} exact={true} /> | ||
</IonRouterOutlet> | ||
<IonTabBar slot="bottom" mode="ios" translucent className="pb-4"> | ||
<IonTabButton tab="tab1" href="/operator/tabs/dashboard"> | ||
<Icons.dashboard strokeWidth={1} className="pt-2 w-[32px] h-[30px]" /> | ||
<IonLabel className="pt-2">Dashboard</IonLabel> | ||
</IonTabButton> | ||
<IonTabButton tab="tab2" href="/operator/tabs/trash-bin"> | ||
<Icons.trash strokeWidth={1} className="pt-2 w-[32px] h-[30px]" /> | ||
<IonLabel className="pt-2">Trashbin</IonLabel> | ||
</IonTabButton> | ||
<IonTabButton tab="tab3" href="/operator/tabs/user"> | ||
<Icons.user strokeWidth={1} className="pt-2 w-[32px] h-[30px]" /> | ||
<IonLabel className="pt-2">User</IonLabel> | ||
</IonTabButton> | ||
</IonTabBar> | ||
</IonTabs> | ||
); | ||
}; | ||
|
||
export default OperatorTabs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { IonContent, IonPage } from "@ionic/react"; | ||
import { Card, CardContent, Button, OperatorContext } from "@trashtrack/ui"; | ||
import { useContext } from "react"; | ||
import { useHistory } from "react-router-dom"; | ||
|
||
export function OperatorTrashbinDisplay() { | ||
const history = useHistory(); | ||
const operator = useContext(OperatorContext); | ||
|
||
return ( | ||
<IonPage> | ||
<IonContent className="operator-trashbin-display ion-padding" fullscreen> | ||
<div className="pt-12"> | ||
<h1 className="font-bold text-left text-xl">TrashTrack</h1> | ||
</div> | ||
<div className="flex flex-col pt-8 gap-4"> | ||
<h1 className="font-bold text-lg">Dashboard Trash-bin, {operator.operator}</h1> | ||
<Card className="flex flex-col mt-8"> | ||
<CardContent className="pt-6"> | ||
<Button className="font-bold text-xs w-full" onClick={() => history.replace("/tabs/home")}> | ||
Kembali | ||
</Button> | ||
</CardContent> | ||
</Card> | ||
</div> | ||
</IonContent> | ||
</IonPage> | ||
); | ||
} | ||
|
||
export default OperatorTrashbinDisplay; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { IonContent, IonPage } from "@ionic/react"; | ||
import { Card, CardContent, Button, OperatorContext } from "@trashtrack/ui"; | ||
import { useContext } from "react"; | ||
import { useHistory } from "react-router-dom"; | ||
|
||
export function OperatorUserDisplay() { | ||
const history = useHistory(); | ||
const operator = useContext(OperatorContext); | ||
|
||
return ( | ||
<IonPage> | ||
<IonContent className="operator-user-display ion-padding" fullscreen> | ||
<div className="pt-12"> | ||
<h1 className="font-bold text-left text-xl">TrashTrack</h1> | ||
</div> | ||
<div className="flex flex-col pt-8 gap-4"> | ||
<h1 className="font-bold text-lg">Dashboard User, {operator.operator}</h1> | ||
<Card className="flex flex-col mt-8"> | ||
<CardContent className="pt-6"> | ||
<Button className="font-bold text-xs w-full" onClick={() => history.replace("/tabs/home")}> | ||
Kembali | ||
</Button> | ||
</CardContent> | ||
</Card> | ||
</div> | ||
</IonContent> | ||
</IonPage> | ||
); | ||
} | ||
|
||
export default OperatorUserDisplay; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters