Skip to content

Commit

Permalink
fix(a11y): Feedback link as <a> element
Browse files Browse the repository at this point in the history
  • Loading branch information
ianjon3s committed May 9, 2024
1 parent 2d8c65b commit f635b19
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions editor.planx.uk/src/components/Feedback/FeedbackPhaseBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,22 @@ const Inner = styled(Box)(({ theme }) => ({
justifyContent: "space-between",
alignItems: "center",
flexWrap: "wrap",
gap: theme.spacing(1),
padding: theme.spacing(0.75, 0),
}));

const PhaseWrap = styled(Box)(({ theme }) => ({
display: "flex",
justifyContent: "start",
alignItems: "start",
flexDirection: "column",
textWrap: "balance",
padding: theme.spacing(0.5, 1, 0.5, 0),
gap: theme.spacing(0.5),
[theme.breakpoints.up("sm")]: {
flexDirection: "row",
gap: theme.spacing(1),
},
}));

const BetaFlag = styled(Box)(({ theme }) => ({
Expand All @@ -49,6 +57,11 @@ interface Props {
}

export default function PhaseBanner(props: Props): FCReturn {
const handleFeedbackClick = (event: React.MouseEvent<HTMLAnchorElement>) => {
event.preventDefault();
props.handleFeedbackClick();
};

return (
<Root>
<Container maxWidth="contentWrap">
Expand All @@ -61,7 +74,6 @@ export default function PhaseBanner(props: Props): FCReturn {
alignItems="flex-start"
flexBasis={0}
px={1}
mr={1}
py={0.5}
fontSize={14}
textAlign="center"
Expand All @@ -78,9 +90,9 @@ export default function PhaseBanner(props: Props): FCReturn {
>
This is a new service. Your{" "}
<Link
component={"button"}
href="#"
sx={{ verticalAlign: "top" }}
onClick={() => props.handleFeedbackClick()}
onClick={handleFeedbackClick}
>
feedback
</Link>{" "}
Expand Down

0 comments on commit f635b19

Please sign in to comment.