Skip to content

Commit

Permalink
chore: Update theme manager to use default theme constant
Browse files Browse the repository at this point in the history
  • Loading branch information
jaigouk committed Sep 7, 2024
1 parent 8fc172b commit c6e217c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
7 changes: 5 additions & 2 deletions frontend/storm_wiki/pages_util/Settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@
SEARCH_ENGINES,
DARK_THEMES,
LIGHT_THEMES,
LLM_MODELS,
DEFAULT_SEARCH_OPTIONS, DEFAULT_LLM_SETTINGS, LLM_MODELS
LLM_MODELS
)
from util.theme_manager import (
save_theme,
load_theme_from_db,
get_preview_html,
get_all_custom_css,
load_and_apply_theme,
get_theme_css,
get_global_css,
get_option_menu_style,
)
from db.db_operations import (
load_setting,
Expand Down
2 changes: 1 addition & 1 deletion frontend/storm_wiki/storm.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import streamlit as st
import os
from db.db_operations import init_db
from db.db_core import init_db # Updated import
from util.phoenix_setup import setup_phoenix
from streamlit_option_menu import option_menu
from util.theme_manager import load_and_apply_theme, get_option_menu_style
Expand Down
1 change: 1 addition & 0 deletions frontend/storm_wiki/util/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
"font": "sans serif",
}

DEFAULT_THEME = TOKYO_NIGHT

LIGHT_THEMES = {
"Solarized Light": SOLARIZED_LIGHT,
Expand Down
4 changes: 2 additions & 2 deletions frontend/storm_wiki/util/theme_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
FORM_SUBMIT_BUTTON_CSS_TEMPLATE,
PREVIEW_HTML_TEMPLATE,
ALL_CUSTOM_CSS_TEMPLATE,
TOKYO_NIGHT,
DEFAULT_THEME,
)

def save_theme(theme):
Expand All @@ -18,7 +18,7 @@ def save_theme(theme):

def load_theme_from_db():
from db.db_operations import load_setting
return load_setting("theme", "light")
return load_setting("theme", DEFAULT_THEME)

def adjust_color_brightness(hex_color, brightness_factor):
# Convert hex to RGB
Expand Down

0 comments on commit c6e217c

Please sign in to comment.