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