Skip to content

Commit 1a5b555

Browse files
authored
Merge branch 'main' into release/1.4.4
2 parents 024a66b + 172513d commit 1a5b555

17 files changed

Lines changed: 148 additions & 74 deletions

File tree

pages/404.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { GetStaticProps } from "next";
2+
import { Text } from "@nypl/design-system-react-components";
3+
import {
4+
BackToHomeLink,
5+
ContactUsLink,
6+
ErrorComponent,
7+
} from "../src/components/Error";
8+
9+
export default function NotFoundPage() {
10+
return (
11+
<ErrorComponent
12+
heading="We couldn't find that page"
13+
description={
14+
<Text maxWidth="730px" margin="auto">
15+
The page you were looking for doesn't exist or may have moved
16+
elsewhere. Try starting a <BackToHomeLink /> or <ContactUsLink /> if
17+
the error persists.
18+
</Text>
19+
}
20+
/>
21+
);
22+
}
23+
24+
export const getStaticProps: GetStaticProps = async () => {
25+
return { props: {} };
26+
};

pages/500.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { Text } from "@nypl/design-system-react-components";
2+
import {
3+
BackToHomeLink,
4+
ContactUsLink,
5+
ErrorComponent,
6+
} from "../src/components/Error";
7+
8+
export default function ServerErrorPage() {
9+
return (
10+
<ErrorComponent
11+
heading="Something went wrong on our end"
12+
description={
13+
<Text maxWidth="700px" margin="auto">
14+
We are working to resolve a server issue. Your application progress
15+
may not have been saved. Try starting a <BackToHomeLink /> in a few
16+
minutes or <ContactUsLink /> if the error persists.
17+
</Text>
18+
}
19+
/>
20+
);
21+
}

pages/_app.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ function MyApp({ Component, pageProps }: MyAppProps) {
6161
};
6262
const initState = { ...formInitialStateCopy };
6363
const pageTitles = getPageTitles();
64+
const isErrorPage = ["/404", "/500"].includes(router.pathname);
6465

6566
return (
6667
<>
@@ -138,13 +139,17 @@ function MyApp({ Component, pageProps }: MyAppProps) {
138139
<FormProvider {...formMethods}>
139140
<FormDataContextProvider initState={initState}>
140141
<ErrorBoundary reset={router.asPath}>
141-
<ApplicationContainer>
142-
<Component
143-
{...pageProps}
144-
pageTitles={pageTitles}
145-
policyType={router.query.policyType}
146-
/>
147-
</ApplicationContainer>
142+
{isErrorPage ? (
143+
<Component {...pageProps} />
144+
) : (
145+
<ApplicationContainer>
146+
<Component
147+
{...pageProps}
148+
pageTitles={pageTitles}
149+
policyType={router.query.policyType}
150+
/>
151+
</ApplicationContainer>
152+
)}
148153
</ErrorBoundary>
149154
</FormDataContextProvider>
150155
</FormProvider>

public/locales/ar/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"ageGate": "Yes, I am over 13 years old.",
3434
"email": {
3535
"label": "عنوان البريد الإلكتروني",
36-
"instruction": "<span>مطلوب عنوان بريد إلكتروني لاستخدام العديد من مواردنا الرقمية، مثل الكتب الإلكترونية.</span>"
36+
"instruction": "مطلوب عنوان بريد إلكتروني لاستخدام العديد من مواردنا الرقمية، مثل الكتب الإلكترونية."
3737
},
3838
"eCommunications": {
3939
"labelText": "نعم، أرغب في تلقي معلومات بشأن برامج مكتبة نيويورك العامة (New York Public Library, NYPL) وخدماتها"

public/locales/bn/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"ageGate": "Yes, I am over 13 years old.",
3434
"email": {
3535
"label": "ইমেইল অ্যাড্রেস",
36-
"instruction": "<span>আমাদের অনেক ডিজিটাল সম্পদ, যেমন ই-বুক ব্যবহার করার জন্য একটি ইমেইল ঠিকানা প্রয়োজন।</span>"
36+
"instruction": "আমাদের অনেক ডিজিটাল সম্পদ, যেমন ই-বুক ব্যবহার করার জন্য একটি ইমেইল ঠিকানা প্রয়োজন।"
3737
},
3838
"eCommunications": {
3939
"labelText": "হ্যাঁ, আমি এনওয়াইপিএল এর প্রোগ্রাম এবংসার্ভিসেস সম্পর্কে তথ্য পেতে চাই"

public/locales/en/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"ageGate": "Yes, I am over 13 years old.",
4444
"email": {
4545
"label": "Email address",
46-
"instruction": "<span>An email address is required to use many of our digital resources, such as e-books.</span>"
46+
"instruction": "An email address is required to use many of our digital resources, such as e-books."
4747
},
4848
"eCommunications": {
4949
"labelText": "Yes, I would like to receive information about NYPL's programs and services"

public/locales/es/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"ageGate": "Yes, I am over 13 years old.",
3737
"email": {
3838
"label": "Dirección de correo electrónico",
39-
"instruction": "<span>Se requiere una dirección de correo electrónico para utilizar muchos de nuestros recursos digitales, como los libros electrónicos.</span>"
39+
"instruction": "Se requiere una dirección de correo electrónico para utilizar muchos de nuestros recursos digitales, como los libros electrónicos."
4040
},
4141
"eCommunications": {
4242
"labelText": "Sí, me gustaría recibir información sobre los programas y servicios que ofrece la NYPL"

public/locales/fr/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"ageGate": "Yes, I am over 13 years old.",
3434
"email": {
3535
"label": "Adresse e-mail",
36-
"instruction": "<span>Une adresse e-mail vous sera demandée pour l’utilisation de nombreuses ressources numériques comme les livres électroniques.<span>"
36+
"instruction": "Une adresse e-mail vous sera demandée pour l’utilisation de nombreuses ressources numériques comme les livres électroniques."
3737
},
3838
"eCommunications": {
3939
"labelText": "Oui, je souhaite recevoir les informations sur les activités et les services de la NYPL."

public/locales/ht/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"ageGate": "Yes, I am over 13 years old.",
3434
"email": {
3535
"label": "Imèl",
36-
"instruction": "<span>Yon adrès imèl nesesè pou itilize plizyè nan resous nimerik nou yo, tankou liv elektwonik.</span>"
36+
"instruction": "Yon adrès imèl nesesè pou itilize plizyè nan resous nimerik nou yo, tankou liv elektwonik."
3737
},
3838
"eCommunications": {
3939
"labelText": "Wi, mwen ta renmen resevwa enfòmasyon sou pwogram ak sèvis Bibliyotèk Piblik New York (NYPL) ofri yo."

public/locales/ko/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"ageGate": "Yes, I am over 13 years old.",
3434
"email": {
3535
"label": "이메일 주소",
36-
"instruction": "<span>전자책과 같은 많은 디지털 자료를 이용하기 위해서는 이메일 주소가 필요합니다.</span>"
36+
"instruction": "전자책과 같은 많은 디지털 자료를 이용하기 위해서는 이메일 주소가 필요합니다."
3737
},
3838
"eCommunications": {
3939
"labelText": "예, NYPL의 프로그램과 서비스에 대한 정보를 받기를 원합니다."

0 commit comments

Comments
 (0)