fix: dark mode not working in editors (#1773)

This commit is contained in:
Aman Harwara
2022-10-10 21:47:57 +05:30
committed by GitHub
parent dcb8024deb
commit 27d2c95b5b
30 changed files with 127 additions and 190 deletions

View File

@@ -1,4 +1,7 @@
import { ThemeItem } from '@/Components/QuickSettingsMenu/ThemeItem'
import { FeatureIdentifier } from '@standardnotes/snjs'
const isDarkModeTheme = (theme: ThemeItem) => theme.identifier === FeatureIdentifier.DarkTheme
export const sortThemes = (a: ThemeItem, b: ThemeItem) => {
const aIsLayerable = a.component?.isLayerable()
@@ -8,6 +11,8 @@ export const sortThemes = (a: ThemeItem, b: ThemeItem) => {
return 1
} else if (!aIsLayerable && bIsLayerable) {
return -1
} else if (!isDarkModeTheme(a) && isDarkModeTheme(b)) {
return 1
} else {
return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1
}