feat: Show different icon in theme menu to switch to light mode

This commit is contained in:
Tom Moor
2020-05-17 19:15:55 -07:00
parent 18cf148bd1
commit 93abbab44a
3 changed files with 18 additions and 13 deletions

View File

@@ -3,7 +3,7 @@ import * as React from 'react';
import { Link } from 'react-router-dom';
import { observable } from 'mobx';
import { inject, observer } from 'mobx-react';
import { MoonIcon } from 'outline-icons';
import { SunIcon, MoonIcon } from 'outline-icons';
import styled, { withTheme } from 'styled-components';
import UiStore from 'stores/UiStore';
import AuthStore from 'stores/AuthStore';
@@ -84,12 +84,17 @@ class AccountMenu extends React.Component<Props> {
</DropdownMenuItem>
<hr />
<DropdownMenuItem onClick={ui.toggleDarkMode}>
<NightMode justify="space-between">
Night Mode{' '}
<MoonIcon
color={isLightTheme ? theme.textSecondary : theme.primary}
/>
</NightMode>
<ChangeTheme justify="space-between">
{isLightTheme ? (
<React.Fragment>
Dark theme <MoonIcon />
</React.Fragment>
) : (
<React.Fragment>
Light theme <SunIcon />
</React.Fragment>
)}
</ChangeTheme>
</DropdownMenuItem>
<hr />
<DropdownMenuItem onClick={this.handleLogout}>
@@ -101,7 +106,7 @@ class AccountMenu extends React.Component<Props> {
}
}
const NightMode = styled(Flex)`
const ChangeTheme = styled(Flex)`
width: 100%;
`;

View File

@@ -120,7 +120,7 @@
"mobx-react": "^5.4.2",
"natural-sort": "^1.0.0",
"nodemailer": "^4.4.0",
"outline-icons": "^1.14.0",
"outline-icons": "^1.16.0",
"oy-vey": "^0.10.0",
"pg": "^6.1.5",
"pg-hstore": "2.3.2",

View File

@@ -7145,10 +7145,10 @@ osenv@^0.1.4:
os-homedir "^1.0.0"
os-tmpdir "^1.0.0"
outline-icons@^1.10.0, outline-icons@^1.14.0:
version "1.14.0"
resolved "https://registry.yarnpkg.com/outline-icons/-/outline-icons-1.14.0.tgz#1f737fa6d58e8ccf0f1d1f4287832e0c4d6656ad"
integrity sha512-LaFgl5i8wBm7Ud7aXH+VR/3NNJy7UvUih+gu1S2vyYawFHnGkfh1/EwQ2LcrNOLUXr/pH+I5g9UhSeUnCDkCFg==
outline-icons@^1.10.0, outline-icons@^1.16.0:
version "1.16.0"
resolved "https://registry.yarnpkg.com/outline-icons/-/outline-icons-1.16.0.tgz#0a71d2fe32170f0e00b8775681f0339f4fc8777a"
integrity sha512-6bAk5rBGVtYiFP6AONx7NdmpFP+daKUJEev7PAjdfTVmE3bPXeSzzaGY51Y1XM8UdP5XqJICWncktRHeSfn1Pw==
oy-vey@^0.10.0:
version "0.10.0"