partial: use theme only for switch customization
This commit is contained in:
parent
af21051989
commit
4bfb94182c
19 changed files with 75 additions and 106 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
import { makeStyles } from '@mui/styles'
|
import { makeStyles } from '@mui/styles'
|
||||||
|
import Switch from '@mui/material/Switch'
|
||||||
import classnames from 'classnames'
|
import classnames from 'classnames'
|
||||||
import { Field, useFormikContext } from 'formik'
|
import { Field, useFormikContext } from 'formik'
|
||||||
import * as R from 'ramda'
|
import * as R from 'ramda'
|
||||||
|
|
@ -13,7 +14,6 @@ import EditIcon from 'src/styling/icons/action/edit/enabled.svg?react'
|
||||||
import StripesSvg from 'src/styling/icons/stripes.svg?react'
|
import StripesSvg from 'src/styling/icons/stripes.svg?react'
|
||||||
|
|
||||||
import { Link, IconButton } from 'src/components/buttons'
|
import { Link, IconButton } from 'src/components/buttons'
|
||||||
import { Switch } from 'src/components/inputs'
|
|
||||||
|
|
||||||
import TableCtx from './Context'
|
import TableCtx from './Context'
|
||||||
import styles from './Row.styles'
|
import styles from './Row.styles'
|
||||||
|
|
|
||||||
|
|
@ -1,81 +0,0 @@
|
||||||
import Switch from '@mui/material/Switch'
|
|
||||||
import { makeStyles } from '@mui/styles'
|
|
||||||
import React, { memo } from 'react'
|
|
||||||
|
|
||||||
import {
|
|
||||||
secondaryColor,
|
|
||||||
offColor,
|
|
||||||
disabledColor,
|
|
||||||
disabledColor2
|
|
||||||
} from '../../../styling/variables'
|
|
||||||
|
|
||||||
const useStyles = makeStyles(theme => ({
|
|
||||||
root: {
|
|
||||||
width: 32,
|
|
||||||
height: 20,
|
|
||||||
padding: 0,
|
|
||||||
margin: theme.spacing(1)
|
|
||||||
},
|
|
||||||
switchBase: {
|
|
||||||
padding: 2,
|
|
||||||
'&.Mui-disabled': {
|
|
||||||
color: disabledColor2,
|
|
||||||
'& + $track': {
|
|
||||||
backgroundColor: disabledColor,
|
|
||||||
opacity: 1
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'&.Mui-checked': {
|
|
||||||
transform: 'translateX(58%)',
|
|
||||||
color: theme.palette.common.white,
|
|
||||||
'&.Mui-disabled': {
|
|
||||||
color: disabledColor2
|
|
||||||
},
|
|
||||||
'& + $track': {
|
|
||||||
backgroundColor: secondaryColor,
|
|
||||||
opacity: 1,
|
|
||||||
border: 'none'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'&.Mui-focusVisible $thumb': {
|
|
||||||
border: '6px solid #fff',
|
|
||||||
boxShadow: '0 0 4px 0 rgba(0,0,0,0.24)'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
thumb: {
|
|
||||||
width: 16,
|
|
||||||
height: 16
|
|
||||||
},
|
|
||||||
track: {
|
|
||||||
borderRadius: 17,
|
|
||||||
border: 'none',
|
|
||||||
backgroundColor: offColor,
|
|
||||||
opacity: 1,
|
|
||||||
transition: theme.transitions.create(['background-color', 'border'])
|
|
||||||
},
|
|
||||||
disabled: {},
|
|
||||||
checked: {},
|
|
||||||
focusVisible: {}
|
|
||||||
}))
|
|
||||||
|
|
||||||
const SwitchInput = memo(({ ...props }) => {
|
|
||||||
const classes = useStyles()
|
|
||||||
return (
|
|
||||||
<Switch
|
|
||||||
color="secondary"
|
|
||||||
focusVisibleClassName={classes.focusVisible}
|
|
||||||
disableRipple
|
|
||||||
classes={{
|
|
||||||
root: classes.root,
|
|
||||||
switchBase: classes.switchBase,
|
|
||||||
thumb: classes.thumb,
|
|
||||||
track: classes.track,
|
|
||||||
checked: classes.checked,
|
|
||||||
disabled: classes.disabled
|
|
||||||
}}
|
|
||||||
{...props}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
export default SwitchInput
|
|
||||||
|
|
@ -5,7 +5,6 @@ import Dropdown from './Dropdown'
|
||||||
import NumberInput from './NumberInput'
|
import NumberInput from './NumberInput'
|
||||||
import RadioGroup from './RadioGroup'
|
import RadioGroup from './RadioGroup'
|
||||||
import SecretInput from './SecretInput'
|
import SecretInput from './SecretInput'
|
||||||
import Switch from './Switch'
|
|
||||||
import TextInput from './TextInput'
|
import TextInput from './TextInput'
|
||||||
import ToggleButtonGroup from './ToggleButtonGroup'
|
import ToggleButtonGroup from './ToggleButtonGroup'
|
||||||
export {
|
export {
|
||||||
|
|
@ -13,7 +12,6 @@ export {
|
||||||
CodeInput,
|
CodeInput,
|
||||||
TextInput,
|
TextInput,
|
||||||
NumberInput,
|
NumberInput,
|
||||||
Switch,
|
|
||||||
SecretInput,
|
SecretInput,
|
||||||
RadioGroup,
|
RadioGroup,
|
||||||
Autocomplete,
|
Autocomplete,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import Checkbox from './base/Checkbox'
|
||||||
import CodeInput from './base/CodeInput'
|
import CodeInput from './base/CodeInput'
|
||||||
import RadioGroup from './base/RadioGroup'
|
import RadioGroup from './base/RadioGroup'
|
||||||
import Select from './base/Select'
|
import Select from './base/Select'
|
||||||
import Switch from './base/Switch'
|
|
||||||
import TextInput from './base/TextInput'
|
import TextInput from './base/TextInput'
|
||||||
import { CashIn, CashOut } from './cashbox/Cashbox'
|
import { CashIn, CashOut } from './cashbox/Cashbox'
|
||||||
|
|
||||||
|
|
@ -12,7 +11,6 @@ export {
|
||||||
TextInput,
|
TextInput,
|
||||||
Checkbox,
|
Checkbox,
|
||||||
CodeInput,
|
CodeInput,
|
||||||
Switch,
|
|
||||||
Select,
|
Select,
|
||||||
RadioGroup,
|
RadioGroup,
|
||||||
CashIn,
|
CashIn,
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
import { Box } from '@mui/material'
|
import Switch from '@mui/material/Switch'
|
||||||
|
import Box from '@mui/material/Box'
|
||||||
import { makeStyles } from '@mui/styles'
|
import { makeStyles } from '@mui/styles'
|
||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
import { H2 } from 'src/components/typography'
|
import { H2 } from 'src/components/typography'
|
||||||
|
|
||||||
import { Select, Switch } from 'src/components/inputs'
|
import { Select } from 'src/components/inputs'
|
||||||
import { primaryColor } from 'src/styling/variables'
|
import { primaryColor } from 'src/styling/variables'
|
||||||
|
|
||||||
import styles from '../../Analytics.styles'
|
import styles from '../../Analytics.styles'
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
import { Box } from '@mui/material'
|
import Box from '@mui/material/Box'
|
||||||
|
import Switch from '@mui/material/Switch'
|
||||||
import { makeStyles } from '@mui/styles'
|
import { makeStyles } from '@mui/styles'
|
||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
import { H2 } from 'src/components/typography'
|
import { H2 } from 'src/components/typography'
|
||||||
|
|
||||||
import { Select, Switch } from 'src/components/inputs'
|
import { Select } from 'src/components/inputs'
|
||||||
import { neon, java } from 'src/styling/variables'
|
import { neon, java } from 'src/styling/variables'
|
||||||
|
|
||||||
import styles from '../../Analytics.styles'
|
import styles from '../../Analytics.styles'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { useQuery, useMutation, gql } from "@apollo/client";
|
import { useQuery, useMutation, gql } from "@apollo/client";
|
||||||
import { Box, Dialog, DialogContent, DialogActions } from '@mui/material'
|
import { Box, Dialog, DialogContent, DialogActions } from '@mui/material'
|
||||||
|
import Switch from '@mui/material/Switch'
|
||||||
import { makeStyles } from '@mui/styles'
|
import { makeStyles } from '@mui/styles'
|
||||||
import * as R from 'ramda'
|
import * as R from 'ramda'
|
||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
|
|
@ -11,7 +12,6 @@ import ReverseSettingsIcon from 'src/styling/icons/circle buttons/settings/white
|
||||||
import SettingsIcon from 'src/styling/icons/circle buttons/settings/zodiac.svg?react'
|
import SettingsIcon from 'src/styling/icons/circle buttons/settings/zodiac.svg?react'
|
||||||
|
|
||||||
import { Link, Button, IconButton, SupportLinkButton } from 'src/components/buttons'
|
import { Link, Button, IconButton, SupportLinkButton } from 'src/components/buttons'
|
||||||
import { Switch } from 'src/components/inputs'
|
|
||||||
import { fromNamespace, toNamespace } from 'src/utils/config'
|
import { fromNamespace, toNamespace } from 'src/utils/config'
|
||||||
|
|
||||||
import styles from './Blacklist.styles'
|
import styles from './Blacklist.styles'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { useQuery, useMutation, gql } from "@apollo/client";
|
import { useQuery, useMutation, gql } from "@apollo/client";
|
||||||
import { makeStyles } from '@mui/styles'
|
import { makeStyles } from '@mui/styles'
|
||||||
|
import Switch from '@mui/material/Switch'
|
||||||
import * as R from 'ramda'
|
import * as R from 'ramda'
|
||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
import { HelpTooltip } from 'src/components/Tooltip'
|
import { HelpTooltip } from 'src/components/Tooltip'
|
||||||
|
|
@ -8,7 +9,6 @@ import { P, Label2 } from 'src/components/typography'
|
||||||
|
|
||||||
import { SupportLinkButton } from 'src/components/buttons'
|
import { SupportLinkButton } from 'src/components/buttons'
|
||||||
import { NamespacedTable as EditableTable } from 'src/components/editableTable'
|
import { NamespacedTable as EditableTable } from 'src/components/editableTable'
|
||||||
import { Switch } from 'src/components/inputs'
|
|
||||||
import { EmptyTable } from 'src/components/table'
|
import { EmptyTable } from 'src/components/table'
|
||||||
import { fromNamespace, toNamespace } from 'src/utils/config'
|
import { fromNamespace, toNamespace } from 'src/utils/config'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import {
|
||||||
DialogContent,
|
DialogContent,
|
||||||
Dialog
|
Dialog
|
||||||
} from '@mui/material'
|
} from '@mui/material'
|
||||||
|
import Switch from '@mui/material/Switch'
|
||||||
import { makeStyles } from '@mui/styles'
|
import { makeStyles } from '@mui/styles'
|
||||||
import NavigateNextIcon from '@mui/icons-material/NavigateNext'
|
import NavigateNextIcon from '@mui/icons-material/NavigateNext'
|
||||||
import * as R from 'ramda'
|
import * as R from 'ramda'
|
||||||
|
|
@ -22,7 +23,6 @@ import DataReversedIcon from 'src/styling/icons/button/data/white.svg?react'
|
||||||
import DataIcon from 'src/styling/icons/button/data/zodiac.svg?react'
|
import DataIcon from 'src/styling/icons/button/data/zodiac.svg?react'
|
||||||
|
|
||||||
import { Button, IconButton, ActionButton } from 'src/components/buttons'
|
import { Button, IconButton, ActionButton } from 'src/components/buttons'
|
||||||
import { Switch } from 'src/components/inputs'
|
|
||||||
import {
|
import {
|
||||||
OVERRIDE_AUTHORIZED,
|
OVERRIDE_AUTHORIZED,
|
||||||
OVERRIDE_REJECTED
|
OVERRIDE_REJECTED
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { makeStyles } from '@mui/styles'
|
import { makeStyles } from '@mui/styles'
|
||||||
|
import Switch from '@mui/material/Switch'
|
||||||
import * as R from 'ramda'
|
import * as R from 'ramda'
|
||||||
import React, { useContext } from 'react'
|
import React, { useContext } from 'react'
|
||||||
import {
|
import {
|
||||||
|
|
@ -10,7 +11,6 @@ import {
|
||||||
Th
|
Th
|
||||||
} from 'src/components/fake-table/Table'
|
} from 'src/components/fake-table/Table'
|
||||||
|
|
||||||
import { Switch } from 'src/components/inputs'
|
|
||||||
import { fromNamespace, toNamespace } from 'src/utils/config'
|
import { fromNamespace, toNamespace } from 'src/utils/config'
|
||||||
import { sentenceCase } from 'src/utils/string'
|
import { sentenceCase } from 'src/utils/string'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
import { useQuery, useMutation, gql } from "@apollo/client";
|
import { useQuery, useMutation, gql } from "@apollo/client";
|
||||||
import { makeStyles } from '@mui/styles'
|
import { makeStyles } from '@mui/styles'
|
||||||
|
import Switch from '@mui/material/Switch'
|
||||||
import React, { memo } from 'react'
|
import React, { memo } from 'react'
|
||||||
import { HelpTooltip } from 'src/components/Tooltip'
|
import { HelpTooltip } from 'src/components/Tooltip'
|
||||||
import { H4, P, Label2 } from 'src/components/typography'
|
import { H4, P, Label2 } from 'src/components/typography'
|
||||||
|
|
||||||
import { BooleanPropertiesTable } from 'src/components/booleanPropertiesTable'
|
import { BooleanPropertiesTable } from 'src/components/booleanPropertiesTable'
|
||||||
import { Switch } from 'src/components/inputs'
|
|
||||||
import { fromNamespace, toNamespace, namespaces } from 'src/utils/config'
|
import { fromNamespace, toNamespace, namespaces } from 'src/utils/config'
|
||||||
|
|
||||||
import { SupportLinkButton } from '../../components/buttons'
|
import { SupportLinkButton } from '../../components/buttons'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { useQuery, useMutation, gql } from "@apollo/client";
|
import { useQuery, useMutation, gql } from "@apollo/client";
|
||||||
import { makeStyles } from '@mui/styles'
|
import { makeStyles } from '@mui/styles'
|
||||||
|
import Switch from '@mui/material/Switch'
|
||||||
import classnames from 'classnames'
|
import classnames from 'classnames'
|
||||||
import { Form, Formik, Field as FormikField } from 'formik'
|
import { Form, Formik, Field as FormikField } from 'formik'
|
||||||
import * as R from 'ramda'
|
import * as R from 'ramda'
|
||||||
|
|
@ -7,7 +8,6 @@ import React, { useState } from 'react'
|
||||||
import ErrorMessage from 'src/components/ErrorMessage'
|
import ErrorMessage from 'src/components/ErrorMessage'
|
||||||
import PromptWhenDirty from 'src/components/PromptWhenDirty'
|
import PromptWhenDirty from 'src/components/PromptWhenDirty'
|
||||||
import { HelpTooltip } from 'src/components/Tooltip'
|
import { HelpTooltip } from 'src/components/Tooltip'
|
||||||
import Switch from 'src/components/inputs/base/Switch'
|
|
||||||
import { P, H4, Info3, Label1, Label2, Label3 } from 'src/components/typography'
|
import { P, H4, Info3, Label1, Label2, Label3 } from 'src/components/typography'
|
||||||
import EditIcon from 'src/styling/icons/action/edit/enabled.svg?react'
|
import EditIcon from 'src/styling/icons/action/edit/enabled.svg?react'
|
||||||
import WarningIcon from 'src/styling/icons/warning-icon/comet.svg?react'
|
import WarningIcon from 'src/styling/icons/warning-icon/comet.svg?react'
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import { useQuery, useMutation, gql } from "@apollo/client";
|
import { useQuery, useMutation, gql } from "@apollo/client";
|
||||||
import { makeStyles } from '@mui/styles'
|
import { makeStyles } from '@mui/styles'
|
||||||
|
import Switch from '@mui/material/Switch'
|
||||||
import * as R from 'ramda'
|
import * as R from 'ramda'
|
||||||
import React, { memo } from 'react'
|
import React, { memo } from 'react'
|
||||||
import { H4, P, Label2 } from 'src/components/typography'
|
import { H4, P, Label2 } from 'src/components/typography'
|
||||||
|
|
||||||
import { Switch } from 'src/components/inputs'
|
|
||||||
import { fromNamespace, toNamespace, namespaces } from 'src/utils/config'
|
import { fromNamespace, toNamespace, namespaces } from 'src/utils/config'
|
||||||
|
|
||||||
import { global } from './OperatorInfo.styles'
|
import { global } from './OperatorInfo.styles'
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
import { useQuery, useMutation, gql } from "@apollo/client";
|
import { useQuery, useMutation, gql } from "@apollo/client";
|
||||||
import { makeStyles } from '@mui/styles'
|
import { makeStyles } from '@mui/styles'
|
||||||
|
import Switch from '@mui/material/Switch'
|
||||||
import * as R from 'ramda'
|
import * as R from 'ramda'
|
||||||
import React, { memo } from 'react'
|
import React, { memo } from 'react'
|
||||||
import { HelpTooltip } from 'src/components/Tooltip'
|
import { HelpTooltip } from 'src/components/Tooltip'
|
||||||
import { H4, P, Label2 } from 'src/components/typography'
|
import { H4, P, Label2 } from 'src/components/typography'
|
||||||
|
|
||||||
import { BooleanPropertiesTable } from 'src/components/booleanPropertiesTable'
|
import { BooleanPropertiesTable } from 'src/components/booleanPropertiesTable'
|
||||||
import { Switch } from 'src/components/inputs'
|
|
||||||
import { fromNamespace, toNamespace, namespaces } from 'src/utils/config'
|
import { fromNamespace, toNamespace, namespaces } from 'src/utils/config'
|
||||||
|
|
||||||
import { SupportLinkButton } from '../../components/buttons'
|
import { SupportLinkButton } from '../../components/buttons'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { useQuery, useMutation, gql } from "@apollo/client";
|
import { useQuery, useMutation, gql } from "@apollo/client";
|
||||||
import { Paper } from '@mui/material'
|
import Paper from '@mui/material/Paper'
|
||||||
|
import Switch from '@mui/material/Switch'
|
||||||
import { makeStyles } from '@mui/styles'
|
import { makeStyles } from '@mui/styles'
|
||||||
import * as R from 'ramda'
|
import * as R from 'ramda'
|
||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
|
|
@ -12,7 +13,6 @@ import ExpandIconOpen from 'src/styling/icons/action/expand/open.svg?react'
|
||||||
import WhiteLogo from 'src/styling/icons/menu/logo-white.svg?react'
|
import WhiteLogo from 'src/styling/icons/menu/logo-white.svg?react'
|
||||||
|
|
||||||
import { IconButton, SupportLinkButton } from 'src/components/buttons'
|
import { IconButton, SupportLinkButton } from 'src/components/buttons'
|
||||||
import { Switch } from 'src/components/inputs'
|
|
||||||
import { formatDate } from 'src/utils/timezones'
|
import { formatDate } from 'src/utils/timezones'
|
||||||
|
|
||||||
import styles from './SMSNotices.styles'
|
import styles from './SMSNotices.styles'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { useQuery, useMutation, gql } from "@apollo/client";
|
import { useQuery, useMutation, gql } from "@apollo/client";
|
||||||
import { makeStyles } from '@mui/styles'
|
import { makeStyles } from '@mui/styles'
|
||||||
|
import Switch from '@mui/material/Switch'
|
||||||
import classnames from 'classnames'
|
import classnames from 'classnames'
|
||||||
import { Form, Formik, Field as FormikField } from 'formik'
|
import { Form, Formik, Field as FormikField } from 'formik'
|
||||||
import * as R from 'ramda'
|
import * as R from 'ramda'
|
||||||
|
|
@ -12,7 +13,6 @@ import EditIcon from 'src/styling/icons/action/edit/enabled.svg?react'
|
||||||
import * as Yup from 'yup'
|
import * as Yup from 'yup'
|
||||||
|
|
||||||
import { Link, IconButton, SupportLinkButton } from 'src/components/buttons'
|
import { Link, IconButton, SupportLinkButton } from 'src/components/buttons'
|
||||||
import { Switch } from 'src/components/inputs'
|
|
||||||
import { TextInput } from 'src/components/inputs/formik'
|
import { TextInput } from 'src/components/inputs/formik'
|
||||||
import { fromNamespace, toNamespace, namespaces } from 'src/utils/config'
|
import { fromNamespace, toNamespace, namespaces } from 'src/utils/config'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { useQuery, useMutation, gql } from "@apollo/client";
|
import { useQuery, useMutation, gql } from "@apollo/client";
|
||||||
import { Box } from '@mui/material'
|
import Box from '@mui/material/Box'
|
||||||
|
import Switch from '@mui/material/Switch'
|
||||||
import { makeStyles } from '@mui/styles'
|
import { makeStyles } from '@mui/styles'
|
||||||
import classnames from 'classnames'
|
import classnames from 'classnames'
|
||||||
import * as R from 'ramda'
|
import * as R from 'ramda'
|
||||||
|
|
@ -15,7 +16,6 @@ import ReverseSettingsIcon from 'src/styling/icons/circle buttons/settings/white
|
||||||
import SettingsIcon from 'src/styling/icons/circle buttons/settings/zodiac.svg?react'
|
import SettingsIcon from 'src/styling/icons/circle buttons/settings/zodiac.svg?react'
|
||||||
|
|
||||||
import { Link, SupportLinkButton } from 'src/components/buttons'
|
import { Link, SupportLinkButton } from 'src/components/buttons'
|
||||||
import { Switch } from 'src/components/inputs'
|
|
||||||
import twilioSchema from 'src/pages/Services/schemas/twilio'
|
import twilioSchema from 'src/pages/Services/schemas/twilio'
|
||||||
import { fromNamespace, toNamespace } from 'src/utils/config'
|
import { fromNamespace, toNamespace } from 'src/utils/config'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { useQuery, useMutation, useLazyQuery, gql } from "@apollo/client";
|
import { useQuery, useMutation, useLazyQuery, gql } from "@apollo/client";
|
||||||
import { Box, Chip } from '@mui/material'
|
import { Box, Chip } from '@mui/material'
|
||||||
|
import Switch from '@mui/material/Switch'
|
||||||
import { makeStyles } from '@mui/styles'
|
import { makeStyles } from '@mui/styles'
|
||||||
import { startAttestation } from '@simplewebauthn/browser'
|
import { startAttestation } from '@simplewebauthn/browser'
|
||||||
import * as R from 'ramda'
|
import * as R from 'ramda'
|
||||||
|
|
@ -15,7 +16,6 @@ import UserRoleIcon from 'src/styling/icons/button/user-role/zodiac.svg?react'
|
||||||
|
|
||||||
import AppContext from 'src/AppContext'
|
import AppContext from 'src/AppContext'
|
||||||
import { ActionButton, Link } from 'src/components/buttons'
|
import { ActionButton, Link } from 'src/components/buttons'
|
||||||
import { Switch } from 'src/components/inputs'
|
|
||||||
import { IP_CHECK_REGEX } from 'src/utils/constants'
|
import { IP_CHECK_REGEX } from 'src/utils/constants'
|
||||||
|
|
||||||
import styles from './UserManagement.styles'
|
import styles from './UserManagement.styles'
|
||||||
|
|
|
||||||
|
|
@ -13,12 +13,12 @@ import {
|
||||||
fontSize5,
|
fontSize5,
|
||||||
zircon,
|
zircon,
|
||||||
zircon2,
|
zircon2,
|
||||||
primaryColor
|
primaryColor, disabledColor2, disabledColor
|
||||||
} from './variables'
|
} from './variables'
|
||||||
|
|
||||||
const { p } = typographyStyles
|
const { p } = typographyStyles
|
||||||
|
|
||||||
export default createTheme({
|
let theme = createTheme({
|
||||||
typography: {
|
typography: {
|
||||||
fontFamily: inputFontFamily,
|
fontFamily: inputFontFamily,
|
||||||
},
|
},
|
||||||
|
|
@ -37,6 +37,9 @@ export default createTheme({
|
||||||
default: backgroundColor
|
default: backgroundColor
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
theme = createTheme({
|
||||||
components: {
|
components: {
|
||||||
MuiTypography: {
|
MuiTypography: {
|
||||||
styleOverrides: {
|
styleOverrides: {
|
||||||
|
|
@ -48,6 +51,53 @@ export default createTheme({
|
||||||
disableRipple: true
|
disableRipple: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
MuiSwitch: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
width: 32,
|
||||||
|
height: 20,
|
||||||
|
padding: 0,
|
||||||
|
margin: theme.spacing(1)
|
||||||
|
},
|
||||||
|
thumb: {
|
||||||
|
width: 16,
|
||||||
|
height: 16
|
||||||
|
},
|
||||||
|
track: {
|
||||||
|
borderRadius: 17,
|
||||||
|
border: 'none',
|
||||||
|
backgroundColor: offColor,
|
||||||
|
opacity: 1,
|
||||||
|
transition: theme.transitions.create(['background-color', 'border'])
|
||||||
|
},
|
||||||
|
switchBase: {
|
||||||
|
padding: 2,
|
||||||
|
'&.Mui-disabled': {
|
||||||
|
color: disabledColor2,
|
||||||
|
'& + .MuiSwitch-track': {
|
||||||
|
backgroundColor: disabledColor,
|
||||||
|
opacity: 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'&.Mui-checked': {
|
||||||
|
transform: 'translateX(58%)',
|
||||||
|
color: theme.palette.common.white,
|
||||||
|
'&.Mui-disabled': {
|
||||||
|
color: disabledColor2
|
||||||
|
},
|
||||||
|
'& + .MuiSwitch-track': {
|
||||||
|
backgroundColor: secondaryColor,
|
||||||
|
opacity: 1,
|
||||||
|
border: 'none'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'&.Mui-focusVisible .MuiSwitch-thumb': {
|
||||||
|
border: '6px solid #fff',
|
||||||
|
boxShadow: '0 0 4px 0 rgba(0,0,0,0.24)'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
MuiAutocomplete: {
|
MuiAutocomplete: {
|
||||||
styleOverrides: {
|
styleOverrides: {
|
||||||
root: {
|
root: {
|
||||||
|
|
@ -184,3 +234,5 @@ export default createTheme({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
export default theme
|
||||||
Loading…
Add table
Add a link
Reference in a new issue