More app directory refactoring
This commit is contained in:
parent
b312a8c862
commit
8bbeaa25cf
55 changed files with 903 additions and 899 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/* eslint-disable react/require-default-props */
|
||||
import { FC } from "react";
|
||||
import { useRouter } from "next/router";
|
||||
import { useRouter, usePathname, useSearchParams } from "next/navigation";
|
||||
import {
|
||||
Box,
|
||||
Grid,
|
||||
|
|
@ -40,7 +40,9 @@ export const Tooltip: FC<TooltipProps> = ({
|
|||
colors: { white, leafcutterElectricBlue, almostBlack },
|
||||
} = useAppContext();
|
||||
const router = useRouter();
|
||||
const activeTooltip = router.query.tooltip?.toString();
|
||||
const pathname = usePathname();
|
||||
const searchParams = useSearchParams();
|
||||
const activeTooltip = searchParams.get('tooltip')?.toString();
|
||||
const open = activeTooltip === tooltipID;
|
||||
const showNavigation = true;
|
||||
|
||||
|
|
@ -51,7 +53,7 @@ export const Tooltip: FC<TooltipProps> = ({
|
|||
<Grid container direction="column">
|
||||
<Grid item container direction="row-reverse">
|
||||
<Grid item>
|
||||
<IconButton onClick={() => router.push(router.pathname)}>
|
||||
<IconButton onClick={() => router.push(pathname)}>
|
||||
<CloseIcon
|
||||
sx={{
|
||||
color: leafcutterElectricBlue,
|
||||
|
|
@ -125,7 +127,7 @@ export const Tooltip: FC<TooltipProps> = ({
|
|||
color: leafcutterElectricBlue,
|
||||
textTransform: "none",
|
||||
}}
|
||||
onClick={() => router.push(router.pathname)}
|
||||
onClick={() => router.push(pathname)}
|
||||
>
|
||||
{t("done")}
|
||||
</Button>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue