mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
add style to Dialog boxes
This commit is contained in:
@@ -45,6 +45,7 @@ import { DeviceValueUOM_s, DeviceEntityMask, DeviceType } from './types';
|
||||
import { deviceValueItemValidation } from './validators';
|
||||
import type { Device, DeviceValue } from './types';
|
||||
import type { FC } from 'react';
|
||||
import { dialogStyle } from 'CustomTheme';
|
||||
import { ButtonRow, SectionContent, MessageBox } from 'components';
|
||||
import { AuthenticatedContext } from 'contexts/authentication';
|
||||
|
||||
@@ -361,7 +362,7 @@ const DashboardDevices: FC = () => {
|
||||
}
|
||||
|
||||
return (
|
||||
<Dialog open={showDeviceInfo} onClose={() => setShowDeviceInfo(false)}>
|
||||
<Dialog sx={dialogStyle} open={showDeviceInfo} onClose={() => setShowDeviceInfo(false)}>
|
||||
<DialogTitle>{LL.DEVICE_DETAILS()}</DialogTitle>
|
||||
<DialogContent dividers>
|
||||
<List dense={true}>
|
||||
|
||||
@@ -16,7 +16,6 @@ import {
|
||||
Typography,
|
||||
CircularProgress
|
||||
} from '@mui/material';
|
||||
import { green } from '@mui/material/colors';
|
||||
import { useState, useEffect } from 'react';
|
||||
|
||||
import { DeviceValueUOM, DeviceValueUOM_s } from './types';
|
||||
@@ -24,12 +23,23 @@ import type { DeviceValue } from './types';
|
||||
import type Schema from 'async-validator';
|
||||
|
||||
import type { ValidateFieldsError } from 'async-validator';
|
||||
import { dialogStyle } from 'CustomTheme';
|
||||
import { ValidatedTextField } from 'components';
|
||||
import { useI18nContext } from 'i18n/i18n-react';
|
||||
import { updateValue } from 'utils';
|
||||
|
||||
import { validate } from 'validators';
|
||||
|
||||
// const dialogStyle = {
|
||||
// '& .MuiDialog-paper': {
|
||||
// borderRadius: '8px',
|
||||
// borderColor: '#565656',
|
||||
// borderStyle: 'solid',
|
||||
// borderWidth: '1px'
|
||||
// },
|
||||
// backdropFilter: 'blur(1px)'
|
||||
// };
|
||||
|
||||
type DashboardDevicesDialogProps = {
|
||||
open: boolean;
|
||||
onClose: () => void;
|
||||
@@ -112,16 +122,7 @@ const DashboardDevicesDialog = ({
|
||||
};
|
||||
|
||||
return (
|
||||
<Dialog
|
||||
open={open}
|
||||
onClose={close}
|
||||
sx={{
|
||||
'& .MuiDialog-paper': {
|
||||
borderRadius: '12px'
|
||||
},
|
||||
backdropFilter: 'blur(1px)'
|
||||
}}
|
||||
>
|
||||
<Dialog sx={dialogStyle} open={open} onClose={close}>
|
||||
<DialogTitle>
|
||||
{selectedItem.v === '' && selectedItem.c ? LL.RUN_COMMAND() : writeable ? LL.CHANGE_VALUE() : LL.VALUE(0)}
|
||||
</DialogTitle>
|
||||
@@ -206,7 +207,7 @@ const DashboardDevicesDialog = ({
|
||||
<CircularProgress
|
||||
size={24}
|
||||
sx={{
|
||||
color: green[500],
|
||||
color: '#4caf50',
|
||||
position: 'absolute',
|
||||
right: '20%',
|
||||
marginTop: '6px'
|
||||
|
||||
@@ -21,6 +21,7 @@ import { AnalogType, AnalogTypeNames, DeviceValueUOM_s } from './types';
|
||||
import type { AnalogSensor } from './types';
|
||||
import type Schema from 'async-validator';
|
||||
import type { ValidateFieldsError } from 'async-validator';
|
||||
import { dialogStyle } from 'CustomTheme';
|
||||
import { ValidatedTextField } from 'components';
|
||||
|
||||
import { useI18nContext } from 'i18n/i18n-react';
|
||||
@@ -77,7 +78,7 @@ const DashboardSensorsAnalogDialog = ({
|
||||
};
|
||||
|
||||
return (
|
||||
<Dialog open={open} onClose={close}>
|
||||
<Dialog sx={dialogStyle} open={open} onClose={close}>
|
||||
<DialogTitle>
|
||||
{creating ? LL.ADD(1) + ' ' + LL.NEW(0) : LL.EDIT()} {LL.ANALOG_SENSOR(0)}
|
||||
</DialogTitle>
|
||||
|
||||
@@ -18,6 +18,7 @@ import { useState, useEffect } from 'react';
|
||||
import type { TemperatureSensor } from './types';
|
||||
import type Schema from 'async-validator';
|
||||
import type { ValidateFieldsError } from 'async-validator';
|
||||
import { dialogStyle } from 'CustomTheme';
|
||||
import { ValidatedTextField } from 'components';
|
||||
|
||||
import { useI18nContext } from 'i18n/i18n-react';
|
||||
@@ -67,7 +68,7 @@ const DashboardSensorsTemperatureDialog = ({
|
||||
};
|
||||
|
||||
return (
|
||||
<Dialog open={open} onClose={close}>
|
||||
<Dialog sx={dialogStyle} open={open} onClose={close}>
|
||||
<DialogTitle>
|
||||
{LL.EDIT()} {LL.TEMP_SENSOR()}
|
||||
</DialogTitle>
|
||||
|
||||
@@ -30,6 +30,7 @@ import type { Theme } from '@mui/material';
|
||||
|
||||
import type { Translation } from 'i18n/i18n-types';
|
||||
import type { FC } from 'react';
|
||||
import { dialogStyle } from 'CustomTheme';
|
||||
import { ButtonRow, FormLoader, SectionContent } from 'components';
|
||||
import { AuthenticatedContext } from 'contexts/authentication';
|
||||
import { useI18nContext } from 'i18n/i18n-react';
|
||||
@@ -173,7 +174,7 @@ const DashboardStatus: FC = () => {
|
||||
};
|
||||
|
||||
const renderScanDialog = () => (
|
||||
<Dialog open={confirmScan} onClose={() => setConfirmScan(false)}>
|
||||
<Dialog sx={dialogStyle} open={confirmScan} onClose={() => setConfirmScan(false)}>
|
||||
<DialogTitle>{LL.SCAN_DEVICES()}</DialogTitle>
|
||||
<DialogContent dividers>{LL.EMS_SCAN()}</DialogContent>
|
||||
<DialogActions>
|
||||
|
||||
@@ -35,6 +35,7 @@ import * as EMSESP from './api';
|
||||
import { DeviceEntityMask } from './types';
|
||||
import type { DeviceShort, DeviceEntity } from './types';
|
||||
import type { FC } from 'react';
|
||||
import { dialogStyle } from 'CustomTheme';
|
||||
import * as SystemApi from 'api/system';
|
||||
import { ButtonRow, SectionContent, MessageBox, BlockNavigation } from 'components';
|
||||
|
||||
@@ -484,7 +485,7 @@ const SettingsCustomization: FC = () => {
|
||||
};
|
||||
|
||||
const renderResetDialog = () => (
|
||||
<Dialog open={confirmReset} onClose={() => setConfirmReset(false)}>
|
||||
<Dialog sx={dialogStyle} open={confirmReset} onClose={() => setConfirmReset(false)}>
|
||||
<DialogTitle>{LL.RESET(1)}</DialogTitle>
|
||||
<DialogContent dividers>{LL.CUSTOMIZATIONS_RESET()}</DialogContent>
|
||||
<DialogActions>
|
||||
|
||||
@@ -18,6 +18,7 @@ import EntityMaskToggle from './EntityMaskToggle';
|
||||
import { DeviceEntityMask } from './types';
|
||||
import type { DeviceEntity } from './types';
|
||||
|
||||
import { dialogStyle } from 'CustomTheme';
|
||||
import { useI18nContext } from 'i18n/i18n-react';
|
||||
|
||||
import { updateValue } from 'utils';
|
||||
@@ -63,7 +64,7 @@ const SettingsCustomizationDialog = ({ open, onClose, onSave, selectedItem }: Se
|
||||
};
|
||||
|
||||
return (
|
||||
<Dialog open={open} onClose={close}>
|
||||
<Dialog sx={dialogStyle} open={open} onClose={close}>
|
||||
<DialogTitle>{LL.EDIT() + ' ' + LL.ENTITY()}</DialogTitle>
|
||||
<DialogContent dividers>
|
||||
<Box color="warning.main">
|
||||
|
||||
@@ -22,6 +22,7 @@ import type { EntityItem } from './types';
|
||||
import type Schema from 'async-validator';
|
||||
import type { ValidateFieldsError } from 'async-validator';
|
||||
|
||||
import { dialogStyle } from 'CustomTheme';
|
||||
import { BlockFormControlLabel, ValidatedTextField } from 'components';
|
||||
|
||||
import { useI18nContext } from 'i18n/i18n-react';
|
||||
@@ -90,7 +91,7 @@ const SettingsEntitiesDialog = ({
|
||||
};
|
||||
|
||||
return (
|
||||
<Dialog open={open} onClose={close}>
|
||||
<Dialog sx={dialogStyle} open={open} onClose={close}>
|
||||
<DialogTitle>
|
||||
{creating ? LL.ADD(1) + ' ' + LL.NEW(1) : LL.EDIT()} {LL.ENTITY()}
|
||||
</DialogTitle>
|
||||
|
||||
@@ -25,6 +25,7 @@ import type { ScheduleItem } from './types';
|
||||
import type Schema from 'async-validator';
|
||||
import type { ValidateFieldsError } from 'async-validator';
|
||||
|
||||
import { dialogStyle } from 'CustomTheme';
|
||||
import { BlockFormControlLabel, ValidatedTextField } from 'components';
|
||||
|
||||
import { useI18nContext } from 'i18n/i18n-react';
|
||||
@@ -129,7 +130,7 @@ const SettingsSchedulerDialog = ({
|
||||
const isTimer = editItem.flags === ScheduleFlag.SCHEDULE_TIMER;
|
||||
|
||||
return (
|
||||
<Dialog open={open} onClose={close}>
|
||||
<Dialog sx={dialogStyle} open={open} onClose={close}>
|
||||
<DialogTitle>
|
||||
{creating ? LL.ADD(1) + ' ' + LL.NEW(0) : LL.EDIT()} {LL.SCHEDULE(1)}
|
||||
</DialogTitle>
|
||||
|
||||
Reference in New Issue
Block a user