Skip to content

Commit

Permalink
chore: Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed Oct 18, 2023
1 parent 9303fe0 commit be5d7fe
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
6 changes: 1 addition & 5 deletions editor.planx.uk/src/@planx/components/NextSteps/Public.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { PublicProps } from "@planx/components/ui";

import React from "react";
import NextStepsList from "ui/NextStepsList";

Expand All @@ -19,10 +18,7 @@ const NextStepsComponent: React.FC<Props> = (props) => {
policyRef={props.policyRef}
howMeasured={props.howMeasured}
/>
<NextStepsList
steps={props.steps}
handleSubmit={props.handleSubmit}
/>
<NextStepsList steps={props.steps} handleSubmit={props.handleSubmit} />
</Card>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type AnalyticsType = "init" | "resume";
type AnalyticsLogDirection = AnalyticsType | "forwards" | "backwards";

export type HelpClickMetadata = Record<string, string>;
export type SelectedUrlsMetadata = Record<'selectedUrls', string[]>;
export type SelectedUrlsMetadata = Record<"selectedUrls", string[]>;

let lastAnalyticsLogId: number | undefined = undefined;

Expand Down
4 changes: 3 additions & 1 deletion editor.planx.uk/src/pages/Preview/StatusPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ const StatusPage: React.FC<Props> = ({
onClick={removeSessionIdSearchParam}
sx={contentFlowSpacing}
>
<Typography variant="body1" align="left">Start new application</Typography>
<Typography variant="body1" align="left">
Start new application
</Typography>
</Link>
</>
)}
Expand Down
16 changes: 10 additions & 6 deletions editor.planx.uk/src/ui/NextStepsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
>
<Step {...props} />
</InnerLink>
Expand Down Expand Up @@ -119,19 +123,19 @@ const Step = ({ title, description, url }: ListItemProps) => (

function NextStepsList(props: NextStepsListProps) {
const [selectedUrls, setSelectedUrls] = useState<string[]>([]);
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 (
<Root>
{props.steps?.map((step, i) => (
<StyledListItem key={i}>
{step.url ? (
<LinkStep {...step} handleSelectingUrl={handleSelectingUrl}/>
<LinkStep {...step} handleSelectingUrl={handleSelectingUrl} />
) : (
<ContinueStep {...step} handleSubmit={props.handleSubmit} />
)}
Expand Down

0 comments on commit be5d7fe

Please sign in to comment.