ageraustine commited on
Commit
565b8c5
Β·
verified Β·
1 Parent(s): 2d2a150

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +39 -42
app.py CHANGED
@@ -29,64 +29,53 @@ def search_member(search_term):
29
  return matches
30
 
31
  def create_about_tab():
32
- """Create the About tab content"""
33
  with gr.Column():
34
  gr.Markdown("""
35
- # β›ͺ ODA Nairobi Diocese Welfare
36
 
37
- **Organisation of Deacons and Acolytes** - Supporting our members with love and unity.
38
-
39
- ---
40
 
41
  ## 🎯 Mission
42
- To provide welfare support to deacons and acolytes in the Nairobi Diocese, fostering brotherhood and spiritual growth.
43
 
44
  ## πŸ‘οΈ Vision
45
- A beacon of hope and solidarity, ensuring no member walks alone in times of need.
46
-
47
- ---
48
-
49
- ## πŸ“œ Our Foundation
50
 
51
- > *"By this everyone will know that you are my disciples, if you love one another."*
52
- >
53
  > **John 13:35**
54
 
55
- ---
56
-
57
  ## 🀝 Services
58
-
59
- - Emergency financial assistance
60
- - Medical & bereavement support
61
- - Educational support
62
- - Spiritual counseling
63
  """)
64
 
65
  def create_search_tab():
66
- """Create the Search tab content"""
67
  with gr.Column():
68
- gr.Markdown("## πŸ” Member Search")
69
- gr.Markdown("### Find members in the ODA Nairobi Diocese Welfare Department list")
70
- gr.Markdown("---")
71
 
72
- with gr.Row():
73
- search_input = gr.Textbox(
74
- placeholder="Enter member name to search (e.g. Abraham, Joseph, etc.)...",
75
- label="πŸ”Ž Search Member Name",
76
- scale=4
77
- )
78
- search_btn = gr.Button("πŸ” Search", variant="primary", scale=1, size="lg")
 
 
79
 
80
  results_output = gr.Dataframe(
81
- label="Search Results",
82
- headers=["No.", "Name", "Amount"],
83
  datatype=["number", "str", "number"],
84
  interactive=False,
85
  wrap=True
86
  )
87
 
88
- status_output = gr.Markdown()
89
-
90
  def search_and_display(search_term):
91
  result = search_member(search_term)
92
  if isinstance(result, str):
@@ -102,20 +91,28 @@ def create_search_tab():
102
  search_input.submit(search_and_display, inputs=search_input, outputs=[results_output, status_output])
103
 
104
  def create_app():
105
- """Create the Gradio interface with tabs"""
106
- with gr.Blocks(title="ODA Nairobi Diocese Welfare", theme=gr.themes.Soft()) as demo:
107
- gr.Markdown("# β›ͺ ODA Nairobi Diocese Welfare")
108
- gr.Markdown("### *Organisation of Deacons and Acolytes - Serving God and Our Community*")
 
 
 
 
109
 
110
  with gr.Tabs():
111
- with gr.TabItem("πŸ“– About Us"):
112
  create_about_tab()
113
 
114
- with gr.TabItem("πŸ” Member Search"):
115
  create_search_tab()
116
 
117
  return demo
118
 
119
  if __name__ == "__main__":
120
  app = create_app()
121
- app.launch(share=False)
 
 
 
 
 
29
  return matches
30
 
31
  def create_about_tab():
32
+ """Create the About tab content - mobile optimized"""
33
  with gr.Column():
34
  gr.Markdown("""
35
+ # β›ͺ ODA Welfare
36
 
37
+ **Organisation of Deacons and Acolytes**
38
+ Nairobi Diocese
 
39
 
40
  ## 🎯 Mission
41
+ Welfare support for deacons and acolytes, fostering brotherhood and spiritual growth.
42
 
43
  ## πŸ‘οΈ Vision
44
+ No member walks alone in times of need.
 
 
 
 
45
 
46
+ ## πŸ“œ Foundation
47
+ > *"Love one another."*
48
  > **John 13:35**
49
 
 
 
50
  ## 🀝 Services
51
+ β€’ Financial assistance
52
+ β€’ Medical support
53
+ β€’ Educational support
54
+ β€’ Spiritual counseling
 
55
  """)
56
 
57
  def create_search_tab():
58
+ """Create the Search tab content - mobile optimized"""
59
  with gr.Column():
60
+ gr.Markdown("## πŸ” Search Members")
 
 
61
 
62
+ search_input = gr.Textbox(
63
+ placeholder="Enter name (e.g. Abraham)...",
64
+ label="Member Name",
65
+ container=False
66
+ )
67
+
68
+ search_btn = gr.Button("πŸ” Search", variant="primary", size="lg", scale=1)
69
+
70
+ status_output = gr.Markdown()
71
 
72
  results_output = gr.Dataframe(
73
+ headers=["#", "Name", "Amount"],
 
74
  datatype=["number", "str", "number"],
75
  interactive=False,
76
  wrap=True
77
  )
78
 
 
 
79
  def search_and_display(search_term):
80
  result = search_member(search_term)
81
  if isinstance(result, str):
 
91
  search_input.submit(search_and_display, inputs=search_input, outputs=[results_output, status_output])
92
 
93
  def create_app():
94
+ """Create mobile-optimized Gradio interface"""
95
+ with gr.Blocks(
96
+ title="ODA Welfare",
97
+ theme=gr.themes.Soft(),
98
+ css=".gradio-container {max-width: 100% !important; padding: 10px !important;}"
99
+ ) as demo:
100
+ gr.Markdown("# β›ͺ ODA Welfare")
101
+ gr.Markdown("*Nairobi Diocese*")
102
 
103
  with gr.Tabs():
104
+ with gr.TabItem("πŸ“– About"):
105
  create_about_tab()
106
 
107
+ with gr.TabItem("πŸ” Search"):
108
  create_search_tab()
109
 
110
  return demo
111
 
112
  if __name__ == "__main__":
113
  app = create_app()
114
+ app.launch(
115
+ share=False,
116
+ show_api=False,
117
+ favicon_path=None,
118
+ )