From be5d7fef58d144a280ff89daf042d769d5e38cfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Wed, 18 Oct 2023 08:27:48 +0100 Subject: [PATCH] chore: Linting --- .../src/@planx/components/NextSteps/Public.tsx | 6 +----- .../pages/FlowEditor/lib/analyticsProvider.tsx | 2 +- editor.planx.uk/src/pages/Preview/StatusPage.tsx | 4 +++- editor.planx.uk/src/ui/NextStepsList.tsx | 16 ++++++++++------ 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/editor.planx.uk/src/@planx/components/NextSteps/Public.tsx b/editor.planx.uk/src/@planx/components/NextSteps/Public.tsx index 9b534dd75d..194c2b34f6 100644 --- a/editor.planx.uk/src/@planx/components/NextSteps/Public.tsx +++ b/editor.planx.uk/src/@planx/components/NextSteps/Public.tsx @@ -1,5 +1,4 @@ import { PublicProps } from "@planx/components/ui"; - import React from "react"; import NextStepsList from "ui/NextStepsList"; @@ -19,10 +18,7 @@ const NextStepsComponent: React.FC = (props) => { policyRef={props.policyRef} howMeasured={props.howMeasured} /> - + ); }; diff --git a/editor.planx.uk/src/pages/FlowEditor/lib/analyticsProvider.tsx b/editor.planx.uk/src/pages/FlowEditor/lib/analyticsProvider.tsx index 3aef3a108f..e7d88a68a8 100644 --- a/editor.planx.uk/src/pages/FlowEditor/lib/analyticsProvider.tsx +++ b/editor.planx.uk/src/pages/FlowEditor/lib/analyticsProvider.tsx @@ -10,7 +10,7 @@ export type AnalyticsType = "init" | "resume"; type AnalyticsLogDirection = AnalyticsType | "forwards" | "backwards"; export type HelpClickMetadata = Record; -export type SelectedUrlsMetadata = Record<'selectedUrls', string[]>; +export type SelectedUrlsMetadata = Record<"selectedUrls", string[]>; let lastAnalyticsLogId: number | undefined = undefined; diff --git a/editor.planx.uk/src/pages/Preview/StatusPage.tsx b/editor.planx.uk/src/pages/Preview/StatusPage.tsx index 898fb0a494..9f80b4003c 100644 --- a/editor.planx.uk/src/pages/Preview/StatusPage.tsx +++ b/editor.planx.uk/src/pages/Preview/StatusPage.tsx @@ -96,7 +96,9 @@ const StatusPage: React.FC = ({ onClick={removeSessionIdSearchParam} sx={contentFlowSpacing} > - Start new application + + Start new application + )} diff --git a/editor.planx.uk/src/ui/NextStepsList.tsx b/editor.planx.uk/src/ui/NextStepsList.tsx index e7feb561f1..5d8bf5b3a8 100644 --- a/editor.planx.uk/src/ui/NextStepsList.tsx +++ b/editor.planx.uk/src/ui/NextStepsList.tsx @@ -80,7 +80,11 @@ function LinkStep(props: ListItemProps) { href={props.url} target="_blank" rel="noopener" - onClick={() => props.handleSelectingUrl && props.url && props.handleSelectingUrl(props.url)} + onClick={() => + props.handleSelectingUrl && + props.url && + props.handleSelectingUrl(props.url) + } > @@ -119,19 +123,19 @@ const Step = ({ title, description, url }: ListItemProps) => ( function NextStepsList(props: NextStepsListProps) { const [selectedUrls, setSelectedUrls] = useState([]); - const { trackNextStepsLinkClick } = useAnalyticsTracking() + const { trackNextStepsLinkClick } = useAnalyticsTracking(); const handleSelectingUrl = (newUrl: string) => { - setSelectedUrls(prevSelectedUrls => [...prevSelectedUrls, newUrl]); - trackNextStepsLinkClick({'selectedUrls': [...selectedUrls, newUrl]}) - } + setSelectedUrls((prevSelectedUrls) => [...prevSelectedUrls, newUrl]); + trackNextStepsLinkClick({ selectedUrls: [...selectedUrls, newUrl] }); + }; return ( {props.steps?.map((step, i) => ( {step.url ? ( - + ) : ( )}