adminFront/src/Components/LoggedIn/ModalUser/index.tsx

115 lines
3.5 KiB
TypeScript
Raw Normal View History

2022-09-12 13:28:56 +00:00
import * as React from "react";
2022-09-17 19:38:19 +00:00
import { useLinkClickHandler } from "react-router-dom";
2022-09-14 10:24:02 +00:00
import { Box, Modal, Fade, Backdrop, Typography } from "@mui/material";
2022-09-21 13:47:45 +00:00
import Tabs from "@mui/material/Tabs";
import Tab from "@mui/material/Tab";
2022-09-20 14:35:49 +00:00
import theme from "../../../theme";
2022-09-12 13:28:56 +00:00
2022-09-17 19:38:19 +00:00
export interface MWProps {
open: boolean
}
2022-09-12 13:28:56 +00:00
const ModalUser = ({open}: MWProps ) => {
2022-09-21 13:47:45 +00:00
const [value, setValue] = React.useState(0);
const handleChange = (event: React.SyntheticEvent, newValue: number) => {
setValue(newValue);
};
2022-09-12 13:28:56 +00:00
return (
<React.Fragment>
2022-09-14 10:24:02 +00:00
<Modal
aria-labelledby="transition-modal-title"
aria-describedby="transition-modal-description"
open={ open }
2022-09-17 19:38:19 +00:00
onClose={ useLinkClickHandler('/users') }
2022-09-14 10:24:02 +00:00
closeAfterTransition
BackdropComponent={Backdrop}
BackdropProps={{
timeout: 500,
}}
>
<Fade in={open}>
2022-09-12 13:28:56 +00:00
<Box sx={{
2022-09-14 10:24:02 +00:00
position: "absolute" as "absolute",
top: "50%",
left: "50%",
transform: "translate(-50%, -50%)",
2022-09-21 13:47:45 +00:00
width: "30%",
height: "30%",
2022-09-14 10:24:02 +00:00
bgcolor: theme.palette.menu.main,
boxShadow: 24,
color: theme.palette.secondary.main,
display: "flex",
flexDirection: "column",
alignItems: "center",
2022-09-12 13:28:56 +00:00
}}>
2022-09-14 10:24:02 +00:00
<Typography id="transition-modal-title" variant="caption">
Пользователь сервиса
2022-09-14 10:24:02 +00:00
</Typography>
2022-09-12 13:28:56 +00:00
<Box sx={{
2022-09-14 10:24:02 +00:00
width: "100%",
2022-09-21 13:47:45 +00:00
marginTop: "50px",
2022-09-14 10:24:02 +00:00
display: "flex"
2022-09-12 13:28:56 +00:00
}}>
2022-09-21 13:47:45 +00:00
<Tabs
orientation="vertical"
variant="scrollable"
value={value}
onChange={handleChange}
aria-label="Vertical tabs example"
sx={{
borderRight: 1,
borderColor: theme.palette.secondary.main,
"& .MuiTab-root.Mui-selected": {
color: theme.palette.secondary.main
}
}}
TabIndicatorProps={{style: {
background: theme.palette.secondary.main
}}}
>
<Tab sx={{
2022-09-14 10:24:02 +00:00
color: theme.palette.grayDisabled.main,
2022-09-21 13:47:45 +00:00
width: "180px",
fontSize: "15px"
}}
label="Пользовательская информация" />
<Tab sx={{
2022-09-14 10:24:02 +00:00
color: theme.palette.grayDisabled.main,
2022-09-21 13:47:45 +00:00
width: "180px",
fontSize: "15px"
}}
label="История транзакций" />
</Tabs>
{ value == 0 && (
<Box sx={{ marginLeft: "20px" }}>
<Typography>Id: 1</Typography>
<Typography>Email: 2</Typography>
<Typography>Номер телефона: 3</Typography>
</Box>
) }
{ value == 1 && (
<Box sx={{ marginLeft: "20px" }}>
<Typography>Дата/время</Typography>
<Typography>Сумма</Typography>
<Typography>Id long</Typography>
<Typography>Статус платежа</Typography>
</Box>
) }
2022-09-12 13:28:56 +00:00
</Box>
</Box>
2022-09-14 10:24:02 +00:00
</Fade>
</Modal>
2022-09-12 13:28:56 +00:00
</React.Fragment>
);
}
2022-09-13 16:16:57 +00:00
export default ModalUser;