-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
36 lines (27 loc) · 1.03 KB
/
Copy pathapp.py
File metadata and controls
36 lines (27 loc) · 1.03 KB
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
26
27
28
29
30
31
32
33
34
35
36
import streamlit as st
from src.screens.home_screen import home_screen
from src.screens.teacher_screen import teacher_screen
from src.screens.student_screen import student_screen
from src.components.dialog_auto_enroll import auto_enroll_dialog
def main():
st.set_page_config(
page_title='SnapClass - Making Attendance faster using AI',
page_icon= "https://i.ibb.co/YTYGn5qV/logo.png"
)
if 'login_type' not in st.session_state:
st.session_state['login_type'] = None
match st.session_state['login_type']:
case 'teacher':
teacher_screen()
case 'student':
student_screen()
case None:
home_screen()
join_code = st.query_params.get('join-code')
if join_code:
if st.session_state.login_type != 'student':
st.session_state.login_type = 'student'
st.rerun()
if st.session_state.get('is_logged_in') and st.session_state.get('user_role') == 'student':
auto_enroll_dialog(join_code)
main()