From 9d3b8a440d7a396ace8bea03c2663336a2c15d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Wed, 10 Jan 2024 09:26:58 +0000 Subject: [PATCH] chore: `pnpm lint:fix` in `editor.planx.uk` [skip pizza] (#2647) --- editor.planx.uk/src/components/Header.tsx | 8 +--- .../FlowEditor/components/Settings/index.tsx | 20 ++++----- editor.planx.uk/src/routes/flowSettings.tsx | 42 ++++++++++--------- editor.planx.uk/src/routes/teamSettings.tsx | 15 ++++--- editor.planx.uk/src/routes/utils.ts | 3 +- 5 files changed, 43 insertions(+), 45 deletions(-) diff --git a/editor.planx.uk/src/components/Header.tsx b/editor.planx.uk/src/components/Header.tsx index 341b1b01c3..861462947c 100644 --- a/editor.planx.uk/src/components/Header.tsx +++ b/editor.planx.uk/src/components/Header.tsx @@ -496,12 +496,8 @@ const EditorToolbar: React.FC<{ )} {/* Only show team settings link if inside a team route */} - {(route.data.team && !route.data.flow) &&( - - navigate(`${rootTeamPath()}/settings`) - } - > + {route.data.team && !route.data.flow && ( + navigate(`${rootTeamPath()}/settings`)}> Team Settings )} diff --git a/editor.planx.uk/src/pages/FlowEditor/components/Settings/index.tsx b/editor.planx.uk/src/pages/FlowEditor/components/Settings/index.tsx index 82bb74b24e..77dec54b29 100644 --- a/editor.planx.uk/src/pages/FlowEditor/components/Settings/index.tsx +++ b/editor.planx.uk/src/pages/FlowEditor/components/Settings/index.tsx @@ -8,16 +8,16 @@ import { styled } from "@mui/material/styles"; import Tab from "@mui/material/Tab"; import Tabs from "@mui/material/Tabs"; import { HEADER_HEIGHT } from "components/Header"; -import React from "react"; +import React from "react"; import { Link, useNavigation } from "react-navi"; interface SettingsProps { - currentTab: string, + currentTab: string; tabs: { - route: string, - name: string, - Component: React.FC, - }[] + route: string; + name: string; + Component: React.FC; + }[]; } interface TabPanelProps { @@ -131,14 +131,14 @@ const Settings: React.FC = ({ currentTab, tabs }) => { indicator: classes.tabIndicator, }} > - {tabs.map(({ name, route }, index) => + {tabs.map(({ name, route }, index) => ( - )} + ))} @@ -153,11 +153,11 @@ const Settings: React.FC = ({ currentTab, tabs }) => { - {tabs.map(({ name, Component }, index) => + {tabs.map(({ name, Component }, index) => ( - )} + ))} ); }; diff --git a/editor.planx.uk/src/routes/flowSettings.tsx b/editor.planx.uk/src/routes/flowSettings.tsx index 6cc8ff7c5a..3f746ab77f 100644 --- a/editor.planx.uk/src/routes/flowSettings.tsx +++ b/editor.planx.uk/src/routes/flowSettings.tsx @@ -47,26 +47,28 @@ const flowSettingsRoutes = compose( title: makeTitle( [req.params.team, req.params.flow, "Flow Settings"].join("/"), ), - view: , + view: ( + + ), }; }), }), diff --git a/editor.planx.uk/src/routes/teamSettings.tsx b/editor.planx.uk/src/routes/teamSettings.tsx index 8a8ee2bb8a..74d2400a6e 100644 --- a/editor.planx.uk/src/routes/teamSettings.tsx +++ b/editor.planx.uk/src/routes/teamSettings.tsx @@ -1,4 +1,3 @@ - import { compose, mount, redirect, route, withData } from "navi"; import DesignSettings from "pages/FlowEditor/components/Settings/DesignSettings"; import TeamSettings from "pages/FlowEditor/components/Settings/TeamSettings"; @@ -9,16 +8,15 @@ import { makeTitle } from "./utils"; const flowSettingsRoutes = compose( withData((req) => ({ - mountpath: req.mountpath + mountpath: req.mountpath, })), mount({ "/": redirect("./team"), "/:tab": route(async (req) => ({ - title: makeTitle( - [req.params.team, "Team Settings"].join("/"), - ), - view: , - })) + /> + ), + })), }), ); diff --git a/editor.planx.uk/src/routes/utils.ts b/editor.planx.uk/src/routes/utils.ts index 556daef159..d058d40df7 100644 --- a/editor.planx.uk/src/routes/utils.ts +++ b/editor.planx.uk/src/routes/utils.ts @@ -15,7 +15,8 @@ export const rootFlowPath = (includePortals = false) => { return includePortals ? path : path.split(",")[0]; }; -export const rootTeamPath = () => window.location.pathname.split("/").slice(0, 2).join("/"); +export const rootTeamPath = () => + window.location.pathname.split("/").slice(0, 2).join("/"); export const isSaveReturnFlow = (flowData: Record): boolean => Boolean(