Skip to content

Commit

Permalink
fix: add title correct
Browse files Browse the repository at this point in the history
  • Loading branch information
MuhammedKpln committed Jan 31, 2024
1 parent 265bf5a commit 049223f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 20 deletions.
16 changes: 7 additions & 9 deletions src/pages/Home/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import HomeNotesCard from "@/modules/note/home_notes_card.module";
import NewNoteModule from "@/modules/note/new_note.module";
import { useAppStore } from "@/stores/app.store";
import {
IonButton,
IonContent,
Expand All @@ -10,18 +8,18 @@ import {
IonTitle,
IonToolbar,
useIonModal,
useIonRouter,
} from "@ionic/react";
import { addOutline } from "ionicons/icons";
import { useCallback } from "react";
import { lazy, useCallback } from "react";
import styles from "./Home.module.scss";

export default function HomePage() {
const router = useIonRouter();
const s = useAppStore((state) => state.dispatch);
const [showModal, hideModal] = useIonModal(NewNoteModule, {
onDismiss: (data: string, role: string) => hideModal(data, role),
});
const [showModal, hideModal] = useIonModal(
lazy(() => import("@/modules/note/new_note.module")),
{
onDismiss: (data: string, role: string) => hideModal(data, role),
}
);

const onClickAddNote = useCallback(() => {
showModal();
Expand Down
2 changes: 1 addition & 1 deletion src/pages/NoteDetails/NoteDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
IonToolbar,
} from "@ionic/react";

export default function NoteDetails() {
export default function NoteDetailsPage() {
return (
<IonPage>
<IonHeader>
Expand Down
8 changes: 3 additions & 5 deletions src/pages/Profile/ProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,9 @@ export default function ProfilePage() {
<IonPage>
<IonHeader>
<IonToolbar>
<IonButtons slot="start">
<IonTitle>
{`${profile?.firstName} ${profile?.lastName}` ?? "No name"}
</IonTitle>
</IonButtons>
<IonTitle>
{`${profile?.firstName} ${profile?.lastName}` ?? "No name"}
</IonTitle>
<IonButtons slot="end">
<IonButton routerLink={Routes.Settings}>
<IonIcon icon={settingsOutline} />
Expand Down
9 changes: 4 additions & 5 deletions src/routes/tab.route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { useAuthContext } from "@/context/AuthContext";
import ChatsPage from "@/pages/Chats/Chats";
import HomePage from "@/pages/Home/Home";
import ProfilePage from "@/pages/Profile/ProfilePage";
import ScanPage from "@/pages/Scan";
import {
IonFabButton,
IonIcon,
Expand All @@ -18,10 +17,12 @@ import {
personCircleOutline,
qrCodeOutline,
} from "ionicons/icons";
import { useEffect } from "react";
import { lazy, useEffect } from "react";
import { Redirect, Route, useHistory } from "react-router";
import { Routes } from "./routes";

const ScanPage = lazy(() => import("@/pages/Scan"));

export default function TabRoutes() {
const router = useHistory();
const auth = useAuthContext();
Expand All @@ -47,9 +48,7 @@ export default function TabRoutes() {
<Route path={Routes.Notes} exact>
<HomePage />
</Route>
<Route path={Routes.Scan} exact>
<ScanPage />
</Route>
<Route path={Routes.Scan} component={ScanPage} exact />
<Route path={Routes.Chats} exact>
<ChatsPage />
</Route>
Expand Down

0 comments on commit 049223f

Please sign in to comment.