Update app.py
Browse files
app.py
CHANGED
@@ -87,8 +87,26 @@ def init_leaderboard(dataframe):
|
|
87 |
bool_checkboxgroup_label="Hide models",
|
88 |
interactive=False,
|
89 |
)
|
90 |
-
|
91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
demo = gr.Blocks(css=custom_css)
|
93 |
with demo:
|
94 |
gr.HTML(TITLE)
|
|
|
87 |
bool_checkboxgroup_label="Hide models",
|
88 |
interactive=False,
|
89 |
)
|
90 |
+
def display_user_data(user_id):
|
91 |
+
user_data = data.load_data()
|
92 |
+
if user_id in user_data:
|
93 |
+
return f"Points: {user_data[user_id]['points']}\nReferrals: {len(user_data[user_id]['referrals'])}"
|
94 |
+
else:
|
95 |
+
return "User not found"
|
96 |
+
start_button = gr.Button("Start", elem_id="start_button")
|
97 |
+
claim_image = gr.Image(value="path/to/your/claim_image.png", interactive=True, elem_id="claim_image")
|
98 |
+
start_button.click(fn=display_user_data, inputs=[gr.inputs.Textbox(label="Enter your Telegram User ID")], outputs=user_data_output)
|
99 |
+
claim_image.click(fn=lambda: "You have claimed your reward!", outputs=gr.outputs.Textbox(label="Message"))
|
100 |
+
iface = gr.Interface(
|
101 |
+
fn=None, # You can add functions for tasks later
|
102 |
+
inputs=[
|
103 |
+
join_channel_section,
|
104 |
+
invite_friends_section,
|
105 |
+
],
|
106 |
+
outputs=[user_data_output],
|
107 |
+
title="Mukera",
|
108 |
+
)
|
109 |
+
iface.launch(share=True, inline=True)
|
110 |
demo = gr.Blocks(css=custom_css)
|
111 |
with demo:
|
112 |
gr.HTML(TITLE)
|