diff --git a/new-lamassu-admin/src/components/tables/DataTable.jsx b/new-lamassu-admin/src/components/tables/DataTable.jsx index 7027fec0..b1764cbd 100644 --- a/new-lamassu-admin/src/components/tables/DataTable.jsx +++ b/new-lamassu-admin/src/components/tables/DataTable.jsx @@ -105,6 +105,7 @@ const DataTable = ({ initialExpanded, onClick, loading, + maxWidth = 1200, emptyText, rowSize, ...props @@ -114,7 +115,7 @@ const DataTable = ({ useEffect(() => setExpanded(initialExpanded), [initialExpanded]) const coreWidth = R.compose(R.sum, R.map(R.prop('width')))(elements) - const expWidth = 1200 - coreWidth + const expWidth = maxWidth - coreWidth const width = coreWidth + (expandable ? expWidth : 0) const classes = useStyles({ width }) @@ -170,7 +171,11 @@ const DataTable = ({ } return ( -
| - {view(data)} - | - ))} - {expandable && ( -- - | - )} -
|
-
- |
-
| - {header} - | - ))} - {expandable &&} - - - {loading && |
|---|
{R.isEmpty(sms?.message) ? ( No content available @@ -117,8 +113,6 @@ const SMSPreview = ({ sms, coords, timezone }) => { } const SMSNotices = () => { - const classes = useStyles() - const [showModal, setShowModal] = useState(false) const [selectedSMS, setSelectedSMS] = useState(null) const [previewOpen, setPreviewOpen] = useState(false) @@ -160,7 +154,7 @@ const SMSNotices = () => { textAlign: 'left', view: it => !R.isEmpty(TOOLTIPS[it.event]) ? ( -
{TOOLTIPS[it.event]}
@@ -237,7 +231,7 @@ const SMSNotices = () => { return ( <> -diff --git a/new-lamassu-admin/src/pages/OperatorInfo/SMSNotices/SMSNotices.styles.js b/new-lamassu-admin/src/pages/OperatorInfo/SMSNotices/SMSNotices.styles.js deleted file mode 100644 index 65e39737..00000000 --- a/new-lamassu-admin/src/pages/OperatorInfo/SMSNotices/SMSNotices.styles.js +++ /dev/null @@ -1,95 +0,0 @@ -import { - spacer, - fontMonospaced, - fontSize5, - fontColor -} from 'src/styling/variables' - -const styles = { - header: { - display: 'flex', - position: 'relative', - alignItems: 'center', - justifyContent: 'space-between', - width: 800 - }, - form: { - '& > *': { - marginTop: 20 - }, - display: 'flex', - flexDirection: 'column', - height: '100%' - }, - footer: { - display: 'flex', - flexDirection: 'row', - margin: [['auto', 0, spacer * 3, 0]] - }, - submit: { - margin: [['auto', 0, 0, 'auto']] - }, - smsPreview: { - position: 'absolute', - left: ({ x }) => x, - bottom: ({ y }) => y, - width: 350, - overflow: 'visible' - }, - smsPreviewContainer: { - display: 'flex', - flexDirection: 'row', - alignItems: 'flex-end', - '& > *': { - marginRight: 10 - } - }, - smsPreviewIcon: { - display: 'flex', - width: 36, - height: 36, - borderRadius: 18, - backgroundColor: '#16D6D3', - alignItems: 'center', - justifyContent: 'center' - }, - smsPreviewContent: { - width: 225, - padding: 15, - borderRadius: '15px 15px 15px 0px' - }, - chipButtons: { - width: 480, - display: 'flex', - flexDirection: 'column', - alignItems: 'space-between', - '& > div': { - marginTop: 15 - }, - '& > div:first-child': { - marginTop: 0 - }, - '& > div > div': { - margin: [[0, 5, 0, 5]] - }, - '& > div > div > span': { - lineHeight: '120%', - color: fontColor, - fontSize: fontSize5, - fontFamily: fontMonospaced, - fontWeight: 500 - }, - marginLeft: 'auto', - marginRight: 'auto' - }, - resetToDefault: { - width: 145 - }, - messageWithTooltip: { - display: 'flex', - flexDirection: 'row', - alignItems: 'center' - } -} - -export default styles diff --git a/new-lamassu-admin/src/pages/OperatorInfo/SMSNotices/SMSNoticesModal.jsx b/new-lamassu-admin/src/pages/OperatorInfo/SMSNotices/SMSNoticesModal.jsx index 745891b7..4939df23 100644 --- a/new-lamassu-admin/src/pages/OperatorInfo/SMSNotices/SMSNoticesModal.jsx +++ b/new-lamassu-admin/src/pages/OperatorInfo/SMSNotices/SMSNoticesModal.jsx @@ -1,5 +1,4 @@ import Chip from '@mui/material/Chip' -import { makeStyles } from '@mui/styles' import { Form, Formik, Field } from 'formik' import * as R from 'ramda' import React from 'react' @@ -14,10 +13,6 @@ import { ActionButton, Button } from 'src/components/buttons' import { TextInput } from 'src/components/inputs/formik' import { zircon } from 'src/styling/variables' -import styles from './SMSNotices.styles' - -const useStyles = makeStyles(styles) - const getErrorMsg = (formikErrors, formikTouched, mutationError) => { if (!formikErrors || !formikTouched) return null if (mutationError) return 'Internal server error' @@ -77,8 +72,6 @@ const SMSNoticesModal = ({ creationError, submit }) => { - const classes = useStyles() - const initialValues = { event: !R.isNil(sms) ? sms.event : '', message: !R.isNil(sms) ? sms.message : '' @@ -128,12 +121,12 @@ const SMSNoticesModal = ({ handleSubmit(values, errors, touched) }> {({ values, errors, touched, setFieldValue }) => ( -