Improve bundle size.

This commit is contained in:
Paulo Gustavo Veiga 2021-02-16 10:05:41 -08:00
parent 6cee84bbe9
commit ef63782a57
7 changed files with 31 additions and 10 deletions

View File

@ -1,4 +1,4 @@
import React, { useState } from 'react'; import React from 'react';
import { IntlProvider } from 'react-intl'; import { IntlProvider } from 'react-intl';
import { Route, Switch, Redirect, BrowserRouter as Router } from 'react-router-dom'; import { Route, Switch, Redirect, BrowserRouter as Router } from 'react-router-dom';
@ -10,10 +10,11 @@ import store from "./redux/store";
import { ForgotPasswordPage } from './components/forgot-password-page'; import { ForgotPasswordPage } from './components/forgot-password-page';
import { Provider } from 'react-redux'; import { Provider } from 'react-redux';
import { QueryClient, QueryClientProvider } from 'react-query'; import { QueryClient, QueryClientProvider } from 'react-query';
import { CssBaseline, ThemeProvider } from '@material-ui/core';
import { theme } from './theme' import { theme } from './theme'
import AppI18n, { Locales } from './classes/app-i18n'; import AppI18n, { Locales } from './classes/app-i18n';
import MapsPage from './components/maps-page'; import MapsPage from './components/maps-page';
import CssBaseline from '@material-ui/core/CssBaseline';
import { ThemeProvider } from '@material-ui/core/styles';
const queryClient = new QueryClient({ const queryClient = new QueryClient({
defaultOptions: { defaultOptions: {

View File

@ -1,9 +1,14 @@
import { useSelector } from 'react-redux'; import { useSelector } from 'react-redux';
import React from "react"; import React from "react";
import { activeInstanceStatus, ClientStatus } from '../../../redux/clientSlice'; import { activeInstanceStatus, ClientStatus } from '../../../redux/clientSlice';
import { Button, Dialog, DialogActions, DialogContent, DialogTitle } from '@material-ui/core';
import { FormattedMessage } from 'react-intl'; import { FormattedMessage } from 'react-intl';
import { Alert, AlertTitle } from '@material-ui/lab'; import Dialog from '@material-ui/core/Dialog';
import DialogTitle from '@material-ui/core/DialogTitle';
import DialogContent from '@material-ui/core/DialogContent';
import Alert from '@material-ui/lab/Alert';
import DialogActions from '@material-ui/core/DialogActions';
import Button from '@material-ui/core/Button';
import AlertTitle from '@material-ui/lab/AlertTitle';
const ClientHealthSentinel = () => { const ClientHealthSentinel = () => {
const status: ClientStatus = useSelector(activeInstanceStatus); const status: ClientStatus = useSelector(activeInstanceStatus);

View File

@ -3,8 +3,9 @@ import { FormattedMessage } from 'react-intl'
import FormContainer from '../layout/form-container'; import FormContainer from '../layout/form-container';
import Header from '../layout/header' import Header from '../layout/header'
import Footer from '../layout/footer' import Footer from '../layout/footer'
import { Button, Typography } from '@material-ui/core';
import { Link as RouterLink} from 'react-router-dom' import { Link as RouterLink} from 'react-router-dom'
import Typography from '@material-ui/core/Typography';
import Button from '@material-ui/core/Button';
const ForgotPasswordSuccessPage = () => { const ForgotPasswordSuccessPage = () => {

View File

@ -7,6 +7,7 @@ import { activeInstance, fetchMapById } from '../../../../redux/clientSlice';
import BaseDialog from '../base-dialog'; import BaseDialog from '../base-dialog';
import { handleOnMutationSuccess, SimpleDialogProps } from '..'; import { handleOnMutationSuccess, SimpleDialogProps } from '..';
import { useStyles } from './style'; import { useStyles } from './style';
import FormControl from '@material-ui/core/FormControl'; import FormControl from '@material-ui/core/FormControl';
import FormControlLabel from '@material-ui/core/FormControlLabel'; import FormControlLabel from '@material-ui/core/FormControlLabel';
import Checkbox from '@material-ui/core/Checkbox'; import Checkbox from '@material-ui/core/Checkbox';

View File

@ -5,10 +5,7 @@ import AppBar from '@material-ui/core/AppBar';
import Toolbar from '@material-ui/core/Toolbar'; import Toolbar from '@material-ui/core/Toolbar';
import List from '@material-ui/core/List'; import List from '@material-ui/core/List';
import IconButton from '@material-ui/core/IconButton'; 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 { useStyles } from './style';
import { Button, Link, ListItemSecondaryAction, ListItemText, Tooltip } from '@material-ui/core';
import { MapsList } from './maps-list'; import { MapsList } from './maps-list';
import { FormattedMessage, IntlProvider, useIntl } from 'react-intl'; import { FormattedMessage, IntlProvider, useIntl } from 'react-intl';
import { useQuery, useMutation, useQueryClient } from 'react-query'; import { useQuery, useMutation, useQueryClient } from 'react-query';
@ -24,6 +21,8 @@ import LanguageMenu from './language-menu';
import AppI18n, { Locales } from '../../classes/app-i18n'; import AppI18n, { Locales } from '../../classes/app-i18n';
import ListItemIcon from '@material-ui/core/ListItemIcon';
import ListItem from '@material-ui/core/ListItem';
import AddCircleTwoTone from '@material-ui/icons/AddCircleTwoTone'; import AddCircleTwoTone from '@material-ui/icons/AddCircleTwoTone';
import CloudUploadTwoTone from '@material-ui/icons/CloudUploadTwoTone'; import CloudUploadTwoTone from '@material-ui/icons/CloudUploadTwoTone';
@ -34,6 +33,11 @@ import PublicTwoTone from '@material-ui/icons/PublicTwoTone';
import ScatterPlotTwoTone from '@material-ui/icons/ScatterPlotTwoTone'; import ScatterPlotTwoTone from '@material-ui/icons/ScatterPlotTwoTone';
import ShareTwoTone from '@material-ui/icons/ShareTwoTone'; import ShareTwoTone from '@material-ui/icons/ShareTwoTone';
import StarTwoTone from '@material-ui/icons/StarTwoTone'; import StarTwoTone from '@material-ui/icons/StarTwoTone';
import Tooltip from '@material-ui/core/Tooltip';
import Button from '@material-ui/core/Button';
import Link from '@material-ui/core/Link';
import ListItemText from '@material-ui/core/ListItemText';
import ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';
const logoIcon = require('../../images/logo-small.svg'); const logoIcon = require('../../images/logo-small.svg');

View File

@ -1,4 +1,3 @@
import { Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, Menu, MenuItem, Tooltip } from '@material-ui/core';
import TranslateTwoTone from '@material-ui/icons/TranslateTwoTone'; import TranslateTwoTone from '@material-ui/icons/TranslateTwoTone';
import React from "react"; import React from "react";
import { useMutation, useQueryClient } from "react-query"; import { useMutation, useQueryClient } from "react-query";
@ -7,6 +6,16 @@ import { useSelector } from 'react-redux';
import { activeInstance, fetchAccount } from '../../../redux/clientSlice'; import { activeInstance, fetchAccount } from '../../../redux/clientSlice';
import { FormattedMessage, useIntl } from 'react-intl'; import { FormattedMessage, useIntl } from 'react-intl';
import { LocaleCode, Locales } from '../../../classes/app-i18n'; import { LocaleCode, Locales } from '../../../classes/app-i18n';
import Tooltip from '@material-ui/core/Tooltip';
import Button from '@material-ui/core/Button';
import Menu from '@material-ui/core/Menu';
import MenuItem from '@material-ui/core/MenuItem';
import Dialog from '@material-ui/core/Dialog';
import DialogTitle from '@material-ui/core/DialogTitle';
import DialogContent from '@material-ui/core/DialogContent';
import DialogContentText from '@material-ui/core/DialogContentText';
import DialogActions from '@material-ui/core/DialogActions';
import Divider from '@material-ui/core/Divider';
const LanguageMenu = () => { const LanguageMenu = () => {

View File

@ -1,4 +1,4 @@
import { createMuiTheme } from '@material-ui/core'; import createMuiTheme from "@material-ui/core/styles/createMuiTheme";
const theme = createMuiTheme({ const theme = createMuiTheme({
overrides: { overrides: {