Skip to content
This repository was archived by the owner on Jan 16, 2022. It is now read-only.

Commit 90fb8d8

Browse files
ref(ui): moved load-dayjs-locale file
1 parent 19091b7 commit 90fb8d8

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

src/App/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import Loading from '../components/Loading';
1313
import Box from '../muiComponents/Box';
1414
import StyleBaseline from '../design-tokens/StyleBaseline';
1515
import { Theme } from '../design-tokens/theme';
16+
import loadDayJSLocale from '../design-tokens/load-dayjs-locale';
1617

1718
import AppContextProvider from './AppContextProvider';
1819
import AppRoute, { history } from './AppRoute';
19-
import loadDayJSLocale from './load-dayjs-locale';
2020

2121
const StyledBox = styled(Box)<{ theme?: Theme }>(({ theme }) => ({
2222
backgroundColor: theme?.palette.background.default,

src/design-tokens/ThemeProvider.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import { ThemeProvider as MuiThemeProvider } from '@material-ui/core/styles';
33
import { ThemeProvider as EmotionThemeProvider } from 'emotion-theming';
44
import i18next from 'i18next';
55

6-
import loadDayJSLocale from '../App/load-dayjs-locale';
7-
6+
import loadDayJSLocale from './load-dayjs-locale';
87
import ThemeContext from './ThemeContext';
98
import { getTheme, ThemeMode } from './theme';
109
import useLocalStorage from './useLocalStorage';
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,7 @@ function loadDayJSLocale() {
1919
const fallbackLanguage = getFallFackLanguage();
2020
const locale = i18n.language || fallbackLanguage;
2121

22-
switch (locale.toLowerCase()) {
23-
case 'en-us':
24-
{
25-
require('dayjs/locale/en');
26-
dayjs.locale('en');
27-
}
28-
break;
22+
switch (locale?.toLowerCase()) {
2923
case 'pt-br':
3024
{
3125
require('dayjs/locale/pt-br');
@@ -69,6 +63,10 @@ function loadDayJSLocale() {
6963
}
7064
break;
7165
default:
66+
{
67+
require('dayjs/locale/en');
68+
dayjs.locale('en');
69+
}
7270
break;
7371
}
7472
}

tools/webpack.dev.config.babel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default {
4242
title: 'Verdaccio Dev UI',
4343
scope: '',
4444
filename: 'index.html',
45-
verdaccioURL: '//localhost:4872',
45+
verdaccioURL: '//localhost:4873',
4646
template: `${env.SRC_ROOT}/template/index.html`,
4747
debug: true,
4848
inject: true,

0 commit comments

Comments
 (0)