Upgrade deps and build fixes

This commit is contained in:
Darren Clarke 2023-07-23 11:21:39 +02:00
parent 38d3e9349c
commit c99972a95b
19 changed files with 757 additions and 284 deletions

View file

@ -65,8 +65,8 @@ export const GettingStartedDialog: FC = () => {
const router = useRouter();
const [completedItems, setCompletedItems] = useState([] as any[]);
const searchParams = useSearchParams();
const pathname = usePathname();
const open = searchParams.get("tooltip")?.toString() === "checklist";
const pathname = usePathname() ?? "";
const open = searchParams?.get("tooltip")?.toString() === "checklist";
const toggleCompletedItem = (item: any) => {
if (completedItems.includes(item)) {
setCompletedItems(completedItems.filter((i) => i !== item));
@ -94,7 +94,7 @@ export const GettingStartedDialog: FC = () => {
<Box sx={{ ...h4, mb: 3 }}>{t("getStartedChecklist")}</Box>
</Grid>
<Grid item>
<IconButton onClick={() => router.push(pathname)}>
<IconButton onClick={() => router.push(pathname ?? "")}>
<CloseIcon sx={{ color: almostBlack, fontSize: "18px" }} />
</IconButton>
</Grid>

View file

@ -8,7 +8,7 @@ import { useAppContext } from "./AppProvider";
export const HelpButton: FC = () => {
const router = useRouter();
const pathname = usePathname();
const pathname = usePathname() ?? "";
const [helpActive, setHelpActive] = useState(false);
const {
colors: { leafcutterElectricBlue },

View file

@ -18,7 +18,7 @@ type HomeProps = {
export const Home: FC<HomeProps> = ({ visualizations }) => {
const router = useRouter();
const pathname = usePathname();
const pathname = usePathname() ?? "";
const cookieName = "homeIntroComplete";
const [cookies, setCookie] = useCookies([cookieName]);
const t = useTranslate();

View file

@ -101,8 +101,8 @@ interface SidebarProps {
export const Sidebar: FC<SidebarProps> = ({ open }) => {
const t = useTranslate();
const pathname = usePathname();
const section = pathname.split("/")[1];
const pathname = usePathname() ?? "";
const section = pathname?.split("/")[1];
const {
colors: { white }, // leafcutterElectricBlue, leafcutterLightBlue,
} = useAppContext();

View file

@ -40,9 +40,9 @@ export const Tooltip: FC<TooltipProps> = ({
colors: { white, leafcutterElectricBlue, almostBlack },
} = useAppContext();
const router = useRouter();
const pathname = usePathname();
const pathname = usePathname() ?? "";
const searchParams = useSearchParams();
const activeTooltip = searchParams.get('tooltip')?.toString();
const activeTooltip = searchParams?.get("tooltip")?.toString();
const open = activeTooltip === tooltipID;
const showNavigation = true;

View file

@ -16,7 +16,7 @@ export const WelcomeDialog = () => {
colors: { white, leafcutterElectricBlue },
typography: { h1, h6, p },
} = useAppContext();
const activeTooltip = searchParams.get('tooltip')?.toString();
const activeTooltip = searchParams?.get("tooltip")?.toString();
const open = activeTooltip === "welcome";
return (