File size: 754 Bytes
53bbad7
 
699b8ce
 
 
53bbad7
699b8ce
 
0eb4850
699b8ce
0eb4850
 
 
 
 
 
 
 
 
 
53bbad7
699b8ce
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import streamlit as st

def main():
    st.set_page_config(page_title="Terms of Service Agreement", page_icon=":guardsman:", layout="wide")
    st.title("Terms of Service Agreement")

    agreed = st.checkbox("I agree to the terms of service")
    username = st.text_input("Enter your username")

    if st.button("Submit") and agreed and username.strip():
        st.experimental_rerun()
        st.session_state["user_name"] = username
        st.session_state["tos_agreed"] = True
        st.experimental_reroute("/congratulations")

    if not st.session_state.get("tos_agreed", False):
        return

    st.title("Congratulations!")
    st.write(f"Welcome to our platform, {st.session_state['user_name']}!")

if __name__ == "__main__":
    main()