Skip to content

Commit

Permalink
restyle header
Browse files Browse the repository at this point in the history
  • Loading branch information
RODO94 committed Dec 19, 2024
1 parent 217e086 commit 11d6522
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions editor.planx.uk/src/@planx/components/ExternalPortal/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import ListItem from "@mui/material/ListItem";
import ListSubheader from "@mui/material/ListSubheader";
import MenuItem from "@mui/material/MenuItem";
import { styled } from "@mui/material/styles";
import Typography from "@mui/material/Typography";
import {
ComponentType as TYPES,
NodeTag,
Expand Down Expand Up @@ -44,12 +45,8 @@ type FlowAutocompleteInputProps = AutocompleteProps<
>;

const AutocompleteSubHeader = styled(ListSubheader)(({ theme }) => ({
fontWeight: FONT_WEIGHT_SEMI_BOLD,
fontSize: theme.typography.subtitle1.fontSize,
backgroundColor: theme.palette.background.dark,
color: theme.palette.getContrastText(theme.palette.background.dark),
margin: 0,
height: "100%",
borderTop: 1,
borderColor: theme.palette.border.main,
}));

const renderOption: FlowAutocompleteListProps["renderOption"] = (
Expand All @@ -59,7 +56,7 @@ const renderOption: FlowAutocompleteListProps["renderOption"] = (
<MenuItem
{...props}
key={option.id}
sx={(theme) => ({ paddingY: `${theme.spacing(1.25)} !important` })}
sx={(theme) => ({ paddingY: `${theme.spacing(1.25)}` })}
>
{option.name}
</MenuItem>
Expand All @@ -79,7 +76,9 @@ const renderInput: FlowAutocompleteInputProps["renderInput"] = (params) => (
const renderGroup: FlowAutocompleteListProps["renderGroup"] = (params) => (
<>
<AutocompleteSubHeader key={params.children?.toString()}>
{params.group}
<Typography py={1} variant="subtitle2" component="h4">
{params.group}
</Typography>
</AutocompleteSubHeader>
{params.children}
</>
Expand Down

0 comments on commit 11d6522

Please sign in to comment.