Shreyas094 commited on
Commit
f6caa76
·
verified ·
1 Parent(s): 467bf82

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -3
app.py CHANGED
@@ -690,6 +690,10 @@ demo = gr.ChatInterface(
690
  )
691
  )
692
 
 
 
 
 
693
  # Add file upload functionality
694
  # Add file upload functionality
695
  with demo:
@@ -703,10 +707,25 @@ with demo:
703
  update_output = gr.Textbox(label="Update Status")
704
  delete_button = gr.Button("Delete Selected Documents")
705
 
 
706
  with gr.Column(scale=3):
707
- with gr.Box():
708
- dropdown.render()
709
- toggle_dark = gr.Button(value="Toggle Dark").style(full_width=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
710
 
711
  # Update both the output text and the document selector
712
  update_button.click(
 
690
  )
691
  )
692
 
693
+ def on_dropdown_change(dropdown_value):
694
+ # Define what should happen when the dropdown value changes
695
+ pass
696
+
697
  # Add file upload functionality
698
  # Add file upload functionality
699
  with demo:
 
707
  update_output = gr.Textbox(label="Update Status")
708
  delete_button = gr.Button("Delete Selected Documents")
709
 
710
+ with gr.Blocks() as demo:
711
  with gr.Column(scale=3):
712
+ with gr.Box():
713
+ dropdown = gr.Dropdown(choices=["Option 1", "Option 2", "Option 3"], label="Select an Option")
714
+ toggle_dark = gr.Button(value="Toggle Dark").style(full_width=True)
715
+
716
+ # Handle dropdown changes
717
+ dropdown.change(on_dropdown_change, dropdown, None, _js="() => {}")
718
+
719
+ # Handle the Toggle Dark button click
720
+ toggle_dark.click(
721
+ None,
722
+ _js="""
723
+ () => {
724
+ document.body.classList.toggle('dark');
725
+ document.querySelector('gradio-app').style.backgroundColor = 'var(--color-background-primary)';
726
+ }
727
+ """,
728
+ )
729
 
730
  # Update both the output text and the document selector
731
  update_button.click(