From c3cfe6ada1ffe1987506d9d2b4350f1ad3adafea Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Sun, 26 Oct 2025 15:39:33 +0000 Subject: [PATCH 01/17] client/modules/About/About.styles: update to ts, no-verify --- client/modules/About/{About.styles.js => About.styles.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename client/modules/About/{About.styles.js => About.styles.ts} (100%) diff --git a/client/modules/About/About.styles.js b/client/modules/About/About.styles.ts similarity index 100% rename from client/modules/About/About.styles.js rename to client/modules/About/About.styles.ts From 2db568dd89aba634b0e5d68d2751ea6db3fac2c3 Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Sun, 26 Oct 2025 15:40:20 +0000 Subject: [PATCH 02/17] client/modules/About/statics/aboutData: update to ts, no-verify --- client/modules/About/statics/{aboutData.js => aboutData.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename client/modules/About/statics/{aboutData.js => aboutData.ts} (100%) diff --git a/client/modules/About/statics/aboutData.js b/client/modules/About/statics/aboutData.ts similarity index 100% rename from client/modules/About/statics/aboutData.js rename to client/modules/About/statics/aboutData.ts From 607d9caa7c001f7858a6f703cf7f78fe85ad77de Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Sun, 26 Oct 2025 15:42:55 +0000 Subject: [PATCH 03/17] client/modules/About/statics/aboutData: define types --- client/modules/About/statics/aboutData.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/client/modules/About/statics/aboutData.ts b/client/modules/About/statics/aboutData.ts index a8623cfa7f..016bfb5821 100644 --- a/client/modules/About/statics/aboutData.ts +++ b/client/modules/About/statics/aboutData.ts @@ -1,4 +1,8 @@ -export const ContactSectionLinks = [ +export interface ContactSectionLink { + label: string; + href: string; +} +export const ContactSectionLinks: ContactSectionLink[] = [ { label: 'About.Github', href: 'https://github.com/processing/p5.js-web-editor' @@ -22,6 +26,15 @@ export const ContactSectionLinks = [ } ]; +export interface AboutSectionInfoItem { + url: string; + title: string; + description: string; +} +export interface AboutSectionInfoSections { + header: string; + items: AboutSectionInfoItem[]; +} export const AboutSectionInfo = [ { header: 'About.NewP5', From 9a63407445a36aed3e375092ad14a1792031751f Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Sun, 26 Oct 2025 15:44:17 +0000 Subject: [PATCH 04/17] client/modules/About/pages/About: update to ts, no-verify --- client/modules/About/pages/{About.jsx => About.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename client/modules/About/pages/{About.jsx => About.tsx} (100%) diff --git a/client/modules/About/pages/About.jsx b/client/modules/About/pages/About.tsx similarity index 100% rename from client/modules/About/pages/About.jsx rename to client/modules/About/pages/About.tsx From 66c04ae56ec7ebc5cd01507b19dd8fb8a29ee816 Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Sun, 26 Oct 2025 15:48:17 +0000 Subject: [PATCH 05/17] client/modules/About/pages/About: add types --- client/modules/About/pages/About.tsx | 29 +++++++++++++++++------ client/modules/About/statics/aboutData.ts | 4 ++-- client/routes.jsx | 2 +- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/client/modules/About/pages/About.tsx b/client/modules/About/pages/About.tsx index 840278cbb7..77ec2fb60a 100644 --- a/client/modules/About/pages/About.tsx +++ b/client/modules/About/pages/About.tsx @@ -5,6 +5,7 @@ import { Helmet } from 'react-helmet'; import { useTranslation } from 'react-i18next'; import { Link } from 'react-router-dom'; +import type { TFunction } from 'react-i18next'; import { AboutPageContent, Intro, @@ -27,8 +28,16 @@ import packageData from '../../../../package.json'; import HeartIcon from '../../../images/heart.svg'; import AsteriskIcon from '../../../images/p5-asterisk.svg'; import LogoIcon from '../../../images/p5js-square-logo.svg'; +import type { AboutSectionInfoSection } from '../statics/aboutData'; +import { RootState } from '../../../reducers'; -const AboutSection = ({ section, t }) => ( +const AboutSection = ({ + section, + t +}: { + section: AboutSectionInfoSection; + t: TFunction<'translation'>; +}) => (

{t(section.header)}

@@ -47,11 +56,15 @@ const AboutSection = ({ section, t }) => (
); -const About = () => { +export const About = () => { const { t } = useTranslation(); - const p5version = useSelector((state) => { - const index = state.files.find((file) => file.name === 'index.html'); + const p5version = useSelector((state: RootState) => { + const index = state.files.find( + (file: { + name: string /** TODO: update once files types are defined in server */; + }) => file.name === 'index.html' + ); return index?.content.match(/\/p5@([\d.]+)\//)?.[1]; }); @@ -91,7 +104,11 @@ const About = () => { {AboutSectionInfo.map((section) => ( - + ))} @@ -166,5 +183,3 @@ AboutSection.propTypes = { }).isRequired, t: PropTypes.func.isRequired }; - -export default About; diff --git a/client/modules/About/statics/aboutData.ts b/client/modules/About/statics/aboutData.ts index 016bfb5821..854ffaf259 100644 --- a/client/modules/About/statics/aboutData.ts +++ b/client/modules/About/statics/aboutData.ts @@ -31,11 +31,11 @@ export interface AboutSectionInfoItem { title: string; description: string; } -export interface AboutSectionInfoSections { +export interface AboutSectionInfoSection { header: string; items: AboutSectionInfoItem[]; } -export const AboutSectionInfo = [ +export const AboutSectionInfo: AboutSectionInfoSection[] = [ { header: 'About.NewP5', items: [ diff --git a/client/routes.jsx b/client/routes.jsx index 8926a95bdd..07e50a4653 100644 --- a/client/routes.jsx +++ b/client/routes.jsx @@ -6,7 +6,7 @@ import { Route as RouterRoute, Switch } from 'react-router-dom'; import App from './modules/App/App'; import IDEView from './modules/IDE/pages/IDEView'; import FullView from './modules/IDE/pages/FullView'; -import About from './modules/About/pages/About'; +import { About } from './modules/About/pages/About'; import CodeOfConduct from './modules/Legal/pages/CodeOfConduct'; import PrivacyPolicy from './modules/Legal/pages/PrivacyPolicy'; import TermsOfUse from './modules/Legal/pages/TermsOfUse'; From 303541b40bdee61aa299b40c349d68e300bccdfc Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Sun, 26 Oct 2025 22:18:15 +0000 Subject: [PATCH 06/17] PolicyContainer: update to ts, no-verify --- .../Legal/components/{PolicyContainer.jsx => PolicyContainer.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename client/modules/Legal/components/{PolicyContainer.jsx => PolicyContainer.tsx} (100%) diff --git a/client/modules/Legal/components/PolicyContainer.jsx b/client/modules/Legal/components/PolicyContainer.tsx similarity index 100% rename from client/modules/Legal/components/PolicyContainer.jsx rename to client/modules/Legal/components/PolicyContainer.tsx From 6dcaec295e16cf9c3a9dbfc6d5d0a3d884f9e217 Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Sun, 26 Oct 2025 22:18:53 +0000 Subject: [PATCH 07/17] PolicyContainer: add types & named export --- client/modules/Legal/components/PolicyContainer.tsx | 12 ++++-------- client/modules/Legal/pages/Legal.jsx | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/client/modules/Legal/components/PolicyContainer.tsx b/client/modules/Legal/components/PolicyContainer.tsx index fdc311d435..d4b1113856 100644 --- a/client/modules/Legal/components/PolicyContainer.tsx +++ b/client/modules/Legal/components/PolicyContainer.tsx @@ -2,7 +2,6 @@ import React from 'react'; import styled from 'styled-components'; import ReactMarkdown from 'react-markdown'; import remarkSlug from 'remark-slug'; -import PropTypes from 'prop-types'; import { remSize, prop } from '../../../theme'; const PolicyContainerMain = styled.main` @@ -48,16 +47,13 @@ const PolicyContainerMain = styled.main` } `; -function PolicyContainer({ policy }) { +export interface PolicyContainerProps { + policy: string; +} +export function PolicyContainer({ policy }: PolicyContainerProps) { return ( {policy} ); } - -PolicyContainer.propTypes = { - policy: PropTypes.string.isRequired -}; - -export default PolicyContainer; diff --git a/client/modules/Legal/pages/Legal.jsx b/client/modules/Legal/pages/Legal.jsx index 4ba5cb5bbc..e93255d62d 100644 --- a/client/modules/Legal/pages/Legal.jsx +++ b/client/modules/Legal/pages/Legal.jsx @@ -9,7 +9,7 @@ import { RootPage } from '../../../components/RootPage'; import { remSize } from '../../../theme'; import Loader from '../../App/components/loader'; import Nav from '../../IDE/components/Header/Nav'; -import PolicyContainer from '../components/PolicyContainer'; +import { PolicyContainer } from '../components/PolicyContainer'; const StyledTabList = styled.nav` display: flex; From b514e139c55b3a62d6a531d5db3126cce98e2de6 Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Sun, 26 Oct 2025 22:20:49 +0000 Subject: [PATCH 08/17] client/modules/Legal/pages/CodeOfConduct: update to ts, no-verify --- .../modules/Legal/pages/{CodeOfConduct.jsx => CodeOfConduct.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename client/modules/Legal/pages/{CodeOfConduct.jsx => CodeOfConduct.tsx} (100%) diff --git a/client/modules/Legal/pages/CodeOfConduct.jsx b/client/modules/Legal/pages/CodeOfConduct.tsx similarity index 100% rename from client/modules/Legal/pages/CodeOfConduct.jsx rename to client/modules/Legal/pages/CodeOfConduct.tsx From a6fc06bf1286a6e99f51b740775f112e9969c33a Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Sun, 26 Oct 2025 22:21:46 +0000 Subject: [PATCH 09/17] client/modules/Legal/pages/CodeOfConduct: update to named export, no types needed --- client/modules/Legal/pages/CodeOfConduct.tsx | 4 +--- client/routes.jsx | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/client/modules/Legal/pages/CodeOfConduct.tsx b/client/modules/Legal/pages/CodeOfConduct.tsx index c961ec74b6..7ab58ff148 100644 --- a/client/modules/Legal/pages/CodeOfConduct.tsx +++ b/client/modules/Legal/pages/CodeOfConduct.tsx @@ -2,12 +2,10 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; import Legal from './Legal'; -function CodeOfConduct() { +export function CodeOfConduct() { const { t } = useTranslation(); return ( ); } - -export default CodeOfConduct; diff --git a/client/routes.jsx b/client/routes.jsx index 07e50a4653..dbd0c36912 100644 --- a/client/routes.jsx +++ b/client/routes.jsx @@ -7,7 +7,7 @@ import App from './modules/App/App'; import IDEView from './modules/IDE/pages/IDEView'; import FullView from './modules/IDE/pages/FullView'; import { About } from './modules/About/pages/About'; -import CodeOfConduct from './modules/Legal/pages/CodeOfConduct'; +import { CodeOfConduct } from './modules/Legal/pages/CodeOfConduct'; import PrivacyPolicy from './modules/Legal/pages/PrivacyPolicy'; import TermsOfUse from './modules/Legal/pages/TermsOfUse'; import LoginView from './modules/User/pages/LoginView'; From e10a24e7960b74311f98518f654b0801b28b5df6 Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Sun, 26 Oct 2025 22:22:37 +0000 Subject: [PATCH 10/17] client/modules/Legal/pages/Legal: update to ts, no-verify --- client/modules/Legal/pages/{Legal.jsx => Legal.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename client/modules/Legal/pages/{Legal.jsx => Legal.tsx} (100%) diff --git a/client/modules/Legal/pages/Legal.jsx b/client/modules/Legal/pages/Legal.tsx similarity index 100% rename from client/modules/Legal/pages/Legal.jsx rename to client/modules/Legal/pages/Legal.tsx From 99e53cfb5e0ad5d0a5239a0b0aab6dde33d3db59 Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Sun, 26 Oct 2025 22:24:51 +0000 Subject: [PATCH 11/17] client/modules/Legal/pages/Legal: add types & update to named export --- client/modules/Legal/pages/CodeOfConduct.tsx | 2 +- client/modules/Legal/pages/Legal.tsx | 11 +++++++---- client/modules/Legal/pages/PrivacyPolicy.jsx | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/client/modules/Legal/pages/CodeOfConduct.tsx b/client/modules/Legal/pages/CodeOfConduct.tsx index 7ab58ff148..d05e4bb78a 100644 --- a/client/modules/Legal/pages/CodeOfConduct.tsx +++ b/client/modules/Legal/pages/CodeOfConduct.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; -import Legal from './Legal'; +import { Legal } from './Legal'; export function CodeOfConduct() { const { t } = useTranslation(); diff --git a/client/modules/Legal/pages/Legal.tsx b/client/modules/Legal/pages/Legal.tsx index e93255d62d..69141a4205 100644 --- a/client/modules/Legal/pages/Legal.tsx +++ b/client/modules/Legal/pages/Legal.tsx @@ -21,8 +21,13 @@ const StyledTabList = styled.nav` gap: ${remSize(19)}; } `; - -function Legal({ policyFile, title }) { +export interface LegalProps { + /** File name of policy */ + policyFile: string; + /** Title of policy */ + title: string; +} +export function Legal({ policyFile, title }: LegalProps) { const { t } = useTranslation(); const [isLoading, setIsLoading] = useState(true); const [policy, setPolicy] = useState(''); @@ -67,5 +72,3 @@ Legal.propTypes = { */ policyFile: PropTypes.string.isRequired }; - -export default Legal; diff --git a/client/modules/Legal/pages/PrivacyPolicy.jsx b/client/modules/Legal/pages/PrivacyPolicy.jsx index ef39ed876c..3612b46ec3 100644 --- a/client/modules/Legal/pages/PrivacyPolicy.jsx +++ b/client/modules/Legal/pages/PrivacyPolicy.jsx @@ -1,6 +1,6 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; -import Legal from './Legal'; +import { Legal } from './Legal'; function PrivacyPolicy() { const { t } = useTranslation(); From b0d404ebf792dcf11ca70313b32565a79de7d2b9 Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Sun, 26 Oct 2025 22:27:27 +0000 Subject: [PATCH 12/17] client/modules/Legal/pages/PrivacyPolicy: update to ts, no-verify --- .../modules/Legal/pages/{PrivacyPolicy.jsx => PrivacyPolicy.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename client/modules/Legal/pages/{PrivacyPolicy.jsx => PrivacyPolicy.tsx} (100%) diff --git a/client/modules/Legal/pages/PrivacyPolicy.jsx b/client/modules/Legal/pages/PrivacyPolicy.tsx similarity index 100% rename from client/modules/Legal/pages/PrivacyPolicy.jsx rename to client/modules/Legal/pages/PrivacyPolicy.tsx From 3fe0dd31fb514dc485f615b620cc1b7ba5e1bcf2 Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Sun, 26 Oct 2025 22:27:59 +0000 Subject: [PATCH 13/17] client/modules/Legal/pages/PrivacyPolicy: update to named export, no types needed --- client/modules/Legal/pages/PrivacyPolicy.tsx | 4 +--- client/routes.jsx | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/client/modules/Legal/pages/PrivacyPolicy.tsx b/client/modules/Legal/pages/PrivacyPolicy.tsx index 3612b46ec3..178736709c 100644 --- a/client/modules/Legal/pages/PrivacyPolicy.tsx +++ b/client/modules/Legal/pages/PrivacyPolicy.tsx @@ -2,12 +2,10 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; import { Legal } from './Legal'; -function PrivacyPolicy() { +export function PrivacyPolicy() { const { t } = useTranslation(); return ( ); } - -export default PrivacyPolicy; diff --git a/client/routes.jsx b/client/routes.jsx index dbd0c36912..0cd1492e86 100644 --- a/client/routes.jsx +++ b/client/routes.jsx @@ -8,7 +8,7 @@ import IDEView from './modules/IDE/pages/IDEView'; import FullView from './modules/IDE/pages/FullView'; import { About } from './modules/About/pages/About'; import { CodeOfConduct } from './modules/Legal/pages/CodeOfConduct'; -import PrivacyPolicy from './modules/Legal/pages/PrivacyPolicy'; +import { PrivacyPolicy } from './modules/Legal/pages/PrivacyPolicy'; import TermsOfUse from './modules/Legal/pages/TermsOfUse'; import LoginView from './modules/User/pages/LoginView'; import SignupView from './modules/User/pages/SignupView'; From 702a57e52c17d8bc2e1e164fae24350f38202d58 Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Sun, 26 Oct 2025 22:29:27 +0000 Subject: [PATCH 14/17] client/modules/Legal/pages/TermsOfUse: update to ts, no-verify --- client/modules/Legal/pages/{TermsOfUse.jsx => TermsOfUse.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename client/modules/Legal/pages/{TermsOfUse.jsx => TermsOfUse.tsx} (100%) diff --git a/client/modules/Legal/pages/TermsOfUse.jsx b/client/modules/Legal/pages/TermsOfUse.tsx similarity index 100% rename from client/modules/Legal/pages/TermsOfUse.jsx rename to client/modules/Legal/pages/TermsOfUse.tsx From e4093553266cc6eb171426eac8df0ac21559208f Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Sun, 26 Oct 2025 22:30:11 +0000 Subject: [PATCH 15/17] client/modules/Legal/pages/TermsOfUse: update to named export, no types necessary --- client/modules/Legal/pages/TermsOfUse.tsx | 6 ++---- client/routes.jsx | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/client/modules/Legal/pages/TermsOfUse.tsx b/client/modules/Legal/pages/TermsOfUse.tsx index 6b3b553942..45bbfd93a3 100644 --- a/client/modules/Legal/pages/TermsOfUse.tsx +++ b/client/modules/Legal/pages/TermsOfUse.tsx @@ -1,11 +1,9 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; -import Legal from './Legal'; +import { Legal } from './Legal'; -function TermsOfUse() { +export function TermsOfUse() { const { t } = useTranslation(); return ; } - -export default TermsOfUse; diff --git a/client/routes.jsx b/client/routes.jsx index 0cd1492e86..2195d95da2 100644 --- a/client/routes.jsx +++ b/client/routes.jsx @@ -9,7 +9,7 @@ import FullView from './modules/IDE/pages/FullView'; import { About } from './modules/About/pages/About'; import { CodeOfConduct } from './modules/Legal/pages/CodeOfConduct'; import { PrivacyPolicy } from './modules/Legal/pages/PrivacyPolicy'; -import TermsOfUse from './modules/Legal/pages/TermsOfUse'; +import { TermsOfUse } from './modules/Legal/pages/TermsOfUse'; import LoginView from './modules/User/pages/LoginView'; import SignupView from './modules/User/pages/SignupView'; import ResetPasswordView from './modules/User/pages/ResetPasswordView'; From 8072ef65fc8461f4627a9326bc9f8e975f31fd78 Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Mon, 27 Oct 2025 00:45:49 +0000 Subject: [PATCH 16/17] client/modules/About & client/modules/Legal: clean up Proptypes --- client/modules/About/pages/About.tsx | 35 ++++++++++++----------- client/modules/About/statics/aboutData.ts | 18 ++++-------- client/modules/Legal/pages/Legal.tsx | 22 +++++--------- 3 files changed, 31 insertions(+), 44 deletions(-) diff --git a/client/modules/About/pages/About.tsx b/client/modules/About/pages/About.tsx index 77ec2fb60a..84935a0141 100644 --- a/client/modules/About/pages/About.tsx +++ b/client/modules/About/pages/About.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import { Helmet } from 'react-helmet'; import { useTranslation } from 'react-i18next'; @@ -28,9 +27,27 @@ import packageData from '../../../../package.json'; import HeartIcon from '../../../images/heart.svg'; import AsteriskIcon from '../../../images/p5-asterisk.svg'; import LogoIcon from '../../../images/p5js-square-logo.svg'; -import type { AboutSectionInfoSection } from '../statics/aboutData'; import { RootState } from '../../../reducers'; +export interface AboutSectionInfoItem { + url: string; + title: string; + description: string; +} +export interface AboutSectionInfoSection { + header: string; + items: AboutSectionInfoItem[]; +} +export interface ContactSectionLink { + label: string; + href: string; +} + +export interface AboutSectionProps { + section: AboutSectionInfoSection; + t: TFunction<'translation'>; +} + const AboutSection = ({ section, t @@ -169,17 +186,3 @@ export const About = () => { ); }; - -AboutSection.propTypes = { - section: PropTypes.shape({ - header: PropTypes.string.isRequired, - items: PropTypes.arrayOf( - PropTypes.shape({ - url: PropTypes.string.isRequired, - title: PropTypes.string.isRequired, - description: PropTypes.string.isRequired - }) - ).isRequired - }).isRequired, - t: PropTypes.func.isRequired -}; diff --git a/client/modules/About/statics/aboutData.ts b/client/modules/About/statics/aboutData.ts index 854ffaf259..d22e6e75fe 100644 --- a/client/modules/About/statics/aboutData.ts +++ b/client/modules/About/statics/aboutData.ts @@ -1,7 +1,8 @@ -export interface ContactSectionLink { - label: string; - href: string; -} +import type { + ContactSectionLink, + AboutSectionInfoSection +} from '../pages/About'; + export const ContactSectionLinks: ContactSectionLink[] = [ { label: 'About.Github', @@ -26,15 +27,6 @@ export const ContactSectionLinks: ContactSectionLink[] = [ } ]; -export interface AboutSectionInfoItem { - url: string; - title: string; - description: string; -} -export interface AboutSectionInfoSection { - header: string; - items: AboutSectionInfoItem[]; -} export const AboutSectionInfo: AboutSectionInfoSection[] = [ { header: 'About.NewP5', diff --git a/client/modules/Legal/pages/Legal.tsx b/client/modules/Legal/pages/Legal.tsx index 69141a4205..09db520f66 100644 --- a/client/modules/Legal/pages/Legal.tsx +++ b/client/modules/Legal/pages/Legal.tsx @@ -1,5 +1,4 @@ import axios from 'axios'; -import PropTypes from 'prop-types'; import React, { useEffect, useState } from 'react'; import Helmet from 'react-helmet'; import { useTranslation } from 'react-i18next'; @@ -22,9 +21,14 @@ const StyledTabList = styled.nav` } `; export interface LegalProps { - /** File name of policy */ + /** + * Path of the markdown '.md' file, relative to the /public directory. + */ policyFile: string; - /** Title of policy */ + /** + * Used in the HTML tag. + * TODO: pass this to the Nav to use as the mobile title. + */ title: string; } export function Legal({ policyFile, title }: LegalProps) { @@ -60,15 +64,3 @@ export function Legal({ policyFile, title }: LegalProps) { </RootPage> ); } - -Legal.propTypes = { - /** - * Used in the HTML <title> tag. - * TODO: pass this to the Nav to use as the mobile title. - */ - title: PropTypes.string.isRequired, - /** - * Path of the markdown '.md' file, relative to the /public directory. - */ - policyFile: PropTypes.string.isRequired -}; From 6722bf6286a42baa33294528fb0f813fca221609 Mon Sep 17 00:00:00 2001 From: Claire Peng <clairepeng94@gmail.com> Date: Mon, 27 Oct 2025 03:16:55 +0000 Subject: [PATCH 17/17] package.json: add react-helmet types --- package-lock.json | 20 ++++++++++++++++++++ package.json | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 9edffa05e9..f948e6f8dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -171,6 +171,7 @@ "@types/passport": "^1.0.17", "@types/react": "^16.14.0", "@types/react-dom": "^16.9.25", + "@types/react-helmet": "^6.1.11", "@types/react-router-dom": "^5.3.3", "@types/sinon": "^17.0.4", "@types/styled-components": "^5.1.34", @@ -16646,6 +16647,16 @@ "@types/react": "^16.0.0" } }, + "node_modules/@types/react-helmet": { + "version": "6.1.11", + "resolved": "https://registry.npmjs.org/@types/react-helmet/-/react-helmet-6.1.11.tgz", + "integrity": "sha512-0QcdGLddTERotCXo3VFlUSWO3ztraw8nZ6e3zJSgG7apwV5xt+pJUS8ewPBqT4NYB1optGLprNQzFleIY84u/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/react": "*" + } + }, "node_modules/@types/react-redux": { "version": "7.1.18", "resolved": "https://registry.npmjs.org/@types/react-redux/-/react-redux-7.1.18.tgz", @@ -53346,6 +53357,15 @@ "dev": true, "requires": {} }, + "@types/react-helmet": { + "version": "6.1.11", + "resolved": "https://registry.npmjs.org/@types/react-helmet/-/react-helmet-6.1.11.tgz", + "integrity": "sha512-0QcdGLddTERotCXo3VFlUSWO3ztraw8nZ6e3zJSgG7apwV5xt+pJUS8ewPBqT4NYB1optGLprNQzFleIY84u/g==", + "dev": true, + "requires": { + "@types/react": "*" + } + }, "@types/react-redux": { "version": "7.1.18", "resolved": "https://registry.npmjs.org/@types/react-redux/-/react-redux-7.1.18.tgz", diff --git a/package.json b/package.json index 643d468aa3..df7a8dc603 100644 --- a/package.json +++ b/package.json @@ -144,9 +144,9 @@ "@types/nodemailer": "^7.0.1", "@types/nodemailer-mailgun-transport": "^1.4.6", "@types/passport": "^1.0.17", - "@types/passport": "^1.0.17", "@types/react": "^16.14.0", "@types/react-dom": "^16.9.25", + "@types/react-helmet": "^6.1.11", "@types/react-router-dom": "^5.3.3", "@types/sinon": "^17.0.4", "@types/styled-components": "^5.1.34",