@@ -177,6 +177,8 @@ def display_sidebar(st, d: Parameters) -> Parameters:
177
177
# it's kindof like ember or angular if you are familiar with those
178
178
179
179
st_obj = st .sidebar
180
+ # used_widget_key = st.get_last_used_widget_key ( )
181
+
180
182
current_hospitalized_input = NumberInput (
181
183
st_obj ,
182
184
"Currently hospitalized COVID-19 patients" ,
@@ -353,6 +355,13 @@ def display_sidebar(st, d: Parameters) -> Parameters:
353
355
max_y_axis = max_y_axis_input ()
354
356
355
357
current_date = current_date_input ()
358
+ #Subscribe implementation
359
+ st_obj .subheader ("Subscribe" )
360
+ email = st_obj .text_input (label = "Enter Email" , value = "" , key = "na_lower_1" )
361
+ name = st_obj .text_input (label = "Enter Name" , value = "" , key = "na_upper_1" )
362
+ affiliation = st_obj .text_input (label = "Enter Affiliation" , value = "" , key = "na_upper_2" )
363
+ if st_obj .button (label = "Submit" , key = "ta_submit_1" ):
364
+ send_subscription_to_google_sheet (email , name , affiliation )
356
365
357
366
return Parameters (
358
367
current_hospitalized = current_hospitalized ,
@@ -371,6 +380,9 @@ def display_sidebar(st, d: Parameters) -> Parameters:
371
380
population = population ,
372
381
)
373
382
383
+ def send_subscription_to_google_sheet (email , name , affiliation ):
384
+ print ("send email:" + email + " name:" + name + " affiliation:" + affiliation + " to google sheet" )
385
+ #implement sending the data to googlesheet
374
386
375
387
def write_definitions (st ):
376
388
st .subheader ("Guidance on Selecting Inputs" )
0 commit comments