diff --git a/sites/org/pages/typography.mjs b/sites/org/pages/typography.mjs index 2116449eebd..0403c5199a6 100644 --- a/sites/org/pages/typography.mjs +++ b/sites/org/pages/typography.mjs @@ -1,12 +1,17 @@ // Dependencies import { serverSideTranslations } from 'next-i18next/serverSideTranslations' +// Context +import { LoadingStatusContext } from 'shared/context/loading-status-context.mjs' +// Hooks +import { useContext } from 'react' // Components import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs' import { Popout } from 'shared/components/popout/index.mjs' import { Collapse } from 'shared/components/collapse.mjs' +import { BoolYesIcon, BoolNoIcon } from 'shared/components/icons.mjs' // Translation namespaces used on this page -const namespaces = [...new Set(pageNs)] +const ns = pageNs // Re-use this const p = ( @@ -16,100 +21,150 @@ const p = (

) -const TypographyPage = ({ page }) => ( - -
-

This typography page shows an overview of different elements and how they are styled.

-

It's a good starting point for theme development.

-

Headings (this is h2)

- {p} {p} -

This is h3

- {p} {p} -

This is h4

- {p} {p} -
This is h5
- {p} {p} -
This is h6
- {p} {p} -

Links and buttons

-

- A regular link looks like this, whereas buttons look like this: -

-

Main button styles

-
- - - - -
-

State button styles

-
- - - - -
-

Other button styles

-
- - -
-

Outlined button styles

-
- - - - -
-

Button sizes

-
- - - - - - - - -
-

Popouts

-

The Popout component is what powers various custom MDX components under the hood:

- {['note', 'tip', 'warning', 'fixme', 'link', 'related', 'none'].map((type) => { - const props = {} - props[type] = true - return ( -
-

{type}

- -
I am the {type} title
- {p} -
-
- ) - })} -

Collapse

- {['primary', 'secondary', 'accent', 'neutral', 'success', 'info', 'warning', 'error'].map( - (color) => ( - { + const { setLoadingStatus, loading, LoadingProgress } = useContext(LoadingStatusContext) + + const loadingProgression = () => { + let delay = 0 + for (let i = 1; i < 51; i++) { + delay += 25 + window.setTimeout( + () => + setLoadingStatus( + i === 50 + ? [true, 'All done!', true, true] + : [true, ] + ), + delay + ) + } + } + + return ( + +
+

This typography page shows an overview of different elements and how they are styled.

+

It's a good starting point for theme development.

+

Headings (this is h2)

+ {p} {p} +

This is h3

+ {p} {p} +

This is h4

+ {p} {p} +
This is h5
+ {p} {p} +
This is h6
+ {p} {p} +

Links and buttons

+

+ A regular link looks like this, whereas buttons look like this: +

+

Main button styles

+
+ + + + +
+

State button styles

+
+ + + + +
+

Other button styles

+
+ + +
+

Outlined button styles

+
+ + + + +
+

Button sizes

+
+ + + + + + + + +
+

Popouts

+

The Popout component is what powers various custom MDX components under the hood:

+ {['note', 'tip', 'warning', 'fixme', 'link', 'related', 'none'].map((type) => { + const props = {} + props[type] = true + return ( +
+

{type}

+ +
I am the {type} title
+ {p} +
+
+ ) + })} +

Collapse

+ {['primary', 'secondary', 'accent', 'neutral', 'success', 'info', 'warning', 'error'].map( + (color) => ( + +

I am a collapse in the {color} color

+
+ ) + )} +

Loading state

+

+ Loading: {loading ? : } +

+
+
- -) + Start loading + + + + + +
+
+
+ ) +} export default TypographyPage export async function getStaticProps({ locale }) { return { props: { - ...(await serverSideTranslations(locale, namespaces)), + ...(await serverSideTranslations(locale, ns)), page: { locale, path: ['typography'], diff --git a/sites/shared/i18n/status/en.yaml b/sites/shared/i18n/status/en.yaml index 28c85aed74d..ca08d5fa689 100644 --- a/sites/shared/i18n/status/en.yaml +++ b/sites/shared/i18n/status/en.yaml @@ -1,12 +1,14 @@ -updatingSettings: Updating settings -settingsSaved: Settings saved backendError: Backend returned an error -copiedToClipboard: Copied to clipboard -processingUpdate: Processing update -generatingPdf: Generating your PDF, one moment please -pdfReady: PDF generated -pdfFailed: An unexpected error occured while generating your PDF contactingBackend: Contacting the FreeSewing backend -dataLoaded: Loaded data from the FreeSewing backend contactingGitHub: Contacting GitHub contactingGoogle: Contacting Google +copiedToClipboard: Copied to clipboard +dataLoaded: Loaded data from the FreeSewing backend +generatingPdf: Generating your PDF, one moment please +nailedIt: Nailed it! +pdfFailed: An unexpected error occured while generating your PDF +pdfReady: PDF generated +processingUpdate: Processing update +settingsSaved: Settings saved +updatingSettings: Updating settings + diff --git a/sites/shared/i18n/toast/de.yaml b/sites/shared/i18n/toast/de.yaml deleted file mode 100644 index 11c4ee7832b..00000000000 --- a/sites/shared/i18n/toast/de.yaml +++ /dev/null @@ -1,5 +0,0 @@ -updatingSettings: Updating settings -settingsSaved: Einstellungen gespeichert -backendError: Backend hat einen Fehler zurückgegeben -copiedToClipboard: In die Zwischenablage kopiert -processingUpdate: Processing update diff --git a/sites/shared/i18n/toast/en.yaml b/sites/shared/i18n/toast/en.yaml deleted file mode 100644 index b5853b4ca5c..00000000000 --- a/sites/shared/i18n/toast/en.yaml +++ /dev/null @@ -1,5 +0,0 @@ -updatingSettings: Updating settings -settingsSaved: Settings saved -backendError: Backend returned an error -copiedToClipboard: Copied to clipboard -processingUpdate: Processing update diff --git a/sites/shared/i18n/toast/es.yaml b/sites/shared/i18n/toast/es.yaml deleted file mode 100644 index 601a92e24c4..00000000000 --- a/sites/shared/i18n/toast/es.yaml +++ /dev/null @@ -1,5 +0,0 @@ -updatingSettings: Updating settings -settingsSaved: Settings saved -backendError: Backend returned an error -copiedToClipboard: Copiado al portapapeles -processingUpdate: Processing update diff --git a/sites/shared/i18n/toast/fr.yaml b/sites/shared/i18n/toast/fr.yaml deleted file mode 100644 index e5b479c7955..00000000000 --- a/sites/shared/i18n/toast/fr.yaml +++ /dev/null @@ -1,5 +0,0 @@ -updatingSettings: Updating settings -settingsSaved: Settings saved -backendError: Backend returned an error -copiedToClipboard: Copié dans le presse-papier -processingUpdate: Processing update diff --git a/sites/shared/i18n/toast/nl.yaml b/sites/shared/i18n/toast/nl.yaml deleted file mode 100644 index 542b63ab85f..00000000000 --- a/sites/shared/i18n/toast/nl.yaml +++ /dev/null @@ -1,5 +0,0 @@ -updatingSettings: Updating settings -settingsSaved: Settings saved -backendError: Backend returned an error -copiedToClipboard: Gekopieerd naar het klembord -processingUpdate: Processing update diff --git a/sites/shared/i18n/toast/uk.yaml b/sites/shared/i18n/toast/uk.yaml deleted file mode 100644 index cc445357fed..00000000000 --- a/sites/shared/i18n/toast/uk.yaml +++ /dev/null @@ -1,5 +0,0 @@ -updatingSettings: Updating settings -settingsSaved: Settings saved -backendError: Backend returned an error -copiedToClipboard: Скопійовано в буфер обміну -processingUpdate: Processing update