Skip to content

Commit 29216fe

Browse files
author
Lucas Araujo
committed
[DDW-738] Review changes - use lang selector
1 parent 81d5382 commit 29216fe

File tree

5 files changed

+8
-31
lines changed

5 files changed

+8
-31
lines changed

source/renderer/app/App.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ export default class App extends Component<{
4848
!isNodeStopping && // Daedalus is not shutting down
4949
!isNodeStopped; // Daedalus is not shutting down
5050

51+
document.documentElement.lang = locale;
52+
5153
return (
5254
<Fragment>
5355
<ThemeManager variables={themeVars} />

source/renderer/app/components/settings/menu/SecurityMenuItem.js

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,11 @@ import type { Intl } from '../../../types/i18nTypes';
1414

1515
type Props = {
1616
intl: Intl,
17-
currentLocale: string,
1817
isActiveItem: Function,
1918
onClick: Function,
2019
};
2120

22-
const SecurityMenuItem = ({
23-
intl,
24-
isActiveItem,
25-
currentLocale,
26-
onClick,
27-
}: Props) => {
21+
const SecurityMenuItem = ({ intl, isActiveItem, onClick }: Props) => {
2822
const {
2923
isNotificationEnabled,
3024
setDiscreetModeNotification,
@@ -34,7 +28,6 @@ const SecurityMenuItem = ({
3428
setDiscreetModeNotification(false);
3529
setDiscreetModeSettingsTooltip(false);
3630
};
37-
const isJapanese = currentLocale === 'ja-JP';
3831
const isActive = isActiveItem(ROUTES.SETTINGS.SECURITY);
3932

4033
useTriggerOnRouteLeave({
@@ -46,11 +39,7 @@ const SecurityMenuItem = ({
4639
return (
4740
<NotificationDot
4841
enabled={isNotificationEnabled}
49-
dotClassName={classnames(
50-
styles.dot,
51-
isActive && styles.active,
52-
isJapanese && styles.jp
53-
)}
42+
dotClassName={classnames(styles.dot, isActive && styles.active)}
5443
>
5544
<SettingsMenuItem
5645
active={isActive}

source/renderer/app/components/settings/menu/SettingsMenu.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,16 @@ import styles from './SettingsMenu.scss';
77
import { ROUTES } from '../../../routes-config';
88
import messages from './SettingsMenu.messages';
99
import type { Intl } from '../../../types/i18nTypes';
10-
import type { Locale } from '../../../../../common/types/locales.types';
1110
import SecurityMenuItem from './SecurityMenuItem';
1211

1312
type Props = {
1413
intl: Intl,
1514
isFlight: boolean,
1615
isActiveItem: Function,
17-
currentLocale: Locale,
1816
onItemClick: Function,
1917
};
2018

21-
const SettingsMenu = ({
22-
intl,
23-
currentLocale,
24-
onItemClick,
25-
isActiveItem,
26-
isFlight,
27-
}: Props) => {
19+
const SettingsMenu = ({ intl, onItemClick, isActiveItem, isFlight }: Props) => {
2820
return (
2921
<div>
3022
<div className={styles.component}>
@@ -34,11 +26,7 @@ const SettingsMenu = ({
3426
active={isActiveItem(ROUTES.SETTINGS.GENERAL)}
3527
className="general"
3628
/>
37-
<SecurityMenuItem
38-
isActiveItem={isActiveItem}
39-
currentLocale={currentLocale}
40-
onClick={onItemClick}
41-
/>
29+
<SecurityMenuItem isActiveItem={isActiveItem} onClick={onItemClick} />
4230
<SettingsMenuItem
4331
label={intl.formatMessage(messages.wallets)}
4432
onClick={() => onItemClick(ROUTES.SETTINGS.WALLETS)}

source/renderer/app/components/settings/menu/SettingsMenu.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
right: 134px;
1717
}
1818

19-
&.jp {
19+
&:lang(ja-JP) {
2020
right: 108px;
2121
}
2222
}

source/renderer/app/containers/settings/Settings.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,16 @@ export default class Settings extends Component<InjectedContainerProps> {
2828
render() {
2929
const { isFlight } = global;
3030
const { actions, stores, children } = this.props;
31-
const { networkStatus, app, router, profile } = stores;
31+
const { networkStatus, app, router } = stores;
3232
const { isSynced } = networkStatus;
3333
const { currentRoute } = app;
3434
const { location } = router;
35-
const { currentLocale } = profile;
3635

3736
const menu = (
3837
<SettingsMenu
3938
isSyncing={!isSynced}
4039
isFlight={isFlight}
4140
currentRoute={currentRoute}
42-
currentLocale={currentLocale}
4341
onItemClick={(route) => actions.router.goToRoute.trigger({ route })}
4442
isActiveItem={this.isActivePage}
4543
/>

0 commit comments

Comments
 (0)