diff options
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/atoms/layout/time/time.test.tsx | 4 | ||||
| -rw-r--r-- | src/components/atoms/layout/time/time.tsx | 6 | ||||
| -rw-r--r-- | src/components/templates/layout/layout.tsx | 15 |
3 files changed, 14 insertions, 11 deletions
diff --git a/src/components/atoms/layout/time/time.test.tsx b/src/components/atoms/layout/time/time.test.tsx index 910285d..f3da8b5 100644 --- a/src/components/atoms/layout/time/time.test.tsx +++ b/src/components/atoms/layout/time/time.test.tsx @@ -1,6 +1,6 @@ import { describe, expect, it } from '@jest/globals'; import { render, screen as rtlScreen } from '../../../../../tests/utils'; -import { settings } from '../../../../utils/config'; +import { CONFIG } from '../../../../utils/config'; import { Time } from './time'; describe('Time', () => { @@ -31,7 +31,7 @@ describe('Time', () => { expect( rtlScreen.getByText(new RegExp(`${date.getFullYear()}`)) ).toHaveTextContent( - new Intl.DateTimeFormat(settings.locales.defaultLocale, { + new Intl.DateTimeFormat(CONFIG.locales.defaultLocale, { weekday: 'long', }).format(date) ); diff --git a/src/components/atoms/layout/time/time.tsx b/src/components/atoms/layout/time/time.tsx index 02b4763..886fee0 100644 --- a/src/components/atoms/layout/time/time.tsx +++ b/src/components/atoms/layout/time/time.tsx @@ -4,7 +4,7 @@ import { forwardRef, } from 'react'; import { useIntl } from 'react-intl'; -import { settings } from '../../../../utils/config'; +import { CONFIG } from '../../../../utils/config'; type GetDateOptionsConfig = { hasDay: boolean; @@ -65,7 +65,7 @@ export type TimeProps = Omit< /** * The current locale. * - * @default settings.locales.defaultLocale + * @default CONFIG.locales.defaultLocale */ locale?: string; /** @@ -88,7 +88,7 @@ const TimeWithRef: ForwardRefRenderFunction<HTMLTimeElement, TimeProps> = ( hideDay = false, hideMonth = false, hideYear = false, - locale = settings.locales.defaultLocale, + locale = CONFIG.locales.defaultLocale, showTime = false, showWeekDay = false, ...props diff --git a/src/components/templates/layout/layout.tsx b/src/components/templates/layout/layout.tsx index 8332ba4..c7b8dbd 100644 --- a/src/components/templates/layout/layout.tsx +++ b/src/components/templates/layout/layout.tsx @@ -15,13 +15,13 @@ import { import { useIntl } from 'react-intl'; import type { Person, SearchAction, WebSite, WithContext } from 'schema-dts'; import type { NextPageWithLayoutOptions } from '../../../types'; +import { CONFIG } from '../../../utils/config'; import { ROUTES } from '../../../utils/constants'; import { useAutofocus, useBoolean, useRouteChange, useScrollPosition, - useSettings, } from '../../../utils/hooks'; import { ButtonLink, @@ -89,8 +89,7 @@ export const Layout: FC<LayoutProps> = ({ }) => { const router = useRouter(); const intl = useIntl(); - const { website } = useSettings(); - const { baseline, copyright, locales, name, url } = website; + const { baseline, copyright, locales, name, url } = CONFIG; const articleGridClass = useGrid ? 'article--grid' : ''; const articleCommentsClass = withExtraPadding ? 'article--padding' : ''; @@ -350,10 +349,10 @@ export const Layout: FC<LayoutProps> = ({ description: baseline, url, author: { '@id': `${url}/#branding` }, - copyrightYear: Number(copyright.start), + copyrightYear: Number(copyright.startYear), creator: { '@id': `${url}/#branding` }, editor: { '@id': `${url}/#branding` }, - inLanguage: locales.default, + inLanguage: locales.defaultLocale, potentialAction: searchActionSchema, }; @@ -469,7 +468,11 @@ export const Layout: FC<LayoutProps> = ({ <Footer className={styles.footer}> <Colophon copyright={ - <Copyright from={copyright.start} owner={name} to={copyright.end} /> + <Copyright + from={copyright.startYear} + owner={name} + to={copyright.endYear} + /> } license={<Icon heading={copyrightTitle} shape="cc-by-sa" size="lg" />} links={footerNav} |
