-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(next,ui): improves loading states (#6434)
- Loading branch information
1 parent
043a91d
commit 92f458d
Showing
94 changed files
with
983 additions
and
881 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Select } from '@payloadcms/ui/fields/Select' | ||
import { useTranslation } from '@payloadcms/ui/providers/Translation' | ||
import React from 'react' | ||
|
||
export const LocaleSelector: React.FC<{ | ||
localeOptions: { | ||
label: Record<string, string> | string | ||
value: string | ||
}[] | ||
onChange: (value: string) => void | ||
}> = ({ localeOptions, onChange }) => { | ||
const { t } = useTranslation() | ||
|
||
return ( | ||
<Select | ||
label={t('general:locale')} | ||
name="locale" | ||
onChange={(value) => onChange(value)} | ||
options={localeOptions} | ||
path="locale" | ||
/> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/next/src/views/Account/Settings/LanguageSelector.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
'use client' | ||
import type { LanguageOptions } from 'payload/types' | ||
|
||
import { ReactSelect } from '@payloadcms/ui/elements/ReactSelect' | ||
import { useTranslation } from '@payloadcms/ui/providers/Translation' | ||
import React from 'react' | ||
|
||
export const LanguageSelector: React.FC<{ | ||
languageOptions: LanguageOptions | ||
}> = (props) => { | ||
const { languageOptions } = props | ||
|
||
const { i18n, switchLanguage } = useTranslation() | ||
|
||
return ( | ||
<ReactSelect | ||
inputId="language-select" | ||
onChange={async ({ value }) => { | ||
await switchLanguage(value) | ||
}} | ||
options={languageOptions} | ||
value={languageOptions.find((language) => language.value === i18n.language)} | ||
/> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
144 changes: 0 additions & 144 deletions
144
packages/next/src/views/Dashboard/Default/index.client.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.