-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
821 changed files
with
14,411 additions
and
5,099 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
26 changes: 10 additions & 16 deletions
26
packages/dnb-design-system-portal/src/core/ChangeLocale.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 |
---|---|---|
@@ -1,29 +1,23 @@ | ||
import React from 'react' | ||
import { Dropdown } from '@dnb/eufemia/src' | ||
|
||
import Context from '@dnb/eufemia/src/shared/Context' | ||
import Context, { InternalLocale } from '@dnb/eufemia/src/shared/Context' | ||
import { setLang } from './PortalProviders' | ||
import { Field } from '@dnb/eufemia/src/extensions/forms' | ||
|
||
export default function ChangeLocale({ listUSLocale = null, ...props }) { | ||
const { locale, setLocale } = React.useContext(Context) | ||
|
||
const date = { | ||
'nb-NO': 'Norsk', | ||
'en-GB': 'English (GB)', | ||
} | ||
if (listUSLocale) { | ||
date['en-US'] = 'English (US)' | ||
} | ||
|
||
return ( | ||
<Dropdown | ||
<Field.Selection | ||
value={locale} | ||
data={date} | ||
on_change={({ data: { value } }) => { | ||
setLocale(value) | ||
onChange={(value) => { | ||
setLocale(value as InternalLocale) | ||
setLang(value) | ||
}} | ||
{...props} | ||
/> | ||
> | ||
<Field.Option value="nb-NO" title="Norsk" /> | ||
<Field.Option value="en-GB" title="English (GB)" /> | ||
{listUSLocale && <Field.Option value="en-US" title="English (US)" />} | ||
</Field.Selection> | ||
) | ||
} |
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
14 changes: 14 additions & 0 deletions
14
packages/dnb-design-system-portal/src/docs/EUFEMIA_CHANGELOG.mdx
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
93 changes: 0 additions & 93 deletions
93
packages/dnb-design-system-portal/src/docs/quickguide-designer/colors-table.mdx
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.