-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* accessibility improvements * charts colors and layout * merge fix * reduce not needed madding and margins * removed unnecessary margins * removed unnecessary margins * feat: add dark mode redux actions * data ink optimization * fix: add missing actions * added switch dark mode * fix: add missing actions * charts splitline opacity * various fixes * feat: add dark mode and light mode buttons * fix accessibility WIP * sider-bk image * feat: add button in all the pages * fix: useLayoutConfiguration * spaces fix * fix: header * fix: icon position * fix: add anchor * fix: copy * charts readability * fix: padding logo * fix launchpad chart readability * Merge branch 'dark-mode' of https://github.com/radicalbit/radicalbit-ai-monitoring into dark-mode * fix legend * table color * add legend on datapoint distribution chart * feat: remove unseless file * feat(ui): add new version of @radicalbit/radicalbit-design-system * feat(ui): fix dark mode legend on some charts * feat(ui): fix axis label of confusionMatrix * little fixes * icon size fix * feat: remove obsolete less styles --------- Co-authored-by: cybermarinella <marinella.mastrosimone@gmail.com> Co-authored-by: Luca Tagliabue <luca.tagliabue@radicalbit.io>
- Loading branch information
1 parent
0eec4a9
commit 1c3bc31
Showing
86 changed files
with
586 additions
and
309 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
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
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
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
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
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,17 +1,64 @@ | ||
import { NewHeader, SectionTitle } from '@radicalbit/radicalbit-design-system'; | ||
import { | ||
MAIN_LAYOUT_DARK_MODE_CONFIGURATION, | ||
MAIN_LAYOUT_LIGHT_MODE_CONFIGURATION, | ||
} from '@Container/layout/layout-provider/layout-provider-configuration'; | ||
import { faMoon, faSun } from '@fortawesome/free-solid-svg-icons'; | ||
import { | ||
FontAwesomeIcon, NewHeader, SectionTitle, Tooltip, | ||
} from '@radicalbit/radicalbit-design-system'; | ||
import { useState } from 'react'; | ||
import { useDispatch } from 'react-redux'; | ||
|
||
export default function MainListModelsHeader() { | ||
const title = 'AI Monitoring Launchpad'; | ||
const subtitle = 'a comprehensive dashboard to track model performance, access setup resources, review alerts and ensure data completeness.'; | ||
|
||
return ( | ||
<NewHeader | ||
actions={{ | ||
one: <DarkMode />, | ||
two: <div style={{ width: '1rem', height: '1rem' }} />, | ||
}} | ||
title={( | ||
<SectionTitle | ||
subtitle={subtitle} | ||
title={title} | ||
/> | ||
<> | ||
<h1>{title}</h1> | ||
|
||
<SectionTitle subtitle={subtitle} /> | ||
</> | ||
)} | ||
/> | ||
); | ||
} | ||
|
||
function DarkMode() { | ||
const dispatch = useDispatch(); | ||
const [isDarkMode, setIsDarkMode] = useState(!!window.localStorage.getItem('enable-dark-mode')); | ||
|
||
const handleOnEnableDarkMode = () => { | ||
window.localStorage.setItem('enable-dark-mode', true); | ||
setIsDarkMode(true); | ||
|
||
MAIN_LAYOUT_DARK_MODE_CONFIGURATION.forEach((action) => dispatch(action())); | ||
}; | ||
|
||
const handleOnEnableLightMode = () => { | ||
window.localStorage.removeItem('enable-dark-mode'); | ||
setIsDarkMode(false); | ||
|
||
MAIN_LAYOUT_LIGHT_MODE_CONFIGURATION.forEach((action) => dispatch(action())); | ||
}; | ||
|
||
if (isDarkMode) { | ||
return ( | ||
<Tooltip title="Switch to light mode"> | ||
<FontAwesomeIcon icon={faMoon} onClick={handleOnEnableLightMode} /> | ||
</Tooltip> | ||
); | ||
} | ||
|
||
return ( | ||
<Tooltip title="Switch to dark mode"> | ||
<FontAwesomeIcon icon={faSun} onClick={handleOnEnableDarkMode} /> | ||
</Tooltip> | ||
); | ||
} |
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
Oops, something went wrong.