-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
307 additions
and
85 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import AppDialog from "./AppDialog.tsx"; | ||
import {StackedModalProps, useModals} from '@alchemy/navigation'; | ||
import {MuiThemeEditor} from '@alchemy/theme-editor'; | ||
|
||
type Props = {} & StackedModalProps; | ||
|
||
export default function ThemeEditor({ | ||
open, | ||
modalIndex, | ||
}: Props) { | ||
const {closeModal} = useModals(); | ||
|
||
const onClose= () => closeModal(); | ||
|
||
return <AppDialog | ||
modalIndex={modalIndex} | ||
open={open} | ||
onClose={onClose} | ||
> | ||
<MuiThemeEditor | ||
onClose={onClose} | ||
/> | ||
</AppDialog> | ||
} |
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,19 +1,16 @@ | ||
import {Theme, ThemeOptions} from '@mui/material'; | ||
import {createTheme} from '@mui/material/styles'; | ||
import {ThemeOptions} from '@mui/material'; | ||
import {mergeDeep} from './merge'; | ||
import baseTheme from '../themes/base'; | ||
import themes from '../themes'; | ||
|
||
const themeCache: Record<string, Theme> = {}; | ||
const themeCache: Record<string, ThemeOptions> = {}; | ||
|
||
export type ThemeName = keyof typeof themes; | ||
|
||
export function createCachedTheme(name: ThemeName): Theme { | ||
export function createCachedThemeOptions(name: ThemeName): ThemeOptions { | ||
if (themeCache[name]) { | ||
return themeCache[name]; | ||
} | ||
|
||
return (themeCache[name] = createTheme( | ||
mergeDeep({}, baseTheme, themes[name]) as ThemeOptions | ||
)); | ||
return (themeCache[name] = mergeDeep({}, baseTheme, themes[name]) as ThemeOptions); | ||
} |
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,8 +1,10 @@ | ||
import {initSentry, logError} from "./src/sentry"; | ||
import {ErrorBoundary} from "@sentry/react"; | ||
|
||
export { | ||
initSentry, | ||
logError, | ||
ErrorBoundary, | ||
}; | ||
|
||
export * from './src/types'; |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import ThemeEditorProvider from "./src/ThemeEditorProvider"; | ||
import MuiThemeEditor from "./src/MuiThemeEditor"; | ||
import ThemeEditorContext from "./src/ThemeEditorContext"; | ||
export { | ||
ThemeEditorProvider, | ||
MuiThemeEditor, | ||
ThemeEditorContext, | ||
}; | ||
|
||
export * from './src/types'; | ||
|
Oops, something went wrong.