From 297654f58e351ac6e10c4f7c465bb62d37d4495b Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Tue, 24 May 2022 22:58:15 +0200 Subject: build(deps): bump all dependencies I moved the website picture from useSettings to the layout component since it is only used here. This reduce the number of Jest errors. However, there's still some issues with some images import... --- src/components/templates/layout/layout.test.tsx | 1 - src/components/templates/layout/layout.tsx | 9 +++++---- src/utils/hooks/use-settings.tsx | 21 --------------------- 3 files changed, 5 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/components/templates/layout/layout.test.tsx b/src/components/templates/layout/layout.test.tsx index 78547d4..914e1cd 100644 --- a/src/components/templates/layout/layout.test.tsx +++ b/src/components/templates/layout/layout.test.tsx @@ -1,5 +1,4 @@ import { render, screen } from '@test-utils'; -import { BreadcrumbList } from 'schema-dts'; import Layout from './layout'; const body = diff --git a/src/components/templates/layout/layout.tsx b/src/components/templates/layout/layout.tsx index 8f0d4e7..0b1fe99 100644 --- a/src/components/templates/layout/layout.tsx +++ b/src/components/templates/layout/layout.tsx @@ -1,3 +1,4 @@ +import photo from '@assets/images/armand-philippot.jpg'; import ButtonLink from '@components/atoms/buttons/button-link'; import Career from '@components/atoms/icons/career'; import CCBySA from '@components/atoms/icons/cc-by-sa'; @@ -50,7 +51,7 @@ const Layout: FC = ({ }) => { const intl = useIntl(); const { website } = useSettings(); - const { baseline, copyright, locales, name, picture, url } = website; + const { baseline, copyright, locales, name, url } = website; const articleGridClass = useGrid ? 'article--grid' : ''; const articleCommentsClass = withExtraPadding ? 'article--padding' : ''; @@ -156,7 +157,7 @@ const Layout: FC = ({ name: name, url: url, jobTitle: baseline, - image: picture.src, + image: photo.src, subjectOf: { '@id': `${url}` }, }; @@ -199,7 +200,7 @@ const Layout: FC = ({ isHome={isHome} motionStorageKey="reduced-motion" nav={mainNav} - photo={picture} + photo={photo} searchPage="/recherche" title={name} withLink={true} @@ -229,7 +230,7 @@ const Layout: FC = ({ * Get the global layout. * * @param {ReactElement} page - A page. - * @param {boolean} [isHome] - Determine if it is the homepage. + * @param {NextPageWithLayoutOptions} props - An object with layout options. * @returns A page wrapped with the global layout. */ export const getLayout = ( diff --git a/src/utils/hooks/use-settings.tsx b/src/utils/hooks/use-settings.tsx index cc5261b..a1d1a65 100644 --- a/src/utils/hooks/use-settings.tsx +++ b/src/utils/hooks/use-settings.tsx @@ -1,4 +1,3 @@ -import photo from '@assets/images/armand-philippot.jpg'; import { settings } from '@utils/config'; import { useRouter } from 'next/router'; @@ -31,21 +30,6 @@ export type LocaleSettings = { supported: string[]; }; -export type PictureSettings = { - /** - * The picture height. - */ - height: number; - /** - * The picture url. - */ - src: string; - /** - * The picture width. - */ - width: number; -}; - export type WebsiteSettings = { /** * The website name. @@ -67,10 +51,6 @@ export type WebsiteSettings = { * The website locales. */ locales: LocaleSettings; - /** - * A picture representing the website. - */ - picture: PictureSettings; /** * The website url. */ @@ -109,7 +89,6 @@ const useSettings = (): UseSettingsReturn => { supported: locales.supported, }, name, - picture: photo, url, }, }; -- cgit v1.2.3