Revert "migrate some components to Mui5 new styling system (#72)"

This reverts commit 72ef61e286.
This commit is contained in:
Aria Moradi
2021-11-15 17:21:31 +03:30
parent 0eedbe6626
commit 04a1898ea7
28 changed files with 501 additions and 341 deletions

View File

@@ -6,6 +6,8 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import React, { useState } from 'react';
import makeStyles from '@mui/styles/makeStyles';
import createStyles from '@mui/styles/createStyles';
import Button from '@mui/material/Button';
import DialogTitle from '@mui/material/DialogTitle';
import DialogContent from '@mui/material/DialogContent';
@@ -19,6 +21,13 @@ import ListItem from '@mui/material/ListItem';
import { langCodeToName } from 'util/language';
import cloneObject from 'util/cloneObject';
const useStyles = makeStyles(() => createStyles({
paper: {
maxHeight: 435,
width: '80%',
},
}));
function removeAll(firstList: any[], secondList: any[]) {
secondList.forEach((item) => {
const index = firstList.indexOf(item);
@@ -45,6 +54,7 @@ export default function LangSelect(props: IProps) {
const [mShownLangs, setMShownLangs] = useState(
removeAll(cloneObject(shownLangs), forcedLangs!),
);
const classes = useStyles();
const [open, setOpen] = useState<boolean>(false);
const handleCancel = () => {
@@ -80,17 +90,12 @@ export default function LangSelect(props: IProps) {
<FilterListIcon />
</IconButton>
<Dialog
sx={{
'.MuiDialog-paper': {
maxHeight: 435,
width: '80%',
},
}}
classes={classes}
maxWidth="xs"
open={open}
>
<DialogTitle>Enabled Languages</DialogTitle>
<DialogContent dividers sx={{ padding: 0 }}>
<DialogContent dividers style={{ padding: 0 }}>
<List>
{allLangs.map((lang) => (
<ListItem key={lang}>