Skip to content

Commit 749898f

Browse files
Merge pull request #80 from ISE-GenAI-TechX25-Section-D/mayokun-working-project3
Added genai advice to Community Page
2 parents 699b575 + d8028cd commit 749898f

10 files changed

Lines changed: 52 additions & 4 deletions

community_page.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import streamlit as sl
2-
from modules import display_my_custom_component, display_post
3-
from data_fetcher import get_user_posts, get_user_profile
2+
from modules import display_my_custom_component, display_post, display_genai_advice
3+
from data_fetcher import get_user_posts, get_user_profile, get_genai_advice
44

55
def display_community(user_id):
66
user_profile = get_user_profile(user_id)
77
sl.title("❤️ Community Page")
8-
sl.subheader(f" {user_profile['full_name']}'s")
9-
display_post(user_id)
8+
left_col, right_col = sl.columns(2)
9+
with left_col:
10+
display_post(user_id)
11+
with right_col:
12+
display_genai_advice(user_id)
3.28 MB
Loading
3.3 MB
Loading
2.66 MB
Loading
2.25 MB
Loading
3.42 MB
Loading
2.92 MB
Loading
3.63 MB
Loading
3.29 MB
Loading

testpage.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import streamlit as sl
2+
from modules import display_my_custom_component, display_post, display_genai_advice, display_activity_summary, display_recent_workouts
3+
from data_fetcher import get_user_posts, get_genai_advice, get_user_profile, get_user_sensor_data, get_user_workouts
4+
from streamlit_option_menu import option_menu
5+
from activity_page import display
6+
from community_page import display_community
7+
8+
9+
10+
def display_app_page():
11+
"""Displays the home page of the app."""
12+
userId = 'user1'
13+
user_profile = get_user_profile(userId)
14+
user_name = user_profile['username']
15+
16+
17+
selected = option_menu(
18+
menu_title=None, # Appears at top of sidebar
19+
options=["Home", "Activities", "Community"],
20+
icons=["house", "bar-chart", "heart"], # Choose icons from https://icons.getbootstrap.com/
21+
default_index=0,
22+
menu_icon="cast",
23+
orientation="horizontal",
24+
)
25+
26+
if selected == "Home":
27+
sl.title("🏠 Home Page")
28+
sl.subheader(f"Welcome {user_profile['full_name']} to MyFitness!")
29+
30+
# Profile Card
31+
sl.image(user_profile['profile_image'], width=150, caption="Your Profile Picture")
32+
33+
sl.markdown(f"**Username:** {user_profile['username']}")
34+
sl.markdown(f"**Date of Birth:** {user_profile['date_of_birth']}")
35+
36+
# Friends section
37+
sl.markdown("### 👯 Your Friends")
38+
if user_profile['friends']:
39+
for friend_id in user_profile['friends']:
40+
sl.markdown(f"- {friend_id}")
41+
else:
42+
sl.info("You don't have any friends yet!")
43+
display_genai_advice(userId)
44+
45+

0 commit comments

Comments
 (0)