diff --git a/web/apps/payments/src/pages/404.tsx b/web/apps/payments/src/pages/404.tsx index 2f6f5d9d088af0ef0505117a3eeca295f1b62da5..91d8d2800ef464a860750d6752a3fd13d02198d6 100644 --- a/web/apps/payments/src/pages/404.tsx +++ b/web/apps/payments/src/pages/404.tsx @@ -1,7 +1,7 @@ import { Container } from "components/Container"; +import S from "utils/strings"; import React from "react"; -import constants from "utils/strings"; export default function Home() { - return {constants.NOT_FOUND}; + return {S.error_404}; } diff --git a/web/apps/payments/src/pages/_app.tsx b/web/apps/payments/src/pages/_app.tsx index 9d57985e9f3c21789a44c630be881bc4e99f8fc2..7686c5f8f5bb76e7fa3bc639cd2cc619b3c36270 100644 --- a/web/apps/payments/src/pages/_app.tsx +++ b/web/apps/payments/src/pages/_app.tsx @@ -1,14 +1,14 @@ import type { AppProps } from "next/app"; import Head from "next/head"; import React from "react"; -import constants from "utils/strings"; +import S from "utils/strings"; import "../styles/globals.css"; function MyApp({ Component, pageProps }: AppProps) { return ( <> - {constants.TITLE} + {S.title} diff --git a/web/apps/payments/src/pages/index.tsx b/web/apps/payments/src/pages/index.tsx index 19151dc0eeae5463ba76682ce87cae4719469003..98d4a586dd5335024e02a61a07074c54fefc1c53 100644 --- a/web/apps/payments/src/pages/index.tsx +++ b/web/apps/payments/src/pages/index.tsx @@ -2,7 +2,7 @@ import { Container } from "components/Container"; import { Spinner } from "components/Spinner"; import * as React from "react"; import { parseAndHandleRequest } from "services/billing-service"; -import constants from "utils/strings"; +import S from "utils/strings"; export default function Home() { const [failed, setFailed] = React.useState(false); @@ -20,9 +20,5 @@ export default function Home() { main(); }, []); - return ( - - {failed ? constants.SOMETHING_WENT_WRONG : } - - ); + return {failed ? S.error_generic : }; } diff --git a/web/apps/payments/src/utils/strings.ts b/web/apps/payments/src/utils/strings.ts index 44ba64b8feb3847544f88a9399d4edcb6b3b0a50..5632289bee89ae5fd0ef164ba8d9bea8d1383ae5 100644 --- a/web/apps/payments/src/utils/strings.ts +++ b/web/apps/payments/src/utils/strings.ts @@ -1,7 +1,14 @@ -const englishConstants = { - TITLE: "Payments | ente.io", - SOMETHING_WENT_WRONG: "Oops, something went wrong.", - NOT_FOUND: "404 | This page could not be found.", +/** + * User facing strings in the app + * + * By keeping them separate, we make our lives easier if/when we need to + * localize the corresponding pages. Right now, these are just the values in the + * default language, English. + */ +const S = { + title: "Payments | ente.io", + error_generic: "Oops, something went wrong.", + error_404: "404 | This page could not be found.", }; -export default englishConstants; +export default S;