Skip to content

Commit d3a07ee

Browse files
authored
feat: app migration scripts and fonts (#1267)
1 parent ddbf99a commit d3a07ee

File tree

7 files changed

+55
-41
lines changed

7 files changed

+55
-41
lines changed

.babelrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/workflows/build-and-test-prs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Use NodeJs
2727
uses: actions/setup-node@v4
2828
with:
29-
node-version: "20.x"
29+
node-version: '20.x'
3030

3131
- name: Install dependencies
3232
run: yarn install --frozen-lockfile --non-interactive

.github/workflows/community-issue-comment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ name: Issue Comment Workflows
1010

1111
on:
1212
workflow_run:
13-
workflows: ["Label Stale Contributions"]
13+
workflows: ['Label Stale Contributions']
1414
types:
1515
- completed
1616
issues:

components/head/GoogleTagManagerScript.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const GoogleTagManagerScript = () => {
44
return (
55
<Script
66
id="gtag"
7-
strategy="worker"
7+
strategy="afterInteractive"
88
dangerouslySetInnerHTML={{
99
__html: `
1010
window.dataLayer = window.dataLayer || [];

pages/_app.tsx

Lines changed: 47 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Analytics } from '@vercel/analytics/react';
66
import { NextComponentType } from 'next';
77
import { IntlError, NextIntlClientProvider } from 'next-intl';
88
import type { AppProps } from 'next/app';
9+
import { Montserrat, Open_Sans } from 'next/font/google';
910
import { useRouter } from 'next/router';
1011
import { NextPageContext } from 'next/types';
1112
import { Hotjar } from 'nextjs-hotjar';
@@ -27,6 +28,25 @@ import { wrapper } from '../store/store';
2728
import '../styles/globals.css';
2829
import theme from '../styles/theme';
2930

31+
// <link
32+
// href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=Open+Sans:ital,wght@0,300;0,400;0,600;1,300;1,400;1,600&display=swap"
33+
// rel="stylesheet"
34+
// />;
35+
36+
export const openSans = Open_Sans({
37+
subsets: ['latin'],
38+
weight: ['300', '400', '600'],
39+
variable: '--font-open-sans',
40+
display: 'swap',
41+
});
42+
43+
export const montserrat = Montserrat({
44+
subsets: ['latin'],
45+
weight: ['300', '400', '500'],
46+
variable: '--font-montserrat',
47+
display: 'swap',
48+
});
49+
3050
// For SSG compatibility with MUI
3151
// Client-side emotion cache, shared for the whole session of the user in the browser.
3252
const clientSideEmotionCache = createEmotionCache();
@@ -65,31 +85,33 @@ function MyApp(props: MyAppProps) {
6585
}
6686

6787
return (
68-
<ErrorBoundary>
69-
<NextIntlClientProvider
70-
messages={pageProps.messages}
71-
locale={router.locale}
72-
timeZone="Europe/London"
73-
onError={onIntlError}
74-
>
75-
<DefaultHeadMetadata />
76-
<ThemeProvider theme={theme}>
77-
<CssBaseline />
78-
<TopBar />
79-
{pathHead !== 'partner-admin' && <LeaveSiteButton />}
80-
<AuthGuard>
81-
<Component {...pageProps} />
82-
</AuthGuard>
83-
<Footer />
84-
<Consent />
85-
{!!process.env.NEXT_PUBLIC_HOTJAR_ID && process.env.NEXT_PUBLIC_ENV !== 'local' && (
86-
<Hotjar id={process.env.NEXT_PUBLIC_HOTJAR_ID} sv={6} strategy="lazyOnload" />
87-
)}
88-
{/* Vercel analytics */}
89-
<Analytics />
90-
</ThemeProvider>
91-
</NextIntlClientProvider>
92-
</ErrorBoundary>
88+
<div className={`${openSans.variable} ${montserrat.variable}`}>
89+
<ErrorBoundary>
90+
<NextIntlClientProvider
91+
messages={pageProps.messages}
92+
locale={router.locale}
93+
timeZone="Europe/London"
94+
onError={onIntlError}
95+
>
96+
<DefaultHeadMetadata />
97+
<ThemeProvider theme={theme}>
98+
<CssBaseline />
99+
<TopBar />
100+
{pathHead !== 'partner-admin' && <LeaveSiteButton />}
101+
<AuthGuard>
102+
<Component {...pageProps} />
103+
</AuthGuard>
104+
<Footer />
105+
<Consent />
106+
{!!process.env.NEXT_PUBLIC_HOTJAR_ID && process.env.NEXT_PUBLIC_ENV !== 'local' && (
107+
<Hotjar id={process.env.NEXT_PUBLIC_HOTJAR_ID} sv={6} strategy="lazyOnload" />
108+
)}
109+
{/* Vercel analytics */}
110+
<Analytics />
111+
</ThemeProvider>
112+
</NextIntlClientProvider>
113+
</ErrorBoundary>
114+
</div>
93115
);
94116
}
95117

pages/_document.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ export default class MyDocument extends Document<NewRelicProps> {
2121
type="text/javascript"
2222
dangerouslySetInnerHTML={{ __html: this.props.browserTimingHeader }}
2323
/>
24-
<link
25-
href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=Open+Sans:ital,wght@0,300;0,400;0,600;1,300;1,400;1,600&display=swap"
26-
rel="stylesheet"
27-
/>
2824
<GoogleTagManagerScript />
2925
<RollbarScript />
3026
</Head>

styles/theme.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,21 @@ let theme = createTheme({
3939
borderRadius: 20,
4040
},
4141
typography: {
42-
fontFamily: 'Open Sans, sans-serif',
42+
fontFamily: 'var(--font-open-sans)',
4343
h1: {
44-
fontFamily: 'Montserrat, sans-serif',
44+
fontFamily: 'var(--font-montserrat)',
4545
fontSize: '2.25rem',
4646
fontWeight: 500,
4747
marginBottom: '1.75rem',
4848
},
4949
h2: {
50-
fontFamily: 'Montserrat, sans-serif',
50+
fontFamily: 'var(--font-montserrat)',
5151
fontSize: '1.875rem',
5252
fontWeight: 400,
5353
marginBottom: '1rem',
5454
},
5555
h3: {
56-
fontFamily: 'Montserrat, sans-serif',
56+
fontFamily: 'var(--font-montserrat)',
5757
fontSize: '1.375rem',
5858
marginBottom: '1rem',
5959
lineHeight: 1.4,
@@ -64,7 +64,7 @@ let theme = createTheme({
6464
},
6565
subtitle1: {
6666
fontSize: '1.375rem',
67-
fontFamily: 'Montserrat, sans-serif',
67+
fontFamily: 'var(--font-montserrat)',
6868
fontStyle: 'italic',
6969
},
7070
body1: {

0 commit comments

Comments
 (0)