From 81b1e0e05919eb368a66aef47adcf7738af76f29 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 29 Sep 2023 11:47:06 +0200 Subject: refactor(components): rewrite Spinner component * Message should be set as children * Default message is no longer available (depending on use case, the consumer might prefer aria-label instead) * It is now possible to define the message position --- src/types/app.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/types') diff --git a/src/types/app.ts b/src/types/app.ts index 64bb3af..e237560 100644 --- a/src/types/app.ts +++ b/src/types/app.ts @@ -1,7 +1,7 @@ -import { NextPage } from 'next'; -import { AppProps as NextAppProps } from 'next/app'; -import { ReactElement, ReactNode } from 'react'; -import { MessageFormatElement } from 'react-intl'; +import type { NextPage } from 'next'; +import type { AppProps as NextAppProps } from 'next/app'; +import type { ReactElement, ReactNode } from 'react'; +import type { MessageFormatElement } from 'react-intl'; export type NextPageWithLayoutOptions = { withExtraPadding?: boolean; @@ -9,15 +9,15 @@ export type NextPageWithLayoutOptions = { useGrid?: boolean; }; -export type NextPageWithLayout = NextPage & { +export type NextPageWithLayout = NextPage & { getLayout?: ( page: ReactElement, options: NextPageWithLayoutOptions ) => ReactNode; }; -// modified version - allows for custom pageProps type, falling back to 'any' -type AppProps

= { +// modified version - allows custom pageProps type, falling back to 'unknown' +type AppProps

= { pageProps: P; } & Omit, 'pageProps'>; @@ -130,3 +130,5 @@ export type Topic = Page<'topic'>; export type Slug = { slug: string; }; + +export type Position = 'bottom' | 'center' | 'left' | 'right' | 'top'; -- cgit v1.2.3