From bb1d403021eabb19f6f13fcea5592d9f08e186e7 Mon Sep 17 00:00:00 2001 From: Nikolai Date: Thu, 13 Oct 2022 12:36:28 +0600 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=BC=D0=BE=D0=BA=D0=BE?= =?UTF-8?q?=D0=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LoggedIn/Content/Promocode/index.tsx | 460 ++++++++++++------ .../Content/Tariffs/DataGridElement/index.tsx | 34 +- .../LoggedIn/Content/Tariffs/index.tsx | 2 +- 3 files changed, 325 insertions(+), 171 deletions(-) diff --git a/src/Components/LoggedIn/Content/Promocode/index.tsx b/src/Components/LoggedIn/Content/Promocode/index.tsx index 757979b..eb05258 100644 --- a/src/Components/LoggedIn/Content/Promocode/index.tsx +++ b/src/Components/LoggedIn/Content/Promocode/index.tsx @@ -1,12 +1,56 @@ import * as React from "react"; import { Box, Typography, TextField, Checkbox, Button } from "@mui/material"; -import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; -import dayjs, { Dayjs } from 'dayjs'; -import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; -import { DesktopDatePicker } from '@mui/x-date-pickers/DesktopDatePicker'; +import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider"; +import dayjs, { Dayjs } from "dayjs"; +import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs"; +import { DesktopDatePicker } from "@mui/x-date-pickers/DesktopDatePicker"; +import Table from "@mui/material/Table"; +import TableBody from "@mui/material/TableBody"; +import TableCell from "@mui/material/TableCell"; +import TableRow from "@mui/material/TableRow"; +import TableContainer from "@mui/material/TableContainer"; +import Paper from "@mui/material/Paper"; +import { DataGrid, GridColDef, GridSelectionModel, GridToolbar } from "@mui/x-data-grid"; +import InputLabel from "@mui/material/InputLabel"; +import MenuItem from "@mui/material/MenuItem"; +import Select, { SelectChangeEvent } from "@mui/material/Select"; import theme from "../../../../theme"; +const columns: GridColDef[] = [ + { + field: "id", + headerName: "ID", + width: 30, + sortable: false, + }, + { + field: "name", + headerName: "Название промокода", + width: 200, + sortable: false, + }, + { + field: "terms", + headerName: "Условия", + width: 210, + sortable: false, + }, + { + field: "time", + headerName: "Срок действия", + type: "number", + width: 110, + sortable: false, + } +]; + +const rows = [ + { id: 1, name: "Промокод 1", terms: "Первое, второе, третье", time: "200 дней" }, + { id: 2, name: "Промокод 2", terms: "Первое, второе, третье", time: "200 дней" }, + { id: 3, name: "Промокод 3", terms: "Первое, второе, третье", time: "200 дней" }, +]; + const Promocode: React.FC = () => { const [value1, setValue1] = React.useState(); const handleChange1 = (newValue: Dayjs | null) => { @@ -18,6 +62,11 @@ const Promocode: React.FC = () => { setValue2(newValue); }; + const [service, setService] = React.useState("Шаблонизатор"); + const handleChange = (event: SelectChangeEvent) => { + setService(event.target.value as string); + }; + return ( @@ -35,164 +84,269 @@ const Promocode: React.FC = () => { ПРОМОКОД - - - Название: - - - GJ58HG6GG - - - - - Условия: - - - Работает, если заплатите 100500 денег - - - - - Дата действия: - - - - С - - } - InputProps={{ sx: { - height: "40px", - color: theme.palette.secondary.main, - border: "1px solid", - borderColor: theme.palette.secondary.main, - "& .MuiSvgIcon-root": { color: theme.palette.secondary.main } - } }} - /> - - по - - } - InputProps={{ sx: { - height: "40px", - color: theme.palette.secondary.main, - border: "1px solid", - borderColor: theme.palette.secondary.main, - "& .MuiSvgIcon-root": { color: theme.palette.secondary.main } - } }} - /> - - - - - + - - + + - Бессрочно + Условия: + + + + + + + + + + + + Работает, если заплатите 100500 денег + + + + + Вы должны будете продать душу дьяволу + + + +
+
+ + + Дата действия: + + + + С + + } + InputProps={{ sx: { + height: "40px", + color: theme.palette.secondary.main, + border: "1px solid", + borderColor: theme.palette.secondary.main, + "& .MuiSvgIcon-root": { color: theme.palette.secondary.main } + } }} + /> + + по + + } + InputProps={{ sx: { + height: "40px", + color: theme.palette.secondary.main, + border: "1px solid", + borderColor: theme.palette.secondary.main, + "& .MuiSvgIcon-root": { color: theme.palette.secondary.main } + } }} + /> + + + + + + + + Бессрочно + + + + + + +
- - + + + console.log("datagrid select") } + /> +
diff --git a/src/Components/LoggedIn/Content/Tariffs/DataGridElement/index.tsx b/src/Components/LoggedIn/Content/Tariffs/DataGridElement/index.tsx index 6e68ec8..2b84732 100644 --- a/src/Components/LoggedIn/Content/Tariffs/DataGridElement/index.tsx +++ b/src/Components/LoggedIn/Content/Tariffs/DataGridElement/index.tsx @@ -4,16 +4,16 @@ import { DataGrid, GridColDef, GridSelectionModel, GridToolbar } from "@mui/x-da import { useDemoData } from "@mui/x-data-grid-generator"; import useStore, { StoreState } from "../../../../../store"; import { ArrayProps } from "../types"; -import List from '@mui/material/List'; -import ListItem from '@mui/material/ListItem'; -import ListItemAvatar from '@mui/material/ListItemAvatar'; -import Avatar from '@mui/material/Avatar'; -import ShoppingCartIcon from '@mui/icons-material/ShoppingCart'; -import ListItemText from '@mui/material/ListItemText'; -import IconButton from '@mui/material/IconButton'; -import DeleteIcon from '@mui/icons-material/Delete'; -import FormControlLabel from '@mui/material/FormControlLabel'; -import Checkbox from '@mui/material/Checkbox'; +import List from "@mui/material/List"; +import ListItem from "@mui/material/ListItem"; +import ListItemAvatar from "@mui/material/ListItemAvatar"; +import Avatar from "@mui/material/Avatar"; +import ShoppingCartIcon from "@mui/icons-material/ShoppingCart"; +import ListItemText from "@mui/material/ListItemText"; +import IconButton from "@mui/material/IconButton"; +import DeleteIcon from "@mui/icons-material/Delete"; +import FormControlLabel from "@mui/material/FormControlLabel"; +import Checkbox from "@mui/material/Checkbox"; import theme from "../../../../../theme"; @@ -68,12 +68,12 @@ const columns: GridColDef[] = [ ]; const rows = [ - { id: 1, name: 'Тариф 1', type: 'tariff', service: 'Шаблонизатор', disk: "100 гб", time: "200 дней", points: "300", price: 100500 }, - { id: 2, name: 'Тариф 2', type: 'tariff', service: 'Шаблонизатор', disk: "100 гб", time: "200 дней", points: "300", price: 100500 }, - { id: 3, name: 'Тариф 3', type: 'tariff', service: 'Шаблонизатор', disk: "100 гб", time: "200 дней", points: "300", price: 100500 }, - { id: 4, name: 'Пакет 1', type: 'package', tariffs: [ - { id: 1, name: 'Тариф 1', type: 'tariff', service: 'Шаблонизатор', disk: "100 гб", time: "200 дней", points: "300", price: 100500 }, - { id: 2, name: 'Тариф 2', type: 'tariff', service: 'Шаблонизатор', disk: "100 гб", time: "200 дней", points: "300", price: 100500 }, + { id: 1, name: "Тариф 1", type: "tariff", service: "Шаблонизатор", disk: "100 гб", time: "200 дней", points: "300", price: 100500 }, + { id: 2, name: "Тариф 2", type: "tariff", service: "Шаблонизатор", disk: "100 гб", time: "200 дней", points: "300", price: 100500 }, + { id: 3, name: "Тариф 3", type: "tariff", service: "Шаблонизатор", disk: "100 гб", time: "200 дней", points: "300", price: 100500 }, + { id: 4, name: "Пакет 1", type: "package", tariffs: [ + { id: 1, name: "Тариф 1", type: "tariff", service: "Шаблонизатор", disk: "100 гб", time: "200 дней", points: "300", price: 100500 }, + { id: 2, name: "Тариф 2", type: "tariff", service: "Шаблонизатор", disk: "100 гб", time: "200 дней", points: "300", price: 100500 }, ] }, ]; @@ -227,7 +227,7 @@ const DataGridElement: React.FC = ({ openModal }) => { checkboxToggle() } /> diff --git a/src/Components/LoggedIn/Content/Tariffs/index.tsx b/src/Components/LoggedIn/Content/Tariffs/index.tsx index 35c46b0..b608b00 100644 --- a/src/Components/LoggedIn/Content/Tariffs/index.tsx +++ b/src/Components/LoggedIn/Content/Tariffs/index.tsx @@ -7,7 +7,7 @@ import DataGridElement from "./DataGridElement"; import ModalMini from "./ModalMini"; import ModalPackage from "./ModalPackage"; import { ArrayProps, Tariff } from "./types"; -import useStore, { StoreState } from "../../../../store"; +import useStore from "../../../../store"; import theme from "../../../../theme";