diff --git a/editor.planx.uk/src/@planx/components/PlanningConstraints/List.tsx b/editor.planx.uk/src/@planx/components/PlanningConstraints/List.tsx index 0a571e3947..4169ecb00a 100644 --- a/editor.planx.uk/src/@planx/components/PlanningConstraints/List.tsx +++ b/editor.planx.uk/src/@planx/components/PlanningConstraints/List.tsx @@ -16,6 +16,7 @@ import type { import groupBy from "lodash/groupBy"; import React, { ReactNode } from "react"; import ReactHtmlParser from "react-html-parser"; +import { FONT_WEIGHT_SEMI_BOLD } from "theme"; import Caret from "ui/icons/Caret"; import ReactMarkdownOrHtml from "ui/shared/ReactMarkdownOrHtml"; @@ -30,20 +31,22 @@ const CATEGORY_COLORS: Record = { const PREFIX = "ConstraintsList"; const classes = { - content: `${PREFIX}-content` -} + content: `${PREFIX}-content`, +}; interface StyledAccordionProps extends BoxProps { category: string; } const StyledAccordion = styled(Accordion, { - shouldForwardProp: (prop) => !["category", "metadata", "content", "data"].includes(prop as string), + shouldForwardProp: (prop) => + !["category", "metadata", "content", "data"].includes(prop as string), })(({ theme, category }) => ({ borderLeft: `5px solid ${CATEGORY_COLORS[category]}`, paddingRight: 0, width: "100%", position: "relative", + background: CATEGORY_COLORS[category], "&::after": { content: "''", position: "absolute", @@ -54,7 +57,7 @@ const StyledAccordion = styled(Accordion, { background: theme.palette.border.main, }, [`&.${classes.content}`]: { - margin: [1.5, 0] + margin: [1.5, 0], }, })); @@ -94,9 +97,9 @@ export default function ConstraintsList({ py={1} px={2} pl={2.5} - style={{ - fontWeight: 700, - color: "black", + sx={{ + fontWeight: FONT_WEIGHT_SEMI_BOLD, + color: (theme) => theme.palette.text.primary, }} > {category} @@ -142,13 +145,21 @@ function ConstraintListItem({ children, ...props }: ConstraintListItemProps) { aria-controls={`${item}-panel`} classes={{ content: classes.content }} expandIcon={} - sx={{ pr: 1.5 }} + sx={{ pr: 1.5, background: `rgba(255, 255, 255, 0.8)` }} > - {children} + + {children} + - + theme.palette.background.default, + }} + > <> - + {`This property ${props?.content}`} {Boolean(props.data?.length) && ( diff --git a/editor.planx.uk/src/@planx/components/PlanningConstraints/Public.tsx b/editor.planx.uk/src/@planx/components/PlanningConstraints/Public.tsx index 00d7a6ed28..5a857226ae 100644 --- a/editor.planx.uk/src/@planx/components/PlanningConstraints/Public.tsx +++ b/editor.planx.uk/src/@planx/components/PlanningConstraints/Public.tsx @@ -14,7 +14,6 @@ import { useStore } from "pages/FlowEditor/lib/store"; import { handleSubmit } from "pages/Preview/Node"; import React from "react"; import useSWR, { Fetcher } from "swr"; -import { FONT_WEIGHT_SEMI_BOLD } from "theme"; import ReactMarkdownOrHtml from "ui/shared/ReactMarkdownOrHtml"; import { stringify } from "wkt"; @@ -236,7 +235,7 @@ export function PlanningConstraintsContent( )} {!showError && positiveConstraints.length > 0 && ( <> - + These are the planning constraints we think apply to this property @@ -258,15 +257,15 @@ export function PlanningConstraintsContent( positiveConstraints.length === 0 && negativeConstraints.length > 0 && ( <> - + It looks like there are no constraints on this property - + Based on the information you've given it looks like there are no planning constraints on your property that might limit what you can do. - + Continue with your application to tell us more about your project. > = ({ const [show, setShow] = React.useState(false); return ( <> - + setShow(!show)} aria-expanded={show}