Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix light/dark logo switch. #59

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,13 @@
config = load_config()

# Determine the theme and set the appropriate logo
theme = st_theme()["base"]
print(f"orginal theme: {theme}")
if theme == "dark":
logo_url = LOGO_TEXT_DARK_URL
print(theme)
print("changed logo: ", logo_url)
else:
logo_url = LOGO_TEXT_LIGHT_URL
print(theme)
print("changed logo: ", logo_url)
theme_data = st_theme()
st.session_state.theme = (
theme_data["base"] if theme_data is not None else "default_theme"
)
logo_url = (
LOGO_TEXT_DARK_URL if st.session_state.theme == "dark" else LOGO_TEXT_LIGHT_URL
)

# Display the logo and set up the sidebar with useful information and links.
st.logo(logo_url, icon_image=LOGO_URL)
Expand Down