mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
consistent borders and removed some comments
This commit is contained in:
@@ -8,7 +8,6 @@ import type { Locales } from 'i18n/i18n-types';
|
|||||||
import { loadLocaleAsync } from 'i18n/i18n-util.async';
|
import { loadLocaleAsync } from 'i18n/i18n-util.async';
|
||||||
import { detectLocale, navigatorDetector } from 'typesafe-i18n/detectors';
|
import { detectLocale, navigatorDetector } from 'typesafe-i18n/detectors';
|
||||||
|
|
||||||
// Memoize available locales to prevent recreation on every render
|
|
||||||
const AVAILABLE_LOCALES = [
|
const AVAILABLE_LOCALES = [
|
||||||
'de',
|
'de',
|
||||||
'en',
|
'en',
|
||||||
|
|||||||
@@ -11,17 +11,15 @@ import { createTheme } from '@mui/material/styles';
|
|||||||
|
|
||||||
import type { RequiredChildrenProps } from 'utils';
|
import type { RequiredChildrenProps } from 'utils';
|
||||||
|
|
||||||
// Memoize dialog style to prevent recreation
|
|
||||||
export const dialogStyle = {
|
export const dialogStyle = {
|
||||||
'& .MuiDialog-paper': {
|
'& .MuiDialog-paper': {
|
||||||
borderRadius: '8px',
|
borderRadius: '8px',
|
||||||
borderColor: '#565656',
|
borderColor: '#565656',
|
||||||
borderStyle: 'solid',
|
borderStyle: 'solid',
|
||||||
borderWidth: '1px'
|
borderWidth: '2px'
|
||||||
}
|
}
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
// Memoize theme creation to prevent recreation
|
|
||||||
const theme = responsiveFontSizes(
|
const theme = responsiveFontSizes(
|
||||||
createTheme({
|
createTheme({
|
||||||
typography: {
|
typography: {
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ const SystemMonitor = () => {
|
|||||||
minWidth: '300px',
|
minWidth: '300px',
|
||||||
maxWidth: '500px',
|
maxWidth: '500px',
|
||||||
backgroundColor: '#393939',
|
backgroundColor: '#393939',
|
||||||
border: 3,
|
border: 2,
|
||||||
borderColor: '#565656',
|
borderColor: '#565656',
|
||||||
borderRadius: '8px',
|
borderRadius: '8px',
|
||||||
boxShadow: '0 8px 32px rgba(0, 0, 0, 0.3)',
|
boxShadow: '0 8px 32px rgba(0, 0, 0, 0.3)',
|
||||||
|
|||||||
@@ -19,10 +19,8 @@ import { I18nContext } from 'i18n/i18n-react';
|
|||||||
import type { Locales } from 'i18n/i18n-types';
|
import type { Locales } from 'i18n/i18n-types';
|
||||||
import { loadLocaleAsync } from 'i18n/i18n-util.async';
|
import { loadLocaleAsync } from 'i18n/i18n-util.async';
|
||||||
|
|
||||||
// Extract style to constant to prevent recreation
|
|
||||||
const flagStyle: CSSProperties = { width: 16, verticalAlign: 'middle' };
|
const flagStyle: CSSProperties = { width: 16, verticalAlign: 'middle' };
|
||||||
|
|
||||||
// Define language options outside component to prevent recreation
|
|
||||||
interface LanguageOption {
|
interface LanguageOption {
|
||||||
key: Locales;
|
key: Locales;
|
||||||
flag: string;
|
flag: string;
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ interface ListMenuItemProps {
|
|||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract styles to prevent recreation
|
|
||||||
const iconStyles: CSSProperties = {
|
const iconStyles: CSSProperties = {
|
||||||
justifyContent: 'right',
|
justifyContent: 'right',
|
||||||
color: 'lightblue',
|
color: 'lightblue',
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { memo } from 'react';
|
|||||||
import { Box, CircularProgress } from '@mui/material';
|
import { Box, CircularProgress } from '@mui/material';
|
||||||
import type { SxProps, Theme } from '@mui/material';
|
import type { SxProps, Theme } from '@mui/material';
|
||||||
|
|
||||||
// Extract styles to prevent recreation on every render
|
|
||||||
const containerStyles: SxProps<Theme> = {
|
const containerStyles: SxProps<Theme> = {
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ interface LoadingSpinnerProps {
|
|||||||
height?: number | string;
|
height?: number | string;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract styles to prevent recreation on every render
|
|
||||||
const circularProgressStyles: SxProps<Theme> = (theme: Theme) => ({
|
const circularProgressStyles: SxProps<Theme> = (theme: Theme) => ({
|
||||||
margin: theme.spacing(4),
|
margin: theme.spacing(4),
|
||||||
color: theme.palette.text.secondary
|
color: theme.palette.text.secondary
|
||||||
|
|||||||
Reference in New Issue
Block a user