All files / app/features/dashboard Dashboard.tsx

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

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                                                                                                                                                                 
import { Box, Grid } from "@mui/material";
import Divider from "components/Divider";
import HtmlMeta from "components/HtmlMeta";
import PageContainer from "components/PageContainer";
import PageTitle from "components/PageTitle";
import { useTranslation } from "i18n";
import { DASHBOARD, GLOBAL } from "i18n/namespaces";
import { theme } from "theme";
 
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 = process.env.NODE_ENV !== "production";
 
  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>
 
            <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>
    </>
  );
}