All files / app/features/dashboard Dashboard.tsx

0% Statements 0/23
0% Branches 0/1
0% Functions 0/1
0% Lines 0/23

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124                                                                                                                                                                                                                                                       
import { useFeatureValue } from "@growthbook/growthbook-react";
import { Alert, Box, Grid, Typography } from "@mui/material";
import Divider from "components/Divider";
import HtmlMeta from "components/HtmlMeta";
import PageContainer from "components/PageContainer";
import PageTitle from "components/PageTitle";
import StyledLink from "components/StyledLink";
import { useTranslation } from "i18n";
import { DASHBOARD, GLOBAL } from "i18n/namespaces";
import { theme } from "theme";
 
import dashboardNews from "../../dashboardNews.json";
import CommunitiesSection from "./CommunitiesSection";
import CommunityEvents from "./CommunityEvents";
import DashboardMyPublicTrips from "./DashboardMyPublicTrips";
import DashboardUserProfileSummary from "./DashboardUserProfileSummary";
import Hero from "./Hero";
import MyCommunitiesDiscussions from "./MyCommunitiesDiscussions";
import MyEvents from "./MyEvents";
import ReminderCarousel from "./ReminderCarousel";
import UpcomingStays from "./UpcomingStays";
 
export default function Dashboard() {
  const { t } = useTranslation([GLOBAL, DASHBOARD]);
  const isPublicTripsEnabled = useFeatureValue("public_trips_enabled", false);
 
  return (
    <>
      <Hero />
      {/* this view uses a container, instead of it coming from the route layout,
        because the hero section is full viewport width */}
      <PageContainer>
        <Grid container direction="row">
          <Grid size={{ sm: 4, xs: 12 }} sx={{ marginTop: theme.spacing(3) }}>
            <DashboardUserProfileSummary />
          </Grid>
 
          <Grid
            size={{ sm: 8, xs: 12 }}
            sx={{
              [theme.breakpoints.up("sm")]: {
                paddingLeft: theme.spacing(5),
              },
            }}
          >
            <HtmlMeta title={t("global:nav.dashboard")} />
 
            <PageTitle>{t("dashboard:welcome")}</PageTitle>
 
            <Alert
              severity="info"
              sx={{
                marginBottom: theme.spacing(2),
                [theme.breakpoints.down("sm")]: { py: 0.75 },
              }}
            >
              <Typography
                variant="body1"
                sx={{
                  [theme.breakpoints.down("sm")]: { fontSize: "0.8125rem" },
                }}
              >
                New blog post:{" "}
                <StyledLink href={dashboardNews["2026-05-25"].link}>
                  {dashboardNews["2026-05-25"].title}
                </StyledLink>
              </Typography>
            </Alert>
 
            <Alert
              severity="info"
              sx={{
                marginBottom: theme.spacing(2),
                [theme.breakpoints.down("sm")]: { py: 0.75 },
              }}
            >
              <Typography
                variant="body1"
                sx={{
                  [theme.breakpoints.down("sm")]: { fontSize: "0.8125rem" },
                }}
              >
                New blog post:{" "}
                <StyledLink href={dashboardNews["2026-05-15"].link}>
                  {dashboardNews["2026-05-15"].title}
                </StyledLink>
              </Typography>
            </Alert>
 
            <ReminderCarousel />
 
            <Divider spacing={3} />
 
            <UpcomingStays />
 
            <Box sx={{ height: theme.spacing(3) }} />
 
            <MyEvents />
 
            <Box sx={{ height: theme.spacing(3) }} />
 
            <CommunityEvents />
 
            {isPublicTripsEnabled && (
              <>
                <Box sx={{ height: theme.spacing(3) }} />
                <DashboardMyPublicTrips />
              </>
            )}
 
            <Box sx={{ height: theme.spacing(3) }} />
 
            <MyCommunitiesDiscussions />
 
            <Box sx={{ height: theme.spacing(3) }} />
 
            <CommunitiesSection />
          </Grid>
        </Grid>
      </PageContainer>
    </>
  );
}