Skip to content

Commit ac431ad

Browse files
committed
feat: show more context in document title for pipes and tiles
1 parent ba6619c commit ac431ad

File tree

7 files changed

+56
-2
lines changed

7 files changed

+56
-2
lines changed

package-lock.json

Lines changed: 34 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/frontend/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"luxon": "^2.3.1",
4747
"node-html-parser": "6.1.13",
4848
"papaparse": "5.4.1",
49+
"react-helmet": "6.1.0",
4950
"react-hook-form": "^7.17.2",
5051
"react-icons": "^4.12.0",
5152
"react-json-tree": "^0.18.0",
@@ -68,6 +69,7 @@
6869
"@types/papaparse": "^5.3.14",
6970
"@types/react": "^18.0.27",
7071
"@types/react-dom": "^18.0.10",
72+
"@types/react-helmet": "^6.1.11",
7173
"@typescript-eslint/eslint-plugin": "^5.9.1",
7274
"@typescript-eslint/parser": "^5.9.1",
7375
"@vitejs/plugin-react": "^4.5.1",

packages/frontend/src/components/EditorLayout/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { IFlow } from '@plumber/types'
22

33
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
4+
import { Helmet } from 'react-helmet'
45
import { BiChevronLeft, BiCog, BiInfoCircle } from 'react-icons/bi'
56
import { Link, useNavigate, useParams, useSearchParams } from 'react-router-dom'
67
import { ApolloError, useMutation, useQuery } from '@apollo/client'
@@ -190,6 +191,9 @@ export default function EditorLayout() {
190191

191192
return (
192193
<>
194+
<Helmet>
195+
<title>{flow?.name} | Pipe</title>
196+
</Helmet>
193197
<Flex h="100vh" flexDirection="column">
194198
<HStack
195199
position="fixed"

packages/frontend/src/components/Layout/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useMemo, useState } from 'react'
2+
import { Helmet } from 'react-helmet'
23
import {
34
BiBookOpen,
45
BiBookReader,
@@ -97,6 +98,9 @@ export default function Layout({ children }: PublicLayoutProps): JSX.Element {
9798
return (
9899
<>
99100
<SiteWideBanner />
101+
<Helmet>
102+
<title>Plumber</title>
103+
</Helmet>
100104
<LayoutNavigationProvider value={layoutNavigationProviderData}>
101105
<AppBar />
102106
<Box display="flex" flex="1">

packages/frontend/src/components/PublicLayout/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Helmet } from 'react-helmet'
12
import { Navigate } from 'react-router-dom'
23
import { Box, Flex } from '@chakra-ui/react'
34
import { RestrictedGovtMasthead } from '@opengovsg/design-system-react'
@@ -22,6 +23,9 @@ export default function Layout({ children }: LayoutProps): React.ReactElement {
2223
<Flex minH="100vh" flexDir="column">
2324
<SiteWideBanner />
2425
<RestrictedGovtMasthead />
26+
<Helmet>
27+
<title>Plumber</title>
28+
</Helmet>
2529
<Box
2630
sx={{
2731
display: 'flex',

packages/frontend/src/pages/Tile/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ITableMetadata } from '@plumber/types'
22

33
import { useEffect } from 'react'
4+
import { Helmet } from 'react-helmet'
45
import { useParams } from 'react-router-dom'
56
import { ApolloError, useQuery } from '@apollo/client'
67
import { Center, Flex } from '@chakra-ui/react'
@@ -96,6 +97,9 @@ export default function Tile(): JSX.Element | null {
9697
isThroughputError={isThroughputError}
9798
refetch={refetch}
9899
>
100+
<Helmet>
101+
<title>{name} | Tile</title>
102+
</Helmet>
99103
<Flex
100104
flexDir={{ base: 'column' }}
101105
justifyContent="space-between"

packages/frontend/src/pages/Transfers/layouts/TransfersLayout.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Helmet } from 'react-helmet'
12
import { Box } from '@chakra-ui/react'
23

34
import AppBar from '@/components/AppBar'
@@ -20,6 +21,9 @@ export default function TransfersLayout(props: TransfersLayoutProps) {
2021
return (
2122
<>
2223
<SiteWideBanner />
24+
<Helmet>
25+
<title>Plumber</title>
26+
</Helmet>
2327
<AppBar />
2428
<Box>{children}</Box>
2529
</>

0 commit comments

Comments
 (0)