-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fca4b89
commit 1f132dc
Showing
18 changed files
with
182 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,33 @@ | ||
import { Stack, Typography, Box, Link } from "@mui/material"; | ||
import { Stack, Typography, Box, Card, Button } from "@mui/material"; | ||
import { Link } from "../ui/Link.tsx"; | ||
import { Row } from "../ui/Row.tsx"; | ||
import { PropsWithChildren } from "react"; | ||
import { Link as RouterLink } from "react-router-dom"; | ||
|
||
export function LogoutPage() { | ||
return ( | ||
<> | ||
<Stack | ||
position="relative" | ||
sx={{ | ||
background: "linear-gradient(270deg, #21005D 0%, #9A82DB 0%, #E12358 90%)", | ||
}} | ||
justifyContent="center" | ||
alignItems="center" | ||
minHeight={500} | ||
height="calc(100vh - 230px)" | ||
> | ||
<Typography variant="displaySmall" fontWeight={400} color="white"> | ||
{"Vous avez été deconnecté,"} | ||
</Typography> | ||
<Row spacing={2}> | ||
<Typography variant="displaySmall" fontWeight={400} color="white"> | ||
{"pour revenir sur "} | ||
</Typography> | ||
<Row typography="headlineMedium" gap={0.25} color="red.main" component="span"> | ||
<Box | ||
sx={{ | ||
width: "90vw", | ||
height: "90vh", | ||
display: "flex", | ||
justifyContent: "center", | ||
alignItems: "center", | ||
margin: "auto", | ||
}} | ||
> | ||
<Card sx={{ p: 5, width: "500px" }} elevation={2}> | ||
<Stack gap={5} alignItems={"center"}> | ||
<Row typography="headlineLarge" gap={0.5} color="red.main" component="span"> | ||
<Box component="span" color="black.main" fontWeight={600}> | ||
Platine | ||
</Box> | ||
Gestion | ||
</Row> | ||
, | ||
</Row> | ||
<Typography variant="displaySmall" fontWeight={400} color="white" component={HomeLink}> | ||
{"cliquez ici"} | ||
</Typography> | ||
</Stack> | ||
</> | ||
<Typography variant="headlineLarge">Vous avez été déconnecté.</Typography> | ||
<Button variant="contained" sx={{ py: 1 }} component={Link} to={"/"}> | ||
Se reconnecter | ||
</Button> | ||
</Stack> | ||
</Card> | ||
</Box> | ||
); | ||
} | ||
|
||
const HomeLink = (props: PropsWithChildren) => { | ||
return <Link component={RouterLink} underline="none" to="/" {...props} />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,67 @@ | ||
import FormControl from "@mui/material/FormControl"; | ||
import InputLabel from "@mui/material/InputLabel"; | ||
import MenuItem from "@mui/material/MenuItem"; | ||
import Select from "@mui/material/Select/Select"; | ||
import Autocomplete from "@mui/material/Autocomplete"; | ||
import TextField from "@mui/material/TextField"; | ||
import { QuestioningsBaseType } from "../hooks/useSearchFilter.ts"; | ||
import { SyntheticEvent } from "react"; | ||
import ExpandMoreOutlinedIcon from "@mui/icons-material/ExpandMoreOutlined"; | ||
import CloseIcon from "@mui/icons-material/Close"; | ||
import CheckIcon from "@mui/icons-material/Check"; | ||
import { ListItemText, MenuItem } from "@mui/material"; | ||
|
||
// TODO remove it when get data | ||
const options = [ | ||
{ campaignId: "DVM2024M01", sourceId: "DVM", collect: "2024M01" }, | ||
{ campaignId: "DVM2023M01", sourceId: "DVM", collect: "2023M01" }, | ||
{ campaignId: "DVM2022M01", sourceId: "DVM", collect: "2022M01" }, | ||
{ campaignId: "VPP2024X00", sourceId: "VPP", collect: "2024X00" }, | ||
{ campaignId: "VPP2022M01", sourceId: "VPP", collect: "2022M01" }, | ||
]; | ||
|
||
type Props = { | ||
options: { label: string; value: string }[]; | ||
value?: string; | ||
label: string; | ||
name: string; | ||
questioningFilter: QuestioningsBaseType; | ||
setFilter: (name: "questionings", filter: QuestioningsBaseType) => void; | ||
}; | ||
|
||
export const FilterSelect = ({ options, value, label, name }: Props) => { | ||
const labelId = `label-${label}`; | ||
|
||
export const FilterSelect = ({ label, questioningFilter, setFilter }: Props) => { | ||
const handleChange = ( | ||
_: SyntheticEvent<Element, Event>, | ||
// TODO use endpoint type when get data | ||
newValue: { campaignId: string; sourceId: string; collect: string } | null, | ||
) => { | ||
if (newValue) { | ||
setFilter("questionings", { ...questioningFilter, campaignId: newValue.campaignId }); | ||
} else { | ||
setFilter("questionings", { ...questioningFilter, campaignId: "" }); | ||
} | ||
}; | ||
return ( | ||
<FormControl variant="filled" sx={{ flex: 1 }}> | ||
<InputLabel id={labelId}>{label}</InputLabel> | ||
<Select | ||
IconComponent={props => <ExpandMoreOutlinedIcon {...props} sx={{ color: "text.primary" }} />} | ||
labelId={labelId} | ||
label={label} | ||
name={name} | ||
value={value} | ||
fullWidth | ||
id={`select-${name}`} | ||
displayEmpty | ||
disableUnderline | ||
variant="filled" | ||
> | ||
{options.map(option => { | ||
return ( | ||
<MenuItem value={option.value} key={option.value}> | ||
{option.label} | ||
</MenuItem> | ||
); | ||
})} | ||
</Select> | ||
</FormControl> | ||
<Autocomplete | ||
popupIcon={<ExpandMoreOutlinedIcon />} | ||
clearIcon={<CloseIcon />} | ||
noOptionsText="Aucune collecte trouvée" | ||
options={options.sort((a, b) => a.sourceId.localeCompare(b.sourceId))} | ||
groupBy={option => option.sourceId} | ||
getOptionLabel={option => option.campaignId} | ||
filterOptions={(options, { inputValue }) => | ||
options.filter(option => option.campaignId.toLowerCase().includes(inputValue.toLowerCase())) | ||
} | ||
sx={{ flex: 1 }} | ||
value={options.find(o => o.campaignId === questioningFilter.campaignId) || null} | ||
onChange={handleChange} | ||
renderInput={params => ( | ||
<TextField | ||
variant="filled" | ||
{...params} | ||
label={label} | ||
InputProps={{ ...params.InputProps, disableUnderline: true }} | ||
/> | ||
)} | ||
renderOption={(props, option) => ( | ||
<MenuItem {...props} key={option.campaignId}> | ||
<ListItemText>{option.collect} </ListItemText> | ||
{questioningFilter.campaignId === option.campaignId && <CheckIcon fontSize="small" />} | ||
</MenuItem> | ||
)} | ||
/> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.