From 8eed1f4b04987ffcf094d8d2d90aaf9cff2021b9 Mon Sep 17 00:00:00 2001 From: iKettles Date: Wed, 29 Jan 2020 12:06:42 +0100 Subject: [PATCH] Add new palette colors to Framer ThemeProvider component --- .../code/ThemeProvider.tsx | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/framer/Material-UI.framerfx/code/ThemeProvider.tsx b/framer/Material-UI.framerfx/code/ThemeProvider.tsx index f61734d30b81fd..4f30acd28f45d6 100644 --- a/framer/Material-UI.framerfx/code/ThemeProvider.tsx +++ b/framer/Material-UI.framerfx/code/ThemeProvider.tsx @@ -10,6 +10,9 @@ interface Props { primary?: string; secondary?: string; error?: string; + info?: string; + warning?: string; + success?: string; } const defaultProps: Props = { @@ -17,10 +20,23 @@ const defaultProps: Props = { primary: '#3f51b5', secondary: '#f50057', error: '#f44336', + info: '#2196f3', + warning: '#ff9800', + success: '#4caf4f', }; export const Theme: React.SFC = (props: Props) => { - const { children, error, paletteType, primary, secondary, ...other } = props; + const { + children, + error, + paletteType, + primary, + secondary, + info, + warning, + success, + ...other + } = props; const theme = createMuiTheme({ palette: { @@ -28,6 +44,9 @@ export const Theme: React.SFC = (props: Props) => { primary: { main: parseColor(primary) }, secondary: { main: parseColor(secondary) }, error: { main: parseColor(error) }, + info: { main: parseColor(info) }, + warning: { main: parseColor(warning) }, + success: { main: parseColor(success) }, }, }); @@ -58,4 +77,16 @@ addPropertyControls(Theme, { type: ControlType.Color, title: 'Error', }, + info: { + type: ControlType.Color, + title: 'Info', + }, + warning: { + type: ControlType.Color, + title: 'Warning', + }, + success: { + type: ControlType.Color, + title: 'Success', + }, });