mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
f7a592e761
ref https://linear.app/tryghost/issue/DES-591 - finished wiring up the darkMode prop through the context providers The main impact here was that the formatting toolbar was not respecting the dark mode settings.
27 lines
846 B
TypeScript
27 lines
846 B
TypeScript
import clsx from 'clsx';
|
|
import React from 'react';
|
|
import {FetchKoenigLexical} from './global/form/HtmlEditor';
|
|
import DesignSystemProvider from './providers/DesignSystemProvider';
|
|
|
|
export interface DesignSystemAppProps extends React.HTMLProps<HTMLDivElement> {
|
|
darkMode: boolean;
|
|
fetchKoenigLexical: FetchKoenigLexical;
|
|
}
|
|
|
|
const DesignSystemApp: React.FC<DesignSystemAppProps> = ({darkMode, fetchKoenigLexical, className, children, ...props}) => {
|
|
const appClassName = clsx(
|
|
'admin-x-base',
|
|
darkMode && 'dark',
|
|
className
|
|
);
|
|
|
|
return (
|
|
<div className={appClassName} {...props}>
|
|
<DesignSystemProvider darkMode={darkMode} fetchKoenigLexical={fetchKoenigLexical}>
|
|
{children}
|
|
</DesignSystemProvider>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default DesignSystemApp;
|