diff --git a/components/form/widget/CaseActionSelect.js b/components/form/widget/CaseActionSelect.js index acd47e8..2facadc 100644 --- a/components/form/widget/CaseActionSelect.js +++ b/components/form/widget/CaseActionSelect.js @@ -139,8 +139,8 @@ export default function CaseActionSelect(props) { sx={{ my: 0.5, display: 'flex', - flexDirection: 'row', - alignItems: 'center', + flexDirection: { xs: 'column', md: 'row' }, + alignItems: { xs: 'flex-start', md: 'center' }, }} > {getActionIcon(option, 36)} @@ -148,7 +148,8 @@ export default function CaseActionSelect(props) { sx={{ display: 'flex', flexDirection: 'column', - ml: 2, + mt: { xs: 1, md: 0 }, + ml: { xs: 0, md: 2 }, }} > diff --git a/components/form/widget/CaseRuleSelect.js b/components/form/widget/CaseRuleSelect.js index 775dfa6..e0c65ce 100644 --- a/components/form/widget/CaseRuleSelect.js +++ b/components/form/widget/CaseRuleSelect.js @@ -4,13 +4,14 @@ import { List, ListItemButton, Skeleton, - Stack, Typography, + useMediaQuery, } from '@mui/material'; import RuleEffects from 'components/law/RuleEffects'; import useJurisdiction from 'hooks/useJurisdiction'; import useToasts from 'hooks/useToasts'; import { useEffect, useState } from 'react'; +import { theme } from 'theme'; import { getActionIcon } from 'utils/metadata'; /** @@ -29,6 +30,7 @@ export default function CaseRuleSelect(props) { const { showToastError } = useToasts(); const { getJurisdictionRules } = useJurisdiction(); const [rules, setRules] = useState(null); + const isMediumDevice = useMediaQuery(theme.breakpoints.up('md')); useEffect(() => { if (propsJurisdiction && propsFormActionGuid) { @@ -53,34 +55,71 @@ export default function CaseRuleSelect(props) { {rules.map((rule, index) => ( { propsOnChange(rule.ruleId); }} > + {/* Action icon */} + {getActionIcon(propsFormAction, 36)} + {/* Rule details */} - - {getActionIcon(propsFormAction, 28)} - + {/* Rule negation, name, id */} + + {rule?.rule?.negation && ( + + NOT + + )} + {rule?.rule?.uriData?.name || 'None Name'} - - + + + {/* Rule description */} {rule?.rule?.uriData?.description && ( - + {rule.rule.uriData.description} )} - + {/* Rule effects */} + ))} diff --git a/components/law/LawCard.js b/components/law/LawCard.js index 8ec9f27..757300b 100644 --- a/components/law/LawCard.js +++ b/components/law/LawCard.js @@ -20,7 +20,6 @@ import { getActionIcon } from 'utils/metadata'; */ export default function LawCard({ law, isCommentsEnabled, sx }) { const { showDialog, closeDialog } = useDialogContext(); - return ( @@ -46,13 +45,33 @@ export default function LawCard({ law, isCommentsEnabled, sx }) { {law?.rules?.map((rule, index) => ( - {/* Rule name and id */} - - + {/* Rule id */} + + {/* Rule negation and name */} + + {rule?.rule?.negation && ( + + NOT + + )} + {rule?.rule?.uriData?.name || 'None Rule Name'} - - + {/* Rule description */} {rule?.rule?.uriData?.description && (