Bridge integration

This commit is contained in:
Darren Clarke 2024-05-09 07:42:44 +02:00
parent 42a5e09c94
commit 162390008b
56 changed files with 776 additions and 591 deletions

View file

@ -3,7 +3,6 @@
import { useEffect, FC } from "react";
import { useRouter, usePathname } from "next/navigation";
import Link from "next/link";
import ReactMarkdown from "react-markdown";
import { Grid, Button } from "@mui/material";
import { useTranslate } from "react-polyglot";
import { useCookies } from "react-cookie";
@ -11,13 +10,18 @@ import { Welcome } from "./Welcome";
import { WelcomeDialog } from "./WelcomeDialog";
import { VisualizationCard } from "./VisualizationCard";
import { useLeafcutterContext } from "./LeafcutterProvider";
import { getBasePath } from "../lib/utils";
type HomeProps = {
visualizations: any;
showWelcome?: boolean;
};
export const Home: FC<HomeProps> = ({ visualizations = [], showWelcome = true }) => {
export const Home: FC<HomeProps> = ({
visualizations = [],
showWelcome = true,
}) => {
console.log("Home", visualizations);
const router = useRouter();
const pathname = usePathname() ?? "";
const cookieName = "homeIntroComplete";
@ -45,7 +49,7 @@ export const Home: FC<HomeProps> = ({ visualizations = [], showWelcome = true })
sx={{ pt: "22px", pb: "22px" }}
direction="row-reverse"
>
<Link href={`${process.env.LEAFCUTTER_BASE_PATH ?? ""}/create`} passHref>
<Link href={`${getBasePath()}/create`} passHref>
<Button
sx={{
fontSize: 14,
@ -81,7 +85,11 @@ export const Home: FC<HomeProps> = ({ visualizations = [], showWelcome = true })
justifyContent="center"
>
<Grid item sx={{ ...h4, width: 450, textAlign: "center" }}>
<ReactMarkdown>{t("noSavedVisualizations")}</ReactMarkdown>
{"You dont have any saved visualizations. Go to "}
<Link href={`${getBasePath()}/create`}>Search and Create</Link>
{" or "}
<Link href={`${getBasePath()}/trends`}>Trends</Link>
{" to get started."}
</Grid>
</Grid>
) : null}