Capitalize choice label
This commit is contained in:
parent
845d5186c9
commit
0b93f85348
2 changed files with 6 additions and 1 deletions
|
@ -332,3 +332,7 @@ export function parseBoolean(a: string): boolean {
|
|||
}
|
||||
return a === "true";
|
||||
}
|
||||
|
||||
export function capitalize(s: string) {
|
||||
return s.charAt(0).toLocaleUpperCase() + s.slice(1);
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import { useIntl } from "react-intl";
|
|||
import CardTitle from "@saleor/components/CardTitle";
|
||||
import { Locale, localeNames } from "@saleor/components/Locale";
|
||||
import SingleAutocompleteSelectField from "@saleor/components/SingleAutocompleteSelectField";
|
||||
import { capitalize } from "@saleor/misc";
|
||||
|
||||
interface StaffPreferencesProps {
|
||||
locale: Locale;
|
||||
|
@ -29,7 +30,7 @@ const StaffPreferences: React.StatelessComponent<StaffPreferencesProps> = ({
|
|||
<CardContent>
|
||||
<SingleAutocompleteSelectField
|
||||
choices={Object.values(Locale).map(locale => ({
|
||||
label: localeNames[locale],
|
||||
label: capitalize(localeNames[locale]),
|
||||
value: locale
|
||||
}))}
|
||||
displayValue={localeNames[locale]}
|
||||
|
|
Loading…
Reference in a new issue