From 4978b20ec10660cbbf924c0f25dda92551b25ea0 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Thu, 15 Aug 2024 16:41:36 -0700 Subject: [PATCH] fix another silly issue --- reflex/components/datadisplay/code.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/reflex/components/datadisplay/code.py b/reflex/components/datadisplay/code.py index 375d563c8..779d4c5d3 100644 --- a/reflex/components/datadisplay/code.py +++ b/reflex/components/datadisplay/code.py @@ -411,16 +411,18 @@ class CodeBlock(Component): selected_themes = [] for possibleTheme in get_args(LiteralCodeBlockTheme): + if format.to_camel_case(possibleTheme) in themeString: + selected_themes.append(possibleTheme) if possibleTheme in themeString: selected_themes.append(possibleTheme) - selected_themes = sorted(set(selected_themes)) + selected_themes = sorted(set(map(self.convert_theme_name, selected_themes))) imports_.update( { - f"react-syntax-highlighter/dist/cjs/styles/prism/{self.convert_theme_name(theme)}": [ + f"react-syntax-highlighter/dist/cjs/styles/prism/{theme}": [ ImportVar( - tag=format.to_camel_case(self.convert_theme_name(theme)), + tag=format.to_camel_case(theme), is_default=True, install=False, )