Skip to content

Commit 7a8ee2c

Browse files
authored
Maint 853 update baner with new townhall link (#857)
* maint: updated banner with new tonwhall link * fix: update hover color * chore: linting * fix: file name change and linting
1 parent 68f3d28 commit 7a8ee2c

File tree

2 files changed

+64
-66
lines changed

2 files changed

+64
-66
lines changed
Lines changed: 64 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,80 @@
1-
import Close from "@mui/icons-material/Close";
2-
import { IconButton } from "@mui/material";
3-
import { AxiosError } from "axios";
4-
import useGoogleAnalytics from "hooks/useGoogleAnalytics";
5-
import { SnackbarKey, SnackbarProvider } from "notistack";
6-
import { useEffect, useRef } from "react";
7-
import { QueryCache, QueryClient, QueryClientProvider } from "react-query";
8-
import Navbar from "components/Navbar/Navbar";
9-
import useGetToken from "./hooks/useGetToken";
10-
import BaseNavigation from "pages/BaseNavigation/BaseNavigation";
11-
import { useLocation } from "react-router-dom";
12-
import Banner from "components/Downbanner";
1+
import Close from '@mui/icons-material/Close';
2+
import { IconButton } from '@mui/material';
3+
import { AxiosError } from 'axios';
4+
import useGoogleAnalytics from 'hooks/useGoogleAnalytics';
5+
import { SnackbarKey, SnackbarProvider } from 'notistack';
6+
import { useEffect, useRef } from 'react';
7+
import { QueryCache, QueryClient, QueryClientProvider } from 'react-query';
8+
import Navbar from 'components/Navbar/Navbar';
9+
import useGetToken from './hooks/useGetToken';
10+
import BaseNavigation from 'pages/BaseNavigation/BaseNavigation';
11+
import { useLocation } from 'react-router-dom';
12+
import Banner from 'components/Banner';
1313

1414
const queryClient = new QueryClient({
15-
defaultOptions: {
16-
queries: {
17-
retry: 0,
18-
refetchOnWindowFocus: false,
19-
// staleTime: 5000, // https://tkdodo.eu/blog/practical-react-query#the-defaults-explained
15+
defaultOptions: {
16+
queries: {
17+
retry: 0,
18+
refetchOnWindowFocus: false,
19+
// staleTime: 5000, // https://tkdodo.eu/blog/practical-react-query#the-defaults-explained
20+
},
2021
},
21-
},
22-
queryCache: new QueryCache({
23-
onError: (error) => {
24-
console.log({ error });
25-
const responseStatus = (error as AxiosError)?.response?.status;
26-
if (responseStatus && responseStatus === 404) {
27-
console.error("could not find resource");
28-
}
29-
},
30-
}),
22+
queryCache: new QueryCache({
23+
onError: (error) => {
24+
console.log({ error });
25+
const responseStatus = (error as AxiosError)?.response?.status;
26+
if (responseStatus && responseStatus === 404) {
27+
console.error('could not find resource');
28+
}
29+
},
30+
}),
3131
});
3232

3333
declare global {
34-
interface Window {
35-
gtag?: (
36-
type: "event" | "config" | "get" | "set" | "consent",
37-
action: "login" | "page_view",
38-
options?: any
39-
) => void;
40-
}
34+
interface Window {
35+
gtag?: (
36+
type: 'event' | 'config' | 'get' | 'set' | 'consent',
37+
action: 'login' | 'page_view',
38+
options?: any
39+
) => void;
40+
}
4141
}
4242

4343
function App() {
44-
const notistackRef = useRef<SnackbarProvider>(null);
45-
useGetToken();
46-
useGoogleAnalytics();
44+
const notistackRef = useRef<SnackbarProvider>(null);
45+
useGetToken();
46+
useGoogleAnalytics();
4747

48-
const location = useLocation();
49-
useEffect(() => {
50-
if (window.gtag) {
51-
window.gtag("event", "page_view", {
52-
page_path: `${location.pathname}${location.search}`,
53-
});
54-
}
55-
}, [location]);
48+
const location = useLocation();
49+
useEffect(() => {
50+
if (window.gtag) {
51+
window.gtag('event', 'page_view', {
52+
page_path: `${location.pathname}${location.search}`,
53+
});
54+
}
55+
}, [location]);
5656

57-
const handleCloseSnackbar =
58-
(key: SnackbarKey) => (_event: React.MouseEvent) => {
59-
if (notistackRef?.current?.closeSnackbar)
60-
notistackRef.current?.closeSnackbar(key);
57+
const handleCloseSnackbar = (key: SnackbarKey) => (_event: React.MouseEvent) => {
58+
if (notistackRef?.current?.closeSnackbar) notistackRef.current?.closeSnackbar(key);
6159
};
6260

63-
return (
64-
<QueryClientProvider client={queryClient}>
65-
<SnackbarProvider
66-
ref={notistackRef}
67-
autoHideDuration={8000}
68-
action={(key) => (
69-
<IconButton onClick={handleCloseSnackbar(key)}>
70-
<Close sx={{ color: "white" }} />
71-
</IconButton>
72-
)}
73-
>
74-
<Banner />
75-
<Navbar />
76-
<BaseNavigation />
77-
</SnackbarProvider>
78-
</QueryClientProvider>
79-
);
61+
return (
62+
<QueryClientProvider client={queryClient}>
63+
<SnackbarProvider
64+
ref={notistackRef}
65+
autoHideDuration={8000}
66+
action={(key) => (
67+
<IconButton onClick={handleCloseSnackbar(key)}>
68+
<Close sx={{ color: 'white' }} />
69+
</IconButton>
70+
)}
71+
>
72+
<Banner />
73+
<Navbar />
74+
<BaseNavigation />
75+
</SnackbarProvider>
76+
</QueryClientProvider>
77+
);
8078
}
8179

8280
export default App;

0 commit comments

Comments
 (0)