From 6cee84bbe9f536522058400e6a9518912ddbfe6e Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 16 Feb 2021 09:11:33 -0800 Subject: [PATCH] Fix imports to reduce bundle size. --- .../components/forgot-password-page/index.tsx | 5 ++-- .../components/form/global-error/styled.ts | 2 +- .../src/components/form/input/index.tsx | 2 +- .../components/form/submit-button/index.tsx | 8 +++--- .../layout/form-container/index.tsx | 3 ++- .../src/components/layout/header/index.tsx | 2 +- .../src/components/login-page/index.tsx | 4 ++- .../account-info-dialog/index.tsx | 8 ++++-- .../change-password-dialog/index.tsx | 2 +- .../maps-page/account-menu/index.tsx | 12 +++++++-- .../maps-page/action-chooser/index.tsx | 11 +++++--- .../maps-page/action-chooser/styled.ts | 3 ++- .../action-dispatcher/base-dialog/index.tsx | 3 ++- .../action-dispatcher/base-dialog/style.ts | 6 ++++- .../action-dispatcher/create-dialog/index.tsx | 3 +-- .../duplicate-dialog/index.tsx | 4 +-- .../action-dispatcher/export-dialog/index.tsx | 9 +++++-- .../action-dispatcher/export-dialog/style.ts | 4 ++- .../history-dialog/index.tsx | 11 +++++++- .../action-dispatcher/import-dialog/index.tsx | 6 ++--- .../action-dispatcher/info-dialog/index.tsx | 7 +++-- .../action-dispatcher/info-dialog/style.ts | 4 ++- .../publish-dialog/index.tsx | 14 +++++++--- .../action-dispatcher/publish-dialog/style.ts | 4 ++- .../action-dispatcher/rename-dialog/index.tsx | 2 +- .../components/maps-page/help-menu/index.tsx | 13 +++++++-- .../webapp/src/components/maps-page/index.tsx | 14 +++++++++- .../maps-page/language-menu/index.tsx | 4 +-- .../components/maps-page/maps-list/index.tsx | 27 ++++++++++++------- .../components/maps-page/maps-list/styled.ts | 5 +++- .../webapp/src/components/maps-page/style.ts | 5 ++-- .../components/registration-page/index.tsx | 13 ++++----- .../registration-success-page/index.tsx | 3 ++- 33 files changed, 155 insertions(+), 68 deletions(-) diff --git a/packages/webapp/src/components/forgot-password-page/index.tsx b/packages/webapp/src/components/forgot-password-page/index.tsx index c4c0aed9..610889d4 100644 --- a/packages/webapp/src/components/forgot-password-page/index.tsx +++ b/packages/webapp/src/components/forgot-password-page/index.tsx @@ -12,7 +12,8 @@ import { activeInstance } from '../../redux/clientSlice' import Input from '../form/input' import GlobalError from '../form/global-error' import SubmitButton from '../form/submit-button' -import { Typography } from '@material-ui/core' + +import Typography from '@material-ui/core/Typography' const ForgotPassword = () => { const [email, setEmail] = useState(''); @@ -50,7 +51,7 @@ const ForgotPassword = () => {
setEmail(e.target.value)} error={error}/> + autoComplete="email" onChange={e => setEmail(e.target.value)} error={error} /> diff --git a/packages/webapp/src/components/form/global-error/styled.ts b/packages/webapp/src/components/form/global-error/styled.ts index be0a9562..86e9e468 100644 --- a/packages/webapp/src/components/form/global-error/styled.ts +++ b/packages/webapp/src/components/form/global-error/styled.ts @@ -1,4 +1,4 @@ -import { withStyles } from "@material-ui/core"; +import { withStyles } from "@material-ui/core/styles"; import { Alert } from "@material-ui/lab"; diff --git a/packages/webapp/src/components/form/input/index.tsx b/packages/webapp/src/components/form/input/index.tsx index a162a54f..144b986b 100644 --- a/packages/webapp/src/components/form/input/index.tsx +++ b/packages/webapp/src/components/form/input/index.tsx @@ -1,4 +1,4 @@ -import { TextField } from "@material-ui/core"; +import TextField from "@material-ui/core/TextField"; import React, { ChangeEvent } from "react"; import { ErrorInfo } from "../../../classes/client"; diff --git a/packages/webapp/src/components/form/submit-button/index.tsx b/packages/webapp/src/components/form/submit-button/index.tsx index 29bba6ea..aeaa218d 100644 --- a/packages/webapp/src/components/form/submit-button/index.tsx +++ b/packages/webapp/src/components/form/submit-button/index.tsx @@ -1,5 +1,5 @@ -import { Button } from '@material-ui/core'; -import React, { useState, useEffect } from 'react' +import Button from '@material-ui/core/Button'; +import React, { useState } from 'react' import { useIntl } from 'react-intl' type SubmitButton = { @@ -17,8 +17,8 @@ const SubmitButton = (props: SubmitButton) => { const [value, setValue] = useState(valueTxt); return ( ); diff --git a/packages/webapp/src/components/layout/form-container/index.tsx b/packages/webapp/src/components/layout/form-container/index.tsx index 17710141..169849bc 100644 --- a/packages/webapp/src/components/layout/form-container/index.tsx +++ b/packages/webapp/src/components/layout/form-container/index.tsx @@ -1,4 +1,5 @@ -import { Container, withStyles } from "@material-ui/core"; +import Container from "@material-ui/core/Container"; +import withStyles from "@material-ui/core/styles/withStyles"; const FormContainer = withStyles({ root: { diff --git a/packages/webapp/src/components/layout/header/index.tsx b/packages/webapp/src/components/layout/header/index.tsx index 1bb3dddf..93e47c1d 100644 --- a/packages/webapp/src/components/layout/header/index.tsx +++ b/packages/webapp/src/components/layout/header/index.tsx @@ -3,7 +3,7 @@ import { StyledNav, StyledDiv, Logo } from './styled'; import React from 'react' import { FormattedMessage } from 'react-intl' import { Link } from 'react-router-dom' -import { Button } from '@material-ui/core'; +import Button from '@material-ui/core/Button'; const logo = require('../../../images/logo-small.svg') diff --git a/packages/webapp/src/components/login-page/index.tsx b/packages/webapp/src/components/login-page/index.tsx index 351251e9..61ac361d 100644 --- a/packages/webapp/src/components/login-page/index.tsx +++ b/packages/webapp/src/components/login-page/index.tsx @@ -6,8 +6,10 @@ import Footer from '../layout/footer'; import SubmitButton from '../form/submit-button'; import Input from '../form/input'; import GlobalError from '../form/global-error'; -import { FormControl, Link, Typography } from '@material-ui/core'; import FormContainer from '../layout/form-container'; +import Typography from '@material-ui/core/Typography'; +import FormControl from '@material-ui/core/FormControl'; +import Link from '@material-ui/core/Link'; const ConfigStatusMessage = (props: any) => { diff --git a/packages/webapp/src/components/maps-page/account-menu/account-info-dialog/index.tsx b/packages/webapp/src/components/maps-page/account-menu/account-info-dialog/index.tsx index 8e0f5c37..f4d720bb 100644 --- a/packages/webapp/src/components/maps-page/account-menu/account-info-dialog/index.tsx +++ b/packages/webapp/src/components/maps-page/account-menu/account-info-dialog/index.tsx @@ -1,4 +1,3 @@ -import { FormControl, FormControlLabel, FormGroup, Switch } from "@material-ui/core"; import React, { useEffect } from "react"; import { FormattedMessage, useIntl } from "react-intl"; import { useMutation, useQueryClient } from "react-query"; @@ -7,7 +6,12 @@ import Input from "../../../form/input"; import BaseDialog from "../../action-dispatcher/base-dialog"; import { useSelector } from 'react-redux'; import { activeInstance, fetchAccount } from "../../../../redux/clientSlice"; -import { Alert } from "@material-ui/lab"; + +import Alert from "@material-ui/lab/Alert"; +import FormControl from "@material-ui/core/FormControl"; +import FormControlLabel from "@material-ui/core/FormControlLabel"; +import FormGroup from "@material-ui/core/FormGroup"; +import Switch from "@material-ui/core/Switch"; type AccountInfoDialogProps = { diff --git a/packages/webapp/src/components/maps-page/account-menu/change-password-dialog/index.tsx b/packages/webapp/src/components/maps-page/account-menu/change-password-dialog/index.tsx index debd73bc..c4ad9a82 100644 --- a/packages/webapp/src/components/maps-page/account-menu/change-password-dialog/index.tsx +++ b/packages/webapp/src/components/maps-page/account-menu/change-password-dialog/index.tsx @@ -1,4 +1,4 @@ -import { FormControl } from "@material-ui/core"; +import FormControl from "@material-ui/core/FormControl"; import React from "react"; import { useIntl } from "react-intl"; import { useMutation } from "react-query"; diff --git a/packages/webapp/src/components/maps-page/account-menu/index.tsx b/packages/webapp/src/components/maps-page/account-menu/index.tsx index 5ccef486..5570e126 100644 --- a/packages/webapp/src/components/maps-page/account-menu/index.tsx +++ b/packages/webapp/src/components/maps-page/account-menu/index.tsx @@ -1,10 +1,18 @@ -import { IconButton, Link, ListItemIcon, Menu, MenuItem, Tooltip } from '@material-ui/core'; -import { AccountCircle, ExitToAppOutlined, LockOpenOutlined, SettingsApplicationsOutlined } from '@material-ui/icons'; +import IconButton from "@material-ui/core/IconButton"; +import ListItemIcon from "@material-ui/core/ListItemIcon"; +import Menu from "@material-ui/core/Menu"; +import MenuItem from "@material-ui/core/MenuItem"; +import Tooltip from "@material-ui/core/Tooltip"; +import SettingsApplicationsOutlined from "@material-ui/icons/SettingsApplicationsOutlined"; +import AccountCircle from "@material-ui/icons/AccountCircle"; import React from "react"; import { FormattedMessage } from "react-intl"; import { fetchAccount } from '../../../redux/clientSlice'; import AccountInfoDialog from './account-info-dialog'; import ChangePasswordDialog from './change-password-dialog'; +import LockOpenOutlined from "@material-ui/icons/LockOpenOutlined"; +import Link from "@material-ui/core/Link"; +import ExitToAppOutlined from "@material-ui/icons/ExitToAppOutlined"; type ActionType = 'change-password' | 'account-info' | undefined; const AccountMenu = () => { diff --git a/packages/webapp/src/components/maps-page/action-chooser/index.tsx b/packages/webapp/src/components/maps-page/action-chooser/index.tsx index ef8bd357..5834e490 100644 --- a/packages/webapp/src/components/maps-page/action-chooser/index.tsx +++ b/packages/webapp/src/components/maps-page/action-chooser/index.tsx @@ -1,4 +1,3 @@ -import { Divider, ListItemIcon, Menu, MenuItem } from '@material-ui/core'; import React from 'react'; import DescriptionOutlinedIcon from '@material-ui/icons/DescriptionOutlined'; import FileCopyOutlinedIcon from '@material-ui/icons/FileCopyOutlined'; @@ -9,10 +8,14 @@ import EditOutlinedIcon from '@material-ui/icons/EditOutlined'; import PublicOutlinedIcon from '@material-ui/icons/PublicOutlined'; import PrintOutlinedIcon from '@material-ui/icons/PrintOutlined'; import ShareOutlinedIcon from '@material-ui/icons/ShareOutlined'; -import { FormattedMessage } from 'react-intl'; -import { LabelOutlined } from '@material-ui/icons'; -import { fetchMapById } from '../../../redux/clientSlice'; +import LabelOutlined from '@material-ui/icons/LabelOutlined'; +import { FormattedMessage } from 'react-intl'; +import { fetchMapById } from '../../../redux/clientSlice'; +import Menu from '@material-ui/core/Menu'; +import MenuItem from '@material-ui/core/MenuItem'; +import ListItemIcon from '@material-ui/core/ListItemIcon'; +import Divider from '@material-ui/core/Divider'; export type ActionType = 'open' | 'share' | 'import' | 'delete' | 'info' | 'create' | 'duplicate' | 'export' | 'label' | 'rename' | 'print' | 'info' | 'publish' | 'history' | undefined; interface ActionProps { diff --git a/packages/webapp/src/components/maps-page/action-chooser/styled.ts b/packages/webapp/src/components/maps-page/action-chooser/styled.ts index eb6e252f..e37bc963 100644 --- a/packages/webapp/src/components/maps-page/action-chooser/styled.ts +++ b/packages/webapp/src/components/maps-page/action-chooser/styled.ts @@ -1,4 +1,5 @@ -import { MenuItem, withStyles } from "@material-ui/core"; +import MenuItem from "@material-ui/core/MenuItem"; +import withStyles from "@material-ui/core/styles/withStyles"; export const StyledMenuItem = withStyles({ root: { diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/base-dialog/index.tsx b/packages/webapp/src/components/maps-page/action-dispatcher/base-dialog/index.tsx index eeeef97b..6ba66e7b 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/base-dialog/index.tsx +++ b/packages/webapp/src/components/maps-page/action-dispatcher/base-dialog/index.tsx @@ -1,9 +1,10 @@ import React from "react"; -import { Button, DialogContentText } from "@material-ui/core"; import { FormattedMessage, useIntl } from "react-intl"; import { ErrorInfo } from "../../../../classes/client"; import { StyledDialog, StyledDialogActions, StyledDialogContent, StyledDialogTitle } from "./style"; import GlobalError from "../../../form/global-error"; +import DialogContentText from "@material-ui/core/DialogContentText"; +import Button from "@material-ui/core/Button"; export type DialogProps = { onClose: () => void; diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/base-dialog/style.ts b/packages/webapp/src/components/maps-page/action-dispatcher/base-dialog/style.ts index b62ad95c..3a39aaab 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/base-dialog/style.ts +++ b/packages/webapp/src/components/maps-page/action-dispatcher/base-dialog/style.ts @@ -1,4 +1,8 @@ -import { Dialog, DialogActions, DialogContent, DialogTitle, withStyles } from "@material-ui/core"; +import Dialog from "@material-ui/core/Dialog"; +import DialogActions from "@material-ui/core/DialogActions"; +import DialogContent from "@material-ui/core/DialogContent"; +import DialogTitle from "@material-ui/core/DialogTitle"; +import withStyles from "@material-ui/core/styles/withStyles"; export const StyledDialogContent = withStyles({ root: { diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/create-dialog/index.tsx b/packages/webapp/src/components/maps-page/action-dispatcher/create-dialog/index.tsx index 680d4b41..60cd5d41 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/create-dialog/index.tsx +++ b/packages/webapp/src/components/maps-page/action-dispatcher/create-dialog/index.tsx @@ -2,8 +2,7 @@ import React from 'react'; import { useIntl } from 'react-intl'; import { useMutation } from 'react-query'; import { useSelector } from 'react-redux'; -import { FormControl } from '@material-ui/core'; - +import FormControl from '@material-ui/core/FormControl'; import Client, { BasicMapInfo, ErrorInfo } from '../../../../classes/client'; import { activeInstance } from '../../../../redux/clientSlice'; diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/duplicate-dialog/index.tsx b/packages/webapp/src/components/maps-page/action-dispatcher/duplicate-dialog/index.tsx index 601ae74c..a89153a4 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/duplicate-dialog/index.tsx +++ b/packages/webapp/src/components/maps-page/action-dispatcher/duplicate-dialog/index.tsx @@ -1,7 +1,7 @@ import React, { useEffect } from "react"; import { useIntl } from "react-intl"; -import { useMutation, useQueryClient } from "react-query"; -import { FormControl } from "@material-ui/core"; +import { useMutation } from "react-query"; +import FormControl from "@material-ui/core/FormControl"; import { useSelector } from "react-redux"; import Client, { BasicMapInfo, ErrorInfo } from "../../../../classes/client"; diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/export-dialog/index.tsx b/packages/webapp/src/components/maps-page/action-dispatcher/export-dialog/index.tsx index a837398b..577608be 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/export-dialog/index.tsx +++ b/packages/webapp/src/components/maps-page/action-dispatcher/export-dialog/index.tsx @@ -1,10 +1,15 @@ import React, { useEffect } from "react"; import { FormattedMessage, useIntl } from "react-intl"; import BaseDialog from "../base-dialog"; -import { FormControl, FormControlLabel, MenuItem, Radio, RadioGroup, Select } from "@material-ui/core"; import { useStyles } from './style'; -import { Alert } from "@material-ui/lab"; +import Alert from "@material-ui/lab/Alert"; import { fetchMapById } from "../../../../redux/clientSlice"; +import FormControl from "@material-ui/core/FormControl"; +import RadioGroup from "@material-ui/core/RadioGroup"; +import FormControlLabel from "@material-ui/core/FormControlLabel"; +import Radio from "@material-ui/core/Radio"; +import Select from "@material-ui/core/Select"; +import MenuItem from "@material-ui/core/MenuItem"; type ExportFormat = 'pdf' | 'svg' | 'jpg' | 'png' | 'txt' | 'mm' | 'wxml' | 'xls' | 'txt'; type ExportGroup = 'image' | 'document' | 'mindmap-tool'; diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/export-dialog/style.ts b/packages/webapp/src/components/maps-page/action-dispatcher/export-dialog/style.ts index 03d72fcc..8a283df3 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/export-dialog/style.ts +++ b/packages/webapp/src/components/maps-page/action-dispatcher/export-dialog/style.ts @@ -1,4 +1,6 @@ -import { createStyles, makeStyles, Theme } from "@material-ui/core"; +import { Theme } from "@material-ui/core/styles/createMuiTheme"; +import createStyles from "@material-ui/core/styles/createStyles"; +import makeStyles from "@material-ui/core/styles/makeStyles"; export const useStyles = makeStyles((theme: Theme) => createStyles({ diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/history-dialog/index.tsx b/packages/webapp/src/components/maps-page/action-dispatcher/history-dialog/index.tsx index 1bc7f291..07c7ff42 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/history-dialog/index.tsx +++ b/packages/webapp/src/components/maps-page/action-dispatcher/history-dialog/index.tsx @@ -6,9 +6,18 @@ import Client, { ChangeHistory } from "../../../../classes/client"; import { activeInstance } from '../../../../redux/clientSlice'; import { SimpleDialogProps } from ".."; import BaseDialog from "../base-dialog"; -import { Link, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Tooltip } from "@material-ui/core"; import moment from "moment"; +import TableContainer from "@material-ui/core/TableContainer"; +import Table from "@material-ui/core/Table"; +import TableRow from "@material-ui/core/TableRow"; +import TableCell from "@material-ui/core/TableCell"; +import TableHead from "@material-ui/core/TableHead"; +import TableBody from "@material-ui/core/TableBody"; +import Tooltip from "@material-ui/core/Tooltip"; +import Link from "@material-ui/core/Link"; +import Paper from "@material-ui/core/Paper"; + const HistoryDialog = ({ mapId, onClose }: SimpleDialogProps) => { const intl = useIntl(); diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/import-dialog/index.tsx b/packages/webapp/src/components/maps-page/action-dispatcher/import-dialog/index.tsx index 9e9371df..4087b7ae 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/import-dialog/index.tsx +++ b/packages/webapp/src/components/maps-page/action-dispatcher/import-dialog/index.tsx @@ -1,10 +1,10 @@ +import Button from '@material-ui/core/Button'; +import FormControl from '@material-ui/core/FormControl'; import React from 'react'; + import { FormattedMessage, useIntl } from 'react-intl'; import { useMutation } from 'react-query'; import { useSelector } from 'react-redux'; -import { Button, FormControl } from '@material-ui/core'; - - import Client, { ErrorInfo } from '../../../../classes/client'; import { activeInstance } from '../../../../redux/clientSlice'; import Input from '../../../form/input'; diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/info-dialog/index.tsx b/packages/webapp/src/components/maps-page/action-dispatcher/info-dialog/index.tsx index 54b41061..f58f9e79 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/info-dialog/index.tsx +++ b/packages/webapp/src/components/maps-page/action-dispatcher/info-dialog/index.tsx @@ -1,7 +1,5 @@ import React from 'react'; import { FormattedMessage, useIntl } from 'react-intl'; -import { Card, List, ListItem, Paper, Typography } from '@material-ui/core'; - import { ErrorInfo } from '../../../../classes/client'; import BaseDialog from '../base-dialog'; @@ -9,6 +7,11 @@ import { SimpleDialogProps } from '..'; import { useStyles } from './style'; import moment from 'moment'; import { fetchMapById } from '../../../../redux/clientSlice'; +import Paper from '@material-ui/core/Paper'; +import Card from '@material-ui/core/Card'; +import ListItem from '@material-ui/core/ListItem'; +import Typography from '@material-ui/core/Typography'; +import List from '@material-ui/core/List'; const InfoDialog = ({ mapId, onClose }: SimpleDialogProps) => { const { map } = fetchMapById(mapId); diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/info-dialog/style.ts b/packages/webapp/src/components/maps-page/action-dispatcher/info-dialog/style.ts index b02a44c4..f5e85812 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/info-dialog/style.ts +++ b/packages/webapp/src/components/maps-page/action-dispatcher/info-dialog/style.ts @@ -1,4 +1,6 @@ -import { createStyles, makeStyles, Theme } from "@material-ui/core"; +import { Theme } from "@material-ui/core/styles/createMuiTheme"; +import createStyles from "@material-ui/core/styles/createStyles"; +import makeStyles from "@material-ui/core/styles/makeStyles"; export const useStyles = makeStyles((theme: Theme) => createStyles({ diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/publish-dialog/index.tsx b/packages/webapp/src/components/maps-page/action-dispatcher/publish-dialog/index.tsx index b93e48fe..a1191832 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/publish-dialog/index.tsx +++ b/packages/webapp/src/components/maps-page/action-dispatcher/publish-dialog/index.tsx @@ -2,15 +2,21 @@ import React from 'react'; import { FormattedMessage, useIntl } from 'react-intl'; import { useMutation, useQueryClient } from 'react-query'; import { useSelector } from 'react-redux'; -import { AppBar, Checkbox, FormControl, FormControlLabel, Tab, TextareaAutosize, Typography } from '@material-ui/core'; - - import Client, { ErrorInfo } from '../../../../classes/client'; import { activeInstance, fetchMapById } from '../../../../redux/clientSlice'; import BaseDialog from '../base-dialog'; -import { TabContext, TabList, TabPanel } from '@material-ui/lab'; import { handleOnMutationSuccess, SimpleDialogProps } from '..'; import { useStyles } from './style'; +import FormControl from '@material-ui/core/FormControl'; +import FormControlLabel from '@material-ui/core/FormControlLabel'; +import Checkbox from '@material-ui/core/Checkbox'; +import TabContext from '@material-ui/lab/TabContext'; +import AppBar from '@material-ui/core/AppBar'; +import TabList from '@material-ui/lab/TabList'; +import Tab from '@material-ui/core/Tab'; +import TabPanel from '@material-ui/lab/TabPanel'; +import Typography from '@material-ui/core/Typography'; +import TextareaAutosize from '@material-ui/core/TextareaAutosize'; const PublishDialog = ({ mapId, onClose }: SimpleDialogProps) => { diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/publish-dialog/style.ts b/packages/webapp/src/components/maps-page/action-dispatcher/publish-dialog/style.ts index 067722d5..5108b275 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/publish-dialog/style.ts +++ b/packages/webapp/src/components/maps-page/action-dispatcher/publish-dialog/style.ts @@ -1,4 +1,6 @@ -import { createStyles, makeStyles, Theme } from "@material-ui/core"; +import { Theme } from "@material-ui/core/styles/createMuiTheme"; +import createStyles from "@material-ui/core/styles/createStyles"; +import makeStyles from "@material-ui/core/styles/makeStyles"; export const useStyles = makeStyles((theme: Theme) => createStyles({ diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/rename-dialog/index.tsx b/packages/webapp/src/components/maps-page/action-dispatcher/rename-dialog/index.tsx index fce07d01..dce915bd 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/rename-dialog/index.tsx +++ b/packages/webapp/src/components/maps-page/action-dispatcher/rename-dialog/index.tsx @@ -6,8 +6,8 @@ import Client, { BasicMapInfo, ErrorInfo } from "../../../../classes/client"; import { activeInstance, fetchMapById } from '../../../../redux/clientSlice'; import { SimpleDialogProps, handleOnMutationSuccess } from ".."; import Input from "../../../form/input"; -import { FormControl } from "@material-ui/core"; import BaseDialog from "../base-dialog"; +import FormControl from "@material-ui/core/FormControl"; export type RenameModel = { id: number; diff --git a/packages/webapp/src/components/maps-page/help-menu/index.tsx b/packages/webapp/src/components/maps-page/help-menu/index.tsx index 3779f244..14dfcded 100644 --- a/packages/webapp/src/components/maps-page/help-menu/index.tsx +++ b/packages/webapp/src/components/maps-page/help-menu/index.tsx @@ -1,8 +1,17 @@ -import { IconButton, Link, ListItemIcon, Menu, MenuItem } from "@material-ui/core"; -import { Help, PolicyOutlined, EmailOutlined, FeedbackOutlined, EmojiPeopleOutlined } from "@material-ui/icons"; import React from "react"; import { FormattedMessage } from "react-intl"; +import Help from "@material-ui/icons/Help"; +import PolicyOutlined from "@material-ui/icons/PolicyOutlined"; +import FeedbackOutlined from "@material-ui/icons/FeedbackOutlined"; +import EmojiPeopleOutlined from "@material-ui/icons/EmailOutlined"; +import EmailOutlined from "@material-ui/icons/EmailOutlined"; +import IconButton from "@material-ui/core/IconButton"; +import Menu from "@material-ui/core/Menu"; +import MenuItem from "@material-ui/core/MenuItem"; +import Link from "@material-ui/core/Link"; +import ListItemIcon from "@material-ui/core/ListItemIcon"; + const HelpMenu = () => { const [anchorEl, setAnchorEl] = React.useState(null); const open = Boolean(anchorEl); diff --git a/packages/webapp/src/components/maps-page/index.tsx b/packages/webapp/src/components/maps-page/index.tsx index 33f4766e..65811b0d 100644 --- a/packages/webapp/src/components/maps-page/index.tsx +++ b/packages/webapp/src/components/maps-page/index.tsx @@ -8,7 +8,6 @@ import IconButton from '@material-ui/core/IconButton'; import ListItem from '@material-ui/core/ListItem'; import ListItemIcon from '@material-ui/core/ListItemIcon'; import { useStyles } from './style'; -import { AddCircleTwoTone, CloudUploadTwoTone, DeleteOutlineTwoTone, LabelTwoTone, PersonOutlineTwoTone, PublicTwoTone, ScatterPlotTwoTone, ShareTwoTone, StarTwoTone } from '@material-ui/icons'; import { Button, Link, ListItemSecondaryAction, ListItemText, Tooltip } from '@material-ui/core'; import { MapsList } from './maps-list'; import { FormattedMessage, IntlProvider, useIntl } from 'react-intl'; @@ -24,6 +23,19 @@ import HelpMenu from './help-menu'; import LanguageMenu from './language-menu'; import AppI18n, { Locales } from '../../classes/app-i18n'; + + +import AddCircleTwoTone from '@material-ui/icons/AddCircleTwoTone'; +import CloudUploadTwoTone from '@material-ui/icons/CloudUploadTwoTone'; +import DeleteOutlineTwoTone from '@material-ui/icons/DeleteOutlineTwoTone'; +import LabelTwoTone from '@material-ui/icons/LabelTwoTone'; +import PersonOutlineTwoTone from '@material-ui/icons/PersonOutlineTwoTone'; +import PublicTwoTone from '@material-ui/icons/PublicTwoTone'; +import ScatterPlotTwoTone from '@material-ui/icons/ScatterPlotTwoTone'; +import ShareTwoTone from '@material-ui/icons/ShareTwoTone'; +import StarTwoTone from '@material-ui/icons/StarTwoTone'; + + const logoIcon = require('../../images/logo-small.svg'); const poweredByIcon = require('../../images/pwrdby-white.svg'); diff --git a/packages/webapp/src/components/maps-page/language-menu/index.tsx b/packages/webapp/src/components/maps-page/language-menu/index.tsx index 90d31e6e..79afe441 100644 --- a/packages/webapp/src/components/maps-page/language-menu/index.tsx +++ b/packages/webapp/src/components/maps-page/language-menu/index.tsx @@ -1,5 +1,5 @@ import { Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, Menu, MenuItem, Tooltip } from '@material-ui/core'; -import { TranslateTwoTone } from '@material-ui/icons'; +import TranslateTwoTone from '@material-ui/icons/TranslateTwoTone'; import React from "react"; import { useMutation, useQueryClient } from "react-query"; import Client from "../../../classes/client"; @@ -94,7 +94,7 @@ const LanguageMenu = () => { {openHelpDialog && setHelpDialogOpen(false)} /> - } + } ); } diff --git a/packages/webapp/src/components/maps-page/maps-list/index.tsx b/packages/webapp/src/components/maps-page/maps-list/index.tsx index 1e30e4df..c09697c7 100644 --- a/packages/webapp/src/components/maps-page/maps-list/index.tsx +++ b/packages/webapp/src/components/maps-page/maps-list/index.tsx @@ -1,5 +1,4 @@ -import React, { useEffect,CSSProperties } from 'react'; -import { useStyles } from './styled'; +import React, { useEffect, CSSProperties } from 'react'; import Table from '@material-ui/core/Table'; import TableBody from '@material-ui/core/TableBody'; @@ -14,8 +13,17 @@ import Paper from '@material-ui/core/Paper'; import Checkbox from '@material-ui/core/Checkbox'; import IconButton from '@material-ui/core/IconButton'; import Tooltip from '@material-ui/core/Tooltip'; -import StarRateRoundedIcon from '@material-ui/icons/StarRateRounded'; +import Button from '@material-ui/core/Button'; +import InputBase from '@material-ui/core/InputBase'; +import Link from '@material-ui/core/Link'; + +import LabelTwoTone from '@material-ui/icons/LabelTwoTone'; +import DeleteOutlined from '@material-ui/icons/DeleteOutlined'; import MoreHorizIcon from '@material-ui/icons/MoreHoriz'; +import StarRateRoundedIcon from '@material-ui/icons/StarRateRounded'; +import SearchIcon from '@material-ui/icons/Search'; + +import { useStyles } from './styled'; import { useSelector } from 'react-redux'; import { activeInstance } from '../../../redux/clientSlice'; import { useMutation, useQuery, useQueryClient } from 'react-query'; @@ -23,12 +31,11 @@ import { ErrorInfo, MapInfo } from '../../../classes/client'; import Client from '../../../classes/client'; import ActionChooser, { ActionType } from '../action-chooser'; import ActionDispatcher from '../action-dispatcher'; -import { Button, InputBase, Link } from '@material-ui/core'; -import SearchIcon from '@material-ui/icons/Search'; import moment from 'moment' import { Filter, LabelFilter } from '..'; import { FormattedMessage, useIntl } from 'react-intl'; -import { DeleteOutlined, LabelTwoTone } from '@material-ui/icons'; + + function descendingComparator(a: T, b: T, orderBy: keyof T) { @@ -316,10 +323,10 @@ export const MapsList = (props: MapsListProps) => { } const handleDeleteClick = () => { - setActiveDialog({ - actionType: 'delete', - mapsId: selected - }); + setActiveDialog({ + actionType: 'delete', + mapsId: selected + }); } const isSelected = (id: number) => selected.indexOf(id) !== -1; diff --git a/packages/webapp/src/components/maps-page/maps-list/styled.ts b/packages/webapp/src/components/maps-page/maps-list/styled.ts index 4f351b92..71f68dd9 100644 --- a/packages/webapp/src/components/maps-page/maps-list/styled.ts +++ b/packages/webapp/src/components/maps-page/maps-list/styled.ts @@ -1,4 +1,7 @@ -import { createStyles, fade, makeStyles, Theme } from '@material-ui/core/styles'; +import { fade } from "@material-ui/core/styles"; +import { Theme } from "@material-ui/core/styles/createMuiTheme"; +import createStyles from "@material-ui/core/styles/createStyles"; +import makeStyles from "@material-ui/core/styles/makeStyles"; export const useStyles = makeStyles((theme: Theme) => createStyles({ diff --git a/packages/webapp/src/components/maps-page/style.ts b/packages/webapp/src/components/maps-page/style.ts index 9cb526ad..8730f416 100644 --- a/packages/webapp/src/components/maps-page/style.ts +++ b/packages/webapp/src/components/maps-page/style.ts @@ -1,5 +1,6 @@ -import { createStyles, ListItemText, Theme, withStyles } from "@material-ui/core"; -import { makeStyles } from "@material-ui/core"; +import { Theme } from "@material-ui/core/styles/createMuiTheme"; +import createStyles from "@material-ui/core/styles/createStyles"; +import makeStyles from "@material-ui/core/styles/makeStyles"; const drawerWidth = 300; diff --git a/packages/webapp/src/components/registration-page/index.tsx b/packages/webapp/src/components/registration-page/index.tsx index c6b15aca..facb5c19 100644 --- a/packages/webapp/src/components/registration-page/index.tsx +++ b/packages/webapp/src/components/registration-page/index.tsx @@ -2,19 +2,20 @@ import React, { useState, useEffect } from 'react'; import { FormattedMessage, useIntl } from 'react-intl'; import ReCAPTCHA from 'react-google-recaptcha'; import { useHistory } from 'react-router-dom'; -import Client , { ErrorInfo} from '../../classes/client'; +import Client, { ErrorInfo } from '../../classes/client'; import FormContainer from '../layout/form-container'; import Header from '../layout/header'; import Footer from '../layout/footer'; -import { FormControl, Typography } from '@material-ui/core'; import { useSelector } from 'react-redux'; import { useMutation } from 'react-query'; import { activeInstance } from '../../redux/clientSlice'; import Input from '../form/input'; import GlobalError from '../form/global-error'; import SubmitButton from '../form/submit-button'; +import Typography from '@material-ui/core/Typography'; +import FormControl from '@material-ui/core/FormControl'; export type Model = { email: string; @@ -72,16 +73,16 @@ const RegistrationForm = () => { + autoComplete="email" error={error} /> + autoComplete="given-name" error={error} /> + autoComplete="family-name" error={error} /> + autoComplete="new-password" error={error} />
{