Skip to content

Commit

Permalink
always dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
musordmt committed Aug 20, 2024
1 parent 9bc9fdd commit 308943b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 29 deletions.
1 change: 1 addition & 0 deletions pkg/ui/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import projectsApi from '@/api/projects'
const App = () => {
const customization = useSelector((state) => state.customization)
const createProject = useApi(projectsApi.createProject)
customization.isDarkMode = true

useEffect(() => {
window.addEventListener('message', (event) => {
Expand Down
43 changes: 14 additions & 29 deletions pkg/ui/src/themes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,20 @@ import themeTypography from './typography'
export const theme = (customization) => {
const color = colors

const themeOption = customization.isDarkMode
? {
colors: color,
heading: color.paper,
paper: color.darkPrimaryLight,
backgroundDefault: color.darkPaper,
background: color.darkPrimaryLight,
darkTextPrimary: color.paper,
darkTextSecondary: color.paper,
textDark: color.paper,
menuSelected: color.darkSecondaryDark,
menuSelectedBack: color.darkSecondaryLight,
divider: color.darkPaper,
customization
}
: {
colors: color,
heading: color.grey900,
paper: color.paper,
backgroundDefault: color.paper,
background: color.primaryLight,
darkTextPrimary: color.grey700,
darkTextSecondary: color.grey500,
textDark: color.grey900,
menuSelected: color.secondaryDark,
menuSelectedBack: color.secondaryLight,
divider: color.grey200,
customization
}
const themeOption = {
colors: color,
heading: color.paper,
paper: color.darkPrimaryLight,
backgroundDefault: color.darkPaper,
background: color.darkPrimaryLight,
darkTextPrimary: color.paper,
darkTextSecondary: color.paper,
textDark: color.paper,
menuSelected: color.darkSecondaryDark,
menuSelectedBack: color.darkSecondaryLight,
divider: color.darkPaper,
customization
}

const themeOptions = {
direction: 'ltr',
Expand Down

0 comments on commit 308943b

Please sign in to comment.