prakharg24 commited on
Commit
42c4044
·
verified ·
1 Parent(s): 727853c

Update my_pages/information_loss.py

Browse files
Files changed (1) hide show
  1. my_pages/information_loss.py +8 -4
my_pages/information_loss.py CHANGED
@@ -1,6 +1,7 @@
1
  import pandas as pd
2
  import streamlit as st
3
  from utils import go_to
 
4
 
5
  ALL_FEATURES = [
6
  ("Liquid Assets", "Liquid Assets", None),
@@ -77,7 +78,7 @@ def render():
77
  st.session_state.show_message = (feature[2])
78
  st.rerun()
79
 
80
- # Centered message
81
  if "show_message" in st.session_state:
82
  del st.session_state.show_message
83
 
@@ -85,10 +86,13 @@ def render():
85
  # f"<div style='text-align:center; color:#c0392b; font-weight:600; margin:14px 0;'>{st.session_state.show_message}</div>",
86
  # unsafe_allow_html=True,
87
  # )
88
- with st.modal("Notice"):
89
- st.write("This is your message inside a modal pop-up.")
 
 
 
90
  if st.button("OK"):
91
- st.rerun()
92
 
93
  # st.markdown("---")
94
 
 
1
  import pandas as pd
2
  import streamlit as st
3
  from utils import go_to
4
+ from streamlit_modal import Modal
5
 
6
  ALL_FEATURES = [
7
  ("Liquid Assets", "Liquid Assets", None),
 
78
  st.session_state.show_message = (feature[2])
79
  st.rerun()
80
 
81
+ modal = Modal("My Modal")
82
  if "show_message" in st.session_state:
83
  del st.session_state.show_message
84
 
 
86
  # f"<div style='text-align:center; color:#c0392b; font-weight:600; margin:14px 0;'>{st.session_state.show_message}</div>",
87
  # unsafe_allow_html=True,
88
  # )
89
+ modal.open()
90
+
91
+ if modal.is_open():
92
+ with modal.container():
93
+ st.write("Here's the message!")
94
  if st.button("OK"):
95
+ modal.close()
96
 
97
  # st.markdown("---")
98