diff --git a/apps/leafcutter/app/_components/AppProvider.tsx b/apps/leafcutter/app/_components/AppProvider.tsx
index cc4c879..19b8120 100644
--- a/apps/leafcutter/app/_components/AppProvider.tsx
+++ b/apps/leafcutter/app/_components/AppProvider.tsx
@@ -8,7 +8,7 @@ import {
useState,
PropsWithChildren,
} from "react";
-import { colors, typography } from "styles/theme";
+import { colors, typography } from "@/app/_styles/theme";
const basePath = process.env.GITLAB_CI
? "/link/link-stack/apps/leafcutter"
diff --git a/apps/leafcutter/app/_components/GettingStartedDialog.tsx b/apps/leafcutter/app/_components/GettingStartedDialog.tsx
index c50e4ca..20f688e 100644
--- a/apps/leafcutter/app/_components/GettingStartedDialog.tsx
+++ b/apps/leafcutter/app/_components/GettingStartedDialog.tsx
@@ -3,7 +3,7 @@
import { FC, useState } from "react";
import { Dialog, Box, Grid, Checkbox, IconButton } from "@mui/material";
import { Close as CloseIcon } from "@mui/icons-material";
-import { useRouter } from "next/router";
+import { useRouter, usePathname, useSearchParams } from "next/navigation";
import { useTranslate } from "react-polyglot";
import { useAppContext } from "./AppProvider";
@@ -62,9 +62,11 @@ export const GettingStartedDialog: FC = () => {
typography: { h4 },
} = useAppContext();
const t = useTranslate();
- const [completedItems, setCompletedItems] = useState([] as any[]);
const router = useRouter();
- const open = router.query.tooltip?.toString() === "checklist";
+ const [completedItems, setCompletedItems] = useState([] as any[]);
+ const searchParams = useSearchParams();
+ const pathname = usePathname();
+ const open = searchParams.get("tooltip")?.toString() === "checklist";
const toggleCompletedItem = (item: any) => {
if (completedItems.includes(item)) {
setCompletedItems(completedItems.filter((i) => i !== item));
@@ -92,7 +94,7 @@ export const GettingStartedDialog: FC = () => {
{t("getStartedChecklist")}
- router.push(router.pathname)}>
+ router.push(pathname)}>
diff --git a/apps/leafcutter/app/_components/HelpButton.tsx b/apps/leafcutter/app/_components/HelpButton.tsx
index f4e2bb0..6d279dc 100644
--- a/apps/leafcutter/app/_components/HelpButton.tsx
+++ b/apps/leafcutter/app/_components/HelpButton.tsx
@@ -1,20 +1,21 @@
"use client";
import { FC, useState } from "react";
-import { useRouter } from "next/router";
+import { useRouter, usePathname } from "next/navigation";
import { Button } from "@mui/material";
import { QuestionMark as QuestionMarkIcon } from "@mui/icons-material";
import { useAppContext } from "./AppProvider";
export const HelpButton: FC = () => {
const router = useRouter();
+ const pathname = usePathname();
const [helpActive, setHelpActive] = useState(false);
const {
colors: { leafcutterElectricBlue },
} = useAppContext();
const onClick = () => {
if (helpActive) {
- router.push(router.pathname);
+ router.push(pathname);
} else {
router.push("/?tooltip=welcome");
}
diff --git a/apps/leafcutter/app/_components/Home.tsx b/apps/leafcutter/app/_components/Home.tsx
index 58c9776..806e656 100644
--- a/apps/leafcutter/app/_components/Home.tsx
+++ b/apps/leafcutter/app/_components/Home.tsx
@@ -1,7 +1,7 @@
"use client";
import { useEffect, FC } from "react";
-import { useRouter } from "next/router";
+import { useRouter, usePathname } from "next/navigation";
import Link from "next/link";
import ReactMarkdown from "react-markdown";
import { Grid, Button } from "@mui/material";
@@ -14,11 +14,11 @@ import { useAppContext } from "@/app/_components/AppProvider";
type HomeProps = {
visualizations: any;
- embedded: boolean;
};
-export const Home: FC = ({ visualizations, embedded }) => {
+export const Home: FC = ({ visualizations }) => {
const router = useRouter();
+ const pathname = usePathname();
const cookieName = "homeIntroComplete";
const [cookies, setCookie] = useCookies([cookieName]);
const t = useTranslate();
@@ -31,7 +31,7 @@ export const Home: FC = ({ visualizations, embedded }) => {
useEffect(() => {
if (homeIntroComplete === 0) {
setCookie(cookieName, `${1}`, { path: "/" });
- router.push(`${router.pathname}?tooltip=welcome`);
+ router.push(`${pathname}?tooltip=welcome`);
}
}, [homeIntroComplete, router, setCookie]);
diff --git a/apps/leafcutter/app/_components/LanguageSelect.tsx b/apps/leafcutter/app/_components/LanguageSelect.tsx
index c965b0c..9887691 100644
--- a/apps/leafcutter/app/_components/LanguageSelect.tsx
+++ b/apps/leafcutter/app/_components/LanguageSelect.tsx
@@ -1,6 +1,6 @@
"use client";
-import { useRouter } from "next/router";
+import { useRouter } from "next/navigation";
import { IconButton, Menu, MenuItem, Box } from "@mui/material";
import { KeyboardArrowDown as KeyboardArrowDownIcon } from "@mui/icons-material";
import {
@@ -17,6 +17,7 @@ export const LanguageSelect = () => {
} = useAppContext();
const router = useRouter();
const locales: any = { en: "English", fr: "Français" };
+ const locale = "en";
const popupState = usePopupState({ variant: "popover", popupId: "language" });
return (
@@ -38,7 +39,7 @@ export const LanguageSelect = () => {
},
}}
>
- {locales[router.locale as any] ?? locales.en}
+ {locales[locale as any] ?? locales.en}