Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfauquette committed Mar 2, 2024
1 parent e13ea5b commit 928b679
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions components/folders/VotesTab/DeputeCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ type DeputeCardProps = {
fullName: string;
shortName: string;
};
vote?: "pour" | "contre" | "nonVotant" | "abstension";
groupPosition?: "pour" | "contre" | "abstension";
vote?: "pour" | "contre" | "nonVotant" | "abstention";
groupPosition?: "pour" | "contre" | "abstention";
};

export default function DeputeCard(props: DeputeCardProps) {
Expand Down
8 changes: 4 additions & 4 deletions components/folders/VotesTab/VotesDeputes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export function VotesDeputes({ votes }: { votes: Vote[] }) {
() => votes.filter((vote) => vote.positionVote === "contre"),
[votes]
);
const votesAbstension = React.useMemo(
() => votes.filter((vote) => vote.positionVote === "abstension"),
const votesabstention = React.useMemo(
() => votes.filter((vote) => vote.positionVote === "abstention"),
[votes]
);

Expand All @@ -41,8 +41,8 @@ export function VotesDeputes({ votes }: { votes: Vote[] }) {
},
{
color: "gray",
label: "abstension",
votes: votesAbstension,
label: "abstention",
votes: votesabstention,
},
].map(({ color, label, votes: innerVotes }) => (
<React.Fragment key={label}>
Expand Down
10 changes: 5 additions & 5 deletions components/folders/VotesTab/VotesGroups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type GroupInfo = {
groupId: string;
pour: number;
contre: number;
abstension: number;
abstention: number;
nonVotant: number;
fullName: string;
shortName: string;
Expand All @@ -33,7 +33,7 @@ export function VotesGroups({ votes }: { votes: Vote[] }) {
groups[vote.organe_uid] = {
pour: 0,
contre: 0,
abstension: 0,
abstention: 0,
nonVotant: 0,
fullName: vote.group_libelle,
shortName: vote.group_libelle_short,
Expand All @@ -43,7 +43,7 @@ export function VotesGroups({ votes }: { votes: Vote[] }) {
}

groups[vote.organe_uid][
vote.positionVote as "contre" | "pour" | "nonVotant" | "abstension"
vote.positionVote as "contre" | "pour" | "nonVotant" | "abstention"
] += 1;
groups[vote.organe_uid].votes.push(vote);
});
Expand All @@ -60,7 +60,7 @@ export function VotesGroups({ votes }: { votes: Vote[] }) {
groupId,
pour,
contre,
abstension,
abstention,
fullName,
shortName,
color,
Expand Down Expand Up @@ -98,7 +98,7 @@ export function VotesGroups({ votes }: { votes: Vote[] }) {
</Typography>
<CircleDiv color="gray" />
<Typography sx={{ color: "gray", minWidth: 30 }}>
{abstension}
{abstention}
</Typography>
</Stack>
</AccordionSummary>
Expand Down
11 changes: 6 additions & 5 deletions components/folders/VotesTab/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
Typography,
} from "@mui/material";

type VoteOption = "pour" | "contre" | "nonVotant" | "abstension";
type VoteOption = "pour" | "contre" | "nonVotant" | "abstention";

type VoteProps = {
votes: Vote[];
Expand All @@ -33,7 +33,7 @@ export default function VotesTab({ votes, acts }: VoteProps) {
pour: number;
contre: number;
nonVotant: number;
abstension: number;
abstention: number;
}
> = {};
votes.forEach((vote) => {
Expand All @@ -43,7 +43,7 @@ export default function VotesTab({ votes, acts }: VoteProps) {
pour: 0,
contre: 0,
nonVotant: 0,
abstension: 0,
abstention: 0,
[vote.positionVote]: 1,
};
return;
Expand All @@ -67,6 +67,7 @@ export default function VotesTab({ votes, acts }: VoteProps) {
const act = actsWithVote[actIndex];
const voteSolenel = votesPerAct[act.uid];

console.log(voteSolenel);
return (
<Box sx={{ p: 2 }}>
<Stack direction="row" justifyContent="space-between" sx={{ my: 2 }}>
Expand Down Expand Up @@ -123,7 +124,7 @@ export default function VotesTab({ votes, acts }: VoteProps) {
sx={{ backgroundColor: "red", flexGrow: voteSolenel.contre }}
/>
<Box
sx={{ backgroundColor: "gray", flexGrow: voteSolenel.abstension }}
sx={{ backgroundColor: "gray", flexGrow: voteSolenel.abstention }}
/>
</Box>
</Box>
Expand Down Expand Up @@ -170,7 +171,7 @@ export default function VotesTab({ votes, acts }: VoteProps) {
}}
/>
<Typography sx={{ color: "gray" }}>
{voteSolenel.abstension} Abstension
{voteSolenel.abstention} abstention
</Typography>
</Box>
<Dialog
Expand Down

0 comments on commit 928b679

Please sign in to comment.