Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dossier): tabs #11

Merged
merged 3 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 28 additions & 85 deletions app/dossiers/dossier/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,107 +2,50 @@

import React from "react";

import AdditionalInfoCard from "@/components/folders/AdditionalInfoCard";
import CommiteeCard from "@/components/folders/CommiteeCard";
import Hero from "@/components/folders/HeroSection";
import LegislativeDocumentsCard from "@/components/folders/LegislativeDocumentsCard";
import TextStructureCard from "@/components/folders/TextStructureCard";
import TimelineCard from "@/components/folders/TimelineCard";
import SpeakingTimeCard from "@/components/folders/SpeakingTimeCard";

import Box from "@mui/material/Box";
import Container from "@mui/material/Container";
import Stack from "@mui/material/Stack";
import Tabs from "@mui/material/Tabs";
import Tab from "@mui/material/Tab";
import Tabs from "@mui/material/Tabs";

import Hero from "@/components/folders/HeroSection";
import PreviewTab from "@/components/folders/PreviewTab";

interface TabPanelProps {
children?: React.ReactNode;
index: number;
value: number;
}

export default function Dossier() {
const tabNumber = 0;
const [tabNumber, setTabNumber] = React.useState(0);

return (
<React.Fragment>
<Hero />
<Box
mb={2}
display="flex"
justifyContent="center"
sx={{ borderBottom: 1, borderColor: "divider" }}
sx={{
display: "flex",
justifyContent: "center",
borderBottom: 1,
borderColor: "divider",
mb: 3,
}}
>
<Tabs
value={"value"}
onChange={() => console.log("Should set selected tab value")}
aria-label="basic tabs example"
value={tabNumber}
variant="scrollable"
onChange={(_e, newValue) => setTabNumber(newValue)}
>
<Tab
label={"Aperçu"}
sx={{
color: "grey.900",
fontWeight: "fontWeightRegular",
borderBottom: "2px solid #000000",
}}
/>
<Tab
label={"Débats"}
disabled
sx={{
color: "grey.900",
fontWeight: "fontWeightRegular",
}}
/>
<Tab
label={"Amendements"}
disabled
sx={{
color: "grey.900",
fontWeight: "fontWeightRegular",
}}
/>
<Tab
label={"Votes"}
disabled
sx={{
color: "grey.900",
fontWeight: "fontWeightRegular",
}}
/>
<Tab label="Aperçu" />
<Tab label="Débats" />
<Tab label="Amendements" />
<Tab label="Votes" />
</Tabs>
</Box>

<div
role="tabpanel"
hidden={tabNumber !== 0}
id="preview"
aria-labelledby="aperçu"
>
{tabNumber === 0 && (
<Container
maxWidth="lg"
sx={{
pb: 2,
px: 2,
display: "flex",
flexDirection: {
xs: "column-reverse",
md: "row",
},
gap: 5,
flexWrap: "wrap-reverse",
}}
>
<Stack spacing={3} flex={2}>
<CommiteeCard />
<AdditionalInfoCard />
<LegislativeDocumentsCard />
</Stack>
<Stack spacing={3} flex={5}>
<SpeakingTimeCard />
<TimelineCard />
<TextStructureCard />
</Stack>
</Container>
)}
</div>
{tabNumber === 0 && <PreviewTab />}
{tabNumber === 1 && <p>Débats</p>}
{tabNumber === 2 && <p>Amendements</p>}
{tabNumber === 3 && <p>Votes</p>}
</React.Fragment>
);
}
20 changes: 19 additions & 1 deletion components/ThemeRegistry/theme.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Raleway } from "next/font/google";
import { createTheme } from "@mui/material/styles";
import { buttonClasses } from "@mui/material/Button";

const raleway = Raleway({
weight: ["400", "600", "700"],
Expand Down Expand Up @@ -71,6 +70,25 @@ const theme = createTheme({
}),
},
},
MuiTabs: {
styleOverrides: {
indicator: {
height: 2,
backgroundColor: "#171B1E",
},
},
},
MuiTab: {
styleOverrides: {
root: {
fontWeight: 600,
color: "#171B1E",
"&.Mui-selected": {
color: "#171B1E",
},
},
},
},
},
});

Expand Down
41 changes: 41 additions & 0 deletions components/folders/PreviewTab/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React from "react";

import AdditionalInfoCard from "@/components/folders/AdditionalInfoCard";
import CommiteeCard from "@/components/folders/CommiteeCard";
import LegislativeDocumentsCard from "@/components/folders/LegislativeDocumentsCard";
import TextStructureCard from "@/components/folders/TextStructureCard";
import TimelineCard from "@/components/folders/TimelineCard";
import SpeakingTimeCard from "@/components/folders/SpeakingTimeCard";

import Container from "@mui/material/Container";
import Stack from "@mui/material/Stack";

export default function PreviewTab() {
return (
<Container
maxWidth="lg"
sx={{
pb: 2,
px: 2,
display: "flex",
flexDirection: {
xs: "column-reverse",
md: "row",
},
gap: 5,
flexWrap: "wrap-reverse",
}}
>
<Stack spacing={3} flex={2}>
<CommiteeCard />
<AdditionalInfoCard />
<LegislativeDocumentsCard />
</Stack>
<Stack spacing={3} flex={5}>
<SpeakingTimeCard />
<TimelineCard />
<TextStructureCard />
</Stack>
</Container>
);
}