webhub / app.py
minhthong's picture
Update app.py
d5d066d verified
raw
history blame contribute delete
No virus
1.25 kB
import os
import streamlit as st
import streamlit_antd_components as sac
# Cấu hình trang web với chế độ wide mode
st.set_page_config(layout="wide")
# CSS để thiết lập nền trắng và ẩn sidebar mặc định
custom_style = """
<style>
body {
background-color: white;
}
div[data-testid="stSidebarNav"] {display: none;}
</style>
"""
st.markdown(custom_style, unsafe_allow_html=True)
# Tạo menu trong sidebar
with st.sidebar:
menu_item = sac.menu([
sac.MenuItem('Trang chủ', icon='house-fill'),
sac.MenuItem('FiO Advisor', icon='box-fill', children=[
sac.MenuItem('Danh mục phân tích', icon='bi bi-bookmark-star-fill'),
sac.MenuItem('Flash Deal', icon='bi bi-lightning-fill'),
]),
], open_all=True)
# Link to the respective pages using exec
if menu_item == 'Trang chủ':
exec(open('folder/pages/home.py').read(), globals())
elif menu_item == 'Danh mục phân tích':
exec(open('folder/pages/apple.py').read(), globals())
elif menu_item == 'Flash Deal':
exec(open('folder/pages/FlashDeal.py').read(), globals())
elif menu_item == 'FiO Advisor':
exec(open('folder/pages/products.py').read(), globals())