0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00
ghost/apps/admin-x-design-system/src/DesignSystemApp.tsx
Steve Larson f7a592e761
🐛 Fixed dark mode for standalone html editors in Admin X (#20689)
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.
2024-07-30 09:18:51 -05:00

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;