Skip to content

Commit

Permalink
website: fix type error.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jun 20, 2022
1 parent 673c953 commit 566dcfb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions www/src/pages/theme/editor/ColorMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ export const ColorMenu: React.FC<PropsWithChildren<ColorMenuProps>> = ({ color,
};

interface SwitchThemeProps {
theme?: CreateThemeOptions['dark'];
onChange?: (theme: CreateThemeOptions['dark']) => void;
theme?: CreateThemeOptions['theme'];
onChange?: (theme: CreateThemeOptions['theme']) => void;
}

export const SwitchTheme = ({ theme, onChange }: SwitchThemeProps) => {
const handleChange = (event: React.ChangeEvent<HTMLInputElement>, theme: CreateThemeOptions['dark']) => {
const handleChange = (event: React.ChangeEvent<HTMLInputElement>, theme: CreateThemeOptions['theme']) => {
onChange && onChange(theme);
};
return (
Expand Down
4 changes: 2 additions & 2 deletions www/src/pages/theme/editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function ThemeEditor() {
const [extension, setExtension] = useState<Extension>(javascript({ jsx: true }));
const [code, setCode] = useState('');
const [lang, setLang] = useState('jsx');
const [theme, setTheme] = useState<CreateThemeOptions['dark']>('light');
const [theme, setTheme] = useState<CreateThemeOptions['theme']>('light');
const [settings, setSettings] = useState<CreateThemeOptions['settings']>({
background: '#fff',
foreground: '#4D4D4C',
Expand All @@ -74,7 +74,7 @@ export function ThemeEditor() {
const [styles, setStyles] = useState<Style>(defalutStyle);

const myTheme = createTheme({
dark: theme,
theme: theme,
settings: { ...settings },
styles: [
getStyle(styles.comment, { tag: t.comment }),
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/theme/editor/themeCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const defalutStyle: Style = {
processingInstruction: '',
};

export type ThmeCodeStyle = Style & CreateThemeOptions['settings'] & { dark: CreateThemeOptions['dark'] };
export type ThmeCodeStyle = Style & CreateThemeOptions['settings'] & { dark: CreateThemeOptions['theme'] };

export const themeCode = (styles: Partial<ThmeCodeStyle> = {}) => {
const data: string[] = [];
Expand Down

0 comments on commit 566dcfb

Please sign in to comment.