This commit is contained in:
@@ -2,19 +2,17 @@ import streamlit as st
|
||||
|
||||
import queries.crud as crud
|
||||
import themes as th
|
||||
|
||||
is_login_enabled = hasattr(st, 'user') and hasattr(st.user, 'is_logged_in')
|
||||
is_logged_in = is_login_enabled and st.user.is_logged_in
|
||||
from user import is_logged_in, is_login_enabled
|
||||
|
||||
st.title("Settings")
|
||||
if hasattr(st.session_state, 'user_name'):
|
||||
if hasattr(st.session_state, 'user_name') and st.session_state.user_name:
|
||||
st.markdown(f"Currently logged in as **{st.session_state.user_name}**")
|
||||
|
||||
|
||||
st.header("Theme")
|
||||
themes = st.session_state.themes
|
||||
with st.container(horizontal=True, width="stretch"):
|
||||
for theme in ["light", "dark"]:
|
||||
for theme in themes.keys():
|
||||
if st.button(label=themes[theme]["button_face_label"],
|
||||
icon = themes[theme]["button_face_icon"],
|
||||
disabled = (theme == st.session_state.current_theme),
|
||||
@@ -61,8 +59,9 @@ with st.container(key="settings-color-selector"):
|
||||
""", width=400)
|
||||
|
||||
|
||||
st.header("Actions")
|
||||
with st.container():
|
||||
if is_logged_in:
|
||||
if st.button("Logout", icon=":material/logout:", width="stretch"):
|
||||
st.logout()
|
||||
if is_login_enabled():
|
||||
st.header("Actions")
|
||||
with st.container():
|
||||
if is_logged_in():
|
||||
if st.button("Logout", icon=":material/logout:", width="stretch"):
|
||||
st.logout()
|
||||
Reference in New Issue
Block a user