anastaa3 commited on
Commit
52ff79f
·
verified ·
1 Parent(s): f5488f8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py CHANGED
@@ -123,6 +123,8 @@ elif st.session_state["current_page"] == 2:
123
 
124
  elif st.session_state["current_page"] == 3:
125
 
 
 
126
  st.markdown("""<p style='font-size:18px;'>Page!</p>""", unsafe_allow_html=True)
127
  placeholder = st.empty()
128
 
@@ -156,6 +158,21 @@ elif st.session_state["current_page"] == 4:
156
  st.markdown("""<style> div[class*="stSelectbox"] > label > div[data-testid="stMarkdownContainer"] > p {font-size: 18px;}</style> <br><br>""", unsafe_allow_html=True)
157
 
158
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  placeholder = st.empty()
160
 
161
  col1, col2 = st.columns(2)
 
123
 
124
  elif st.session_state["current_page"] == 3:
125
 
126
+
127
+
128
  st.markdown("""<p style='font-size:18px;'>Page!</p>""", unsafe_allow_html=True)
129
  placeholder = st.empty()
130
 
 
158
  st.markdown("""<style> div[class*="stSelectbox"] > label > div[data-testid="stMarkdownContainer"] > p {font-size: 18px;}</style> <br><br>""", unsafe_allow_html=True)
159
 
160
 
161
+ if st.button("Submit"):
162
+ survey_data = {
163
+ "color": color,
164
+ "sleep": sleep,
165
+ "gender": gender,
166
+ "feedback": feedback
167
+ }
168
+
169
+ # upload the data to ipfs
170
+ ipfs_hash = upload_json_to_ipfs(survey_data)
171
+ if ipfs_hash:
172
+ st.success("Thank you for your submission!")
173
+ st.write(f"Data uploaded to IPFS with CID: {ipfs_hash}")
174
+ st.write(f"Your data can be viewed at https://gateway.pinata.cloud/ipfs/{ipfs_hash}")
175
+
176
  placeholder = st.empty()
177
 
178
  col1, col2 = st.columns(2)