From ff639aab4f2901d6be3f59429ae4325d9485ace3 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 29 May 2022 20:41:32 -0700 Subject: [PATCH] Update page title --- packages/webapp/src/app.tsx | 1 + .../src/components/editor-page/index.tsx | 2 +- .../components/forgot-password-page/index.tsx | 4 +-- .../src/components/login-page/index.tsx | 8 ++--- .../webapp/src/components/maps-page/index.tsx | 30 +++++++++---------- .../components/registration-page/index.tsx | 4 +-- 6 files changed, 25 insertions(+), 24 deletions(-) diff --git a/packages/webapp/src/app.tsx b/packages/webapp/src/app.tsx index 5902dce0..b1b905f9 100644 --- a/packages/webapp/src/app.tsx +++ b/packages/webapp/src/app.tsx @@ -32,6 +32,7 @@ ReactGA.initialize([ } ]); + const queryClient = new QueryClient({ defaultOptions: { queries: { diff --git a/packages/webapp/src/components/editor-page/index.tsx b/packages/webapp/src/components/editor-page/index.tsx index 40d0eb4a..7173e9cb 100644 --- a/packages/webapp/src/components/editor-page/index.tsx +++ b/packages/webapp/src/components/editor-page/index.tsx @@ -23,7 +23,7 @@ const EditorPage = ({ isTryMode }: EditorPropsType): React.ReactElement => { const client: Client = useSelector(activeInstance); useEffect(() => { - ReactGA.send({ hitType: "pageview", page: window.location.pathname}); + ReactGA.send({ hitType: 'pageview', page: window.location.pathname, title: `Editor - ${mapId}` }); }, []); const findEditorMode = (isTryMode: boolean, mapId: number): EditorRenderMode | null => { diff --git a/packages/webapp/src/components/forgot-password-page/index.tsx b/packages/webapp/src/components/forgot-password-page/index.tsx index fda9c4d3..6bbed323 100644 --- a/packages/webapp/src/components/forgot-password-page/index.tsx +++ b/packages/webapp/src/components/forgot-password-page/index.tsx @@ -80,8 +80,8 @@ const ForgotPasswordPage = (): React.ReactElement => { const intl = useIntl(); useEffect(() => { document.title = intl.formatMessage({ id: 'forgot.page-title', defaultMessage: 'Forgot Password | WiseMapping' }); - ReactGA.send({ hitType: "pageview", page: window.location.pathname}); - },[]); + ReactGA.send({ hitType: 'pageview', page: window.location.pathname, title: 'Forgot password' }); + }, []); return (
diff --git a/packages/webapp/src/components/login-page/index.tsx b/packages/webapp/src/components/login-page/index.tsx index f8d33b61..cc40924c 100644 --- a/packages/webapp/src/components/login-page/index.tsx +++ b/packages/webapp/src/components/login-page/index.tsx @@ -69,9 +69,9 @@ const LoginPage = (): React.ReactElement => { const intl = useIntl(); useEffect(() => { - document.title = intl.formatMessage({id:'login.page-title',defaultMessage:'Login | WiseMapping'}); - ReactGA.send({ hitType: "pageview", page: window.location.pathname}); - },[]); + document.title = intl.formatMessage({ id: 'login.page-title', defaultMessage: 'Login | WiseMapping' }); + ReactGA.send({ hitType: 'pageview', page: window.location.pathname, title: 'Login' }); + }, []); return (
@@ -90,7 +90,7 @@ const LoginPage = (): React.ReactElement => {
- + { id: 'maps.page-title', defaultMessage: 'My Maps | WiseMapping', }); - ReactGA.send({ hitType: "pageview", page: window.location.pathname}); + ReactGA.send({ hitType: 'pageview', page: window.location.pathname, title: 'Maps list' }); }, []); const mutation = useMutation((id: number) => client.deleteLabel(id), { @@ -287,20 +287,20 @@ interface ListItemProps { // https://stackoverflow.com/questions/61486061/how-to-set-selected-and-hover-color-of-listitem-in-mui const CustomListItem = withStyles({ root: { - "&$selected": { - backgroundColor: "rgb(210, 140, 5)", - color: "white", - "& .MuiListItemIcon-root": { - color: "white" - } - }, - "&$selected:hover": { - backgroundColor: "rgb(210, 140, 5)", - color: "white", - "& .MuiListItemIcon-root": { - color: "white" - } - }, + "&$selected": { + backgroundColor: "rgb(210, 140, 5)", + color: "white", + "& .MuiListItemIcon-root": { + color: "white" + } + }, + "&$selected:hover": { + backgroundColor: "rgb(210, 140, 5)", + color: "white", + "& .MuiListItemIcon-root": { + color: "white" + } + }, }, selected: {} })(ListItemButton); diff --git a/packages/webapp/src/components/registration-page/index.tsx b/packages/webapp/src/components/registration-page/index.tsx index 178ce109..3191cf25 100644 --- a/packages/webapp/src/components/registration-page/index.tsx +++ b/packages/webapp/src/components/registration-page/index.tsx @@ -165,8 +165,8 @@ const RegistationPage = (): React.ReactElement => { id: 'registration.page-title', defaultMessage: 'Registration | WiseMapping', }); - ReactGA.send({ hitType: "pageview", page: window.location.pathname}); - },[]); + ReactGA.send({ hitType: 'pageview', page: window.location.pathname, title: 'Register' }); + }, []); return (