-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: dbot dark_mode production (#7885)
* fix: dbot dark_mode production * fix: removed unused hook * fix: review comments --------- Co-authored-by: Jim Daniels Wasswa <104334373+jim-deriv@users.noreply.github.com>
- Loading branch information
1 parent
873b920
commit 711a54e
Showing
3 changed files
with
64 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,65 @@ | ||
const isDarkModeEnabled = () => { | ||
const ui_store = localStorage.getItem('ui_store'); | ||
const darkMode = () => { | ||
const workspace = Blockly; | ||
workspace.Colours.RootBlock = { | ||
colour: '#183046', | ||
colourSecondary: '#F2F3F5', | ||
colourTertiary: '#151717', | ||
}; | ||
workspace.Colours.Base = { | ||
colour: '#C2C2C2', | ||
colourSecondary: '#0e0e0e', | ||
colourTertiary: '#0e0e0e', | ||
}; | ||
|
||
if (ui_store && ui_store.length > 0) { | ||
return JSON.parse(ui_store).is_dark_mode_on || false; | ||
} | ||
return false; | ||
}; | ||
|
||
export const setColors = () => { | ||
if (isDarkModeEnabled()) { | ||
Blockly.Colours.RootBlock = { | ||
colour: '#183046', | ||
colourSecondary: '#F2F3F5', | ||
colourTertiary: '#151717', | ||
}; | ||
Blockly.Colours.Base = { | ||
colour: '#C2C2C2', | ||
colourSecondary: '#0e0e0e', | ||
colourTertiary: '#0e0e0e', | ||
}; | ||
workspace.Colours.Special1 = { | ||
colour: '#C2C2C2', | ||
colourSecondary: '#0e0e0e', | ||
colourTertiary: '#6d7278', | ||
}; | ||
|
||
Blockly.Colours.Special1 = { | ||
colour: '#C2C2C2', | ||
colourSecondary: '#0e0e0e', | ||
colourTertiary: '#6d7278', | ||
}; | ||
workspace.Colours.Special2 = { | ||
colour: '#C2C2C2', | ||
colourSecondary: '#0e0e0e', | ||
colourTertiary: '#D27954', | ||
}; | ||
|
||
Blockly.Colours.Special2 = { | ||
colour: '#C2C2C2', | ||
colourSecondary: '#0e0e0e', | ||
colourTertiary: '#D27954', | ||
}; | ||
workspace.Colours.Special3 = { | ||
colour: '#C2C2C2', | ||
colourSecondary: '#0e0e0e', | ||
colourTertiary: '#D27954', | ||
}; | ||
}; | ||
|
||
Blockly.Colours.Special3 = { | ||
colour: '#C2C2C2', | ||
colourSecondary: '#0e0e0e', | ||
colourTertiary: '#D27954', | ||
}; | ||
} else { | ||
Blockly.Colours.RootBlock = { | ||
colour: '#064e72', | ||
colourSecondary: '#064e72', | ||
colourTertiary: '#6d7278', | ||
}; | ||
const lightMode = () => { | ||
const workspace = Blockly; | ||
workspace.Colours.RootBlock = { | ||
colour: '#064e72', | ||
colourSecondary: '#064e72', | ||
colourTertiary: '#6d7278', | ||
}; | ||
|
||
Blockly.Colours.Base = { | ||
colour: '#e5e5e5', | ||
colourSecondary: '#ffffff', | ||
colourTertiary: '#6d7278', | ||
}; | ||
workspace.Colours.Base = { | ||
colour: '#e5e5e5', | ||
colourSecondary: '#ffffff', | ||
colourTertiary: '#6d7278', | ||
}; | ||
|
||
Blockly.Colours.Special1 = { | ||
colour: '#e5e5e5', | ||
colourSecondary: '#ffffff', | ||
colourTertiary: '#6d7278', | ||
}; | ||
workspace.Colours.Special1 = { | ||
colour: '#e5e5e5', | ||
colourSecondary: '#ffffff', | ||
colourTertiary: '#6d7278', | ||
}; | ||
|
||
Blockly.Colours.Special2 = { | ||
colour: '#e5e5e5', | ||
colourSecondary: '#ffffff', | ||
colourTertiary: '#6d7278', | ||
}; | ||
workspace.Colours.Special2 = { | ||
colour: '#e5e5e5', | ||
colourSecondary: '#ffffff', | ||
colourTertiary: '#6d7278', | ||
}; | ||
|
||
Blockly.Colours.Special3 = { | ||
colour: '#e5e5e5', | ||
colourSecondary: '#ffffff', | ||
colourTertiary: '#6d7278', | ||
}; | ||
} | ||
workspace.Colours.Special3 = { | ||
colour: '#e5e5e5', | ||
colourSecondary: '#ffffff', | ||
colourTertiary: '#6d7278', | ||
}; | ||
}; | ||
|
||
setColors(); | ||
export const setColors = is_dark_mode => (is_dark_mode ? darkMode() : lightMode()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
711a54e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
deriv-app – ./
binary.sx
deriv-app.binary.sx
deriv-app-git-master.binary.sx
deriv-app.vercel.app