mirror of
https://github.com/hanzoai/cd-ui.git
synced 2026-10-30 20:42:45 +00:00
feat: GitHub workflows and linter for new project structure (#154) Signed-off-by: andrii-codefresh <[email protected]>
11 lines
454 B
TypeScript
11 lines
454 B
TypeScript
import * as React from 'react';
|
|
import {Theme, ThemeContext} from '../../shared/context/theme';
|
|
import {ActionButton} from '../action-button/action-button';
|
|
|
|
export const ThemeToggle = () => {
|
|
const dmCtx = React.useContext(ThemeContext);
|
|
const isDark = dmCtx.theme === Theme.Dark;
|
|
const icon = isDark ? 'fa-sun' : 'fa-moon';
|
|
return <ActionButton action={() => dmCtx.set(isDark ? Theme.Light : Theme.Dark)} icon={icon} dark={true} />;
|
|
};
|