Files
daily-counter/app/streamlit_app.py
John Ahlroos 8ae8bc7a24
Some checks failed
Run Tests / run-tests (push) Failing after 1m3s
Add user color settings
2026-04-30 14:17:09 +02:00

28 lines
996 B
Python

import streamlit as st
from streamlit import dialog
import queries.user as user_queries
from logger import init_logger
from styles import init_styles
from user import init_user, is_login_enabled, is_logged_in
init_logger()
init_user()
init_styles()
if is_login_enabled and not is_logged_in:
with st.container(width="stretch", height="stretch", horizontal_alignment="center"):
st.title("Daily Counter", width="stretch", text_alignment="center")
st.text("Please log in to use this app", width="stretch", text_alignment="center")
st.space()
if st.button("Log in"):
st.login()
else:
counters = st.Page("pages/counters.py", title="Counters", icon=":material/update:")
stats = st.Page("pages/stats.py", title="Statistics", icon=":material/chart_data:")
settings = st.Page("pages/settings.py", title=" ", icon=":material/menu:")
pages = [counters, stats, settings]
pg = st.navigation(position="top", pages=pages)
pg.run()