-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmenu.py
25 lines (21 loc) · 1.01 KB
/
menu.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import streamlit as st
def unauthenticated_menu():
# Show a navigation menu for unauthenticated users
st.sidebar.page_link("app.py", label="Popis")
st.sidebar.page_link("pages/1_import_trades.py", label="Import obchodů")
st.sidebar.page_link("pages/2_overview.py", label="Korekce / doplnění obchodů")
st.sidebar.page_link("pages/3_symbols.py", label="Přehled podle symbolů")
st.sidebar.page_link("pages/4_pairing.py", label="Daňový přehled")
st.sidebar.page_link("pages/5_positions.py", label="Přehled otevřených pozic")
def menu():
# Determine if a user is logged in or not, then show the correct
# navigation menu
if "role" not in st.session_state or st.session_state.role is None:
unauthenticated_menu()
return
def menu_with_redirect():
# Redirect users to the main page if not logged in, otherwise continue to
# render the navigation menu
if "role" not in st.session_state or st.session_state.role is None:
st.switch_page("app.py")
menu()