trohith89 commited on
Commit
92308a9
·
verified ·
1 Parent(s): 7b78afc

Update home.py

Browse files
Files changed (1) hide show
  1. home.py +14 -8
home.py CHANGED
@@ -3,11 +3,17 @@ import streamlit as st
3
  # Page configuration
4
  st.set_page_config(page_title="Home", layout="centered")
5
 
6
- # Title and description
7
- st.title("Welcome to the Gradient Descent App!")
8
- st.write("Click the button below to explore the playground.")
9
-
10
- # Button to navigate to the playground
11
- if st.button("Go to Playground"):
12
- st.experimental_set_query_params(page="playground")
13
- st.write("Redirecting...")
 
 
 
 
 
 
 
3
  # Page configuration
4
  st.set_page_config(page_title="Home", layout="centered")
5
 
6
+ # Check query parameters using st.query_params
7
+ params = st.experimental_get_query_params() # Replace this
8
+ params = st.query_params # New approach
9
+
10
+ if "page" in params and params["page"][0] == "playground":
11
+ import app # This will display the `app.py` page
12
+ else:
13
+ # Title and description
14
+ st.title("Welcome to the Gradient Descent App!")
15
+ st.write("Click the button below to explore the playground.")
16
+
17
+ # Button to navigate to the playground
18
+ if st.button("Go to Playground"):
19
+ st.experimental_set_query_params(page="playground")