Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile/feat/analytics #418

Merged
merged 163 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
b7d867f
chore: Add functions for date and week predictions in aimodel.ts
KamogeloMoeketse Sep 2, 2024
dc92d2a
Refactor BarGraph and LineGraph components
KamogeloMoeketse Sep 4, 2024
67f6f23
Dashboard Update
KamogeloMoeketse Sep 4, 2024
5d0a9d7
Refactor BarGraph component and update Dashboard
KamogeloMoeketse Sep 5, 2024
93e6cc2
feat: Add new screens for loading and occubot
u21631532 Sep 6, 2024
6844ad7
feat: Add loading screen component
u21631532 Sep 6, 2024
5b07591
feat: Add loading screen component
u21631532 Sep 6, 2024
68a27cf
added occuBot image
u21631532 Sep 6, 2024
8781174
feat: Add OccuBot component to Home screen
u21631532 Sep 6, 2024
e89fb69
feat: Add OccuBot component to Dashboard screen
u21631532 Sep 6, 2024
0ef940d
adding images
u21631532 Sep 6, 2024
4b96bcf
adding videos
u21631532 Sep 6, 2024
9f3f7a8
feat: Update SplashScreen navigation
u21631532 Sep 6, 2024
e7b9d93
added OccuBot
u21631532 Sep 6, 2024
55bd6a5
router added for my stats page
u21631532 Sep 6, 2024
4909924
my stats page added
u21631532 Sep 6, 2024
10cb261
feat: Add stats screen to navigation
u21631532 Sep 6, 2024
206d6c2
feat: Add assetBundlePatterns to app.json
u21631532 Sep 6, 2024
46a9bd7
refactor: Adjust OccuBot animation timing and image size
u21631532 Sep 7, 2024
fa83fe4
refactor: Adjust OccuBot animation timing and image size
u21631532 Sep 7, 2024
0325870
refactor: Update navigation destination in SplashScreen
u21631532 Sep 7, 2024
ffe886f
...
KamogeloMoeketse Sep 8, 2024
56c6249
Merge branch 'mobile/feat/my_stats' into mobile/feat/analytics
KamogeloMoeketse Sep 8, 2024
3248c0b
feat: select date from option
KamogeloMoeketse Sep 8, 2024
6541fda
refactor: Update navigation destination in Dashboard
KamogeloMoeketse Sep 8, 2024
fcc8900
update date choosing logic
KamogeloMoeketse Sep 8, 2024
88e703e
feat: Add analytics functionality
KamogeloMoeketse Sep 8, 2024
49096cf
Add user stats utils functions
KamogeloMoeketse Sep 9, 2024
e5b0855
refactor: Update Stats component with additional analytics functionality
KamogeloMoeketse Sep 9, 2024
97e1774
feat: Update Stats with additional analytics functionality
KamogeloMoeketse Sep 9, 2024
74cbbd9
refactor: Update accent color options in Appearance screen
u21631532 Sep 9, 2024
0683108
refactor: Update accent color options in Appearance screen
u21631532 Sep 9, 2024
3127031
user stats graph
KamogeloMoeketse Sep 9, 2024
89d6d15
Merge branch 'mobile/feat/analytics' of https://github.com/COS301-SE-…
KamogeloMoeketse Sep 9, 2024
b28e883
feat:update graph
KamogeloMoeketse Sep 10, 2024
10604e6
Update analytics graph components
KamogeloMoeketse Sep 10, 2024
aad4465
Refactor AnalyticsGraph component and utils/analytics.ts
KamogeloMoeketse Sep 11, 2024
173deb3
Refactor ViewBookings component and utils/bookings.ts
u21631532 Sep 12, 2024
7e1f96b
Refactor AnalyticsGraph component and utils/analytics.ts
KamogeloMoeketse Sep 12, 2024
141d597
Merge branch 'mobile/feat/analytics' of https://github.com/COS301-SE-…
KamogeloMoeketse Sep 12, 2024
8a5429a
Refactor ViewBookings and AnalyticsGraph components and related utili…
u21631532 Sep 12, 2024
4f1fbd1
Refactor ViewBookings and AnalyticsGraph components and related utili…
u21631532 Sep 12, 2024
0722214
Refactor getUserBookings function in bookings.ts
u21631532 Sep 12, 2024
760cbc5
Configure arrival and departure times fetching and transforming data
KamogeloMoeketse Sep 13, 2024
a34e04a
Feat Stats component and add ComparativeLineGraph component
KamogeloMoeketse Sep 13, 2024
9e3ad65
Refactor AnalyticsGraph and ComparativeLineGraph components
KamogeloMoeketse Sep 13, 2024
8cd78fb
Refactor ComparativeLineGraph component and update color scheme
KamogeloMoeketse Sep 16, 2024
e80de24
Refactor Settings component and related files
u21631532 Sep 17, 2024
a78af53
Refactor Notifications component and related files
u21631532 Sep 17, 2024
cd5f2ec
Refactor navigation in SplashScreen component
u21631532 Sep 17, 2024
1bd209c
Refactor navigation in Viewbookings component
u21631532 Sep 17, 2024
3e2bd8c
Refactor package.json dependencies
u21631532 Sep 17, 2024
4d64b63
Merge branch 'mobile/feat/analytics' of https://github.com/COS301-SE-…
u21631532 Sep 17, 2024
8f91c48
Add Tooltip component for displaying help information
u21631532 Sep 18, 2024
1db5198
Refactor ViewBookings component and add Tooltip component
u21631532 Sep 18, 2024
d5a277c
Refactor ViewBookings component and add Tooltip component
u21631532 Sep 18, 2024
c0b38a3
Refactor LoadingScreen component and add Tooltip component
u21631532 Sep 18, 2024
eb2eb00
Refactor Notifications component and add Tooltip component
u21631532 Sep 18, 2024
59bb00d
Refactor Settings/Appearance component and add Tooltip component
u21631532 Sep 18, 2024
4f15052
Refactor font sizes and text styles in Settings/Info component
u21631532 Sep 18, 2024
3da7f5d
Refactor package dependencies and add Tooltip component
u21631532 Sep 18, 2024
1ee490b
Refactor package dependencies and add Tooltip component
u21631532 Sep 18, 2024
76f7837
Refactor NavBar component and add popup functionality
u21631532 Sep 18, 2024
f057ec3
Fixed appearance and UI for Profile/MyAccount
u21631532 Sep 18, 2024
208cde4
Refactor Security component and improve UI
u21631532 Sep 18, 2024
058877a
Refactor FAQPage component and add search functionality
u21631532 Sep 18, 2024
6b804de
Refactor code and add search functionality to Apperance component
u21631532 Sep 18, 2024
7af09c8
Changed UI for Settings
u21631532 Sep 18, 2024
e406928
Fixed apperance of info
u21631532 Sep 18, 2024
ec1a3d3
UI fixed for notifications in settings foleder
u21631532 Sep 18, 2024
4002cee
Refactor code and add search functionality to Settings UI
u21631532 Sep 19, 2024
5cea0b5
Refactor code and add search functionality to ViewBookings component
u21631532 Sep 19, 2024
6318e33
Refactor code and add GestureHandlerRootView to improve touch handling
u21631532 Sep 19, 2024
a5d7498
Refactor code and add markNotificationRead and removeNotification fun…
u21631532 Sep 19, 2024
8deb5c5
Refactor code and add functions for fetching historical and current b…
u21631532 Sep 19, 2024
a34aab8
Added markNotificationAsRead and deleteNotification functions
u21631532 Sep 19, 2024
8e33bbf
Add react-native-dotenv package for environment variables
u21631532 Sep 19, 2024
11f9033
Refactor code and improve touch handling in ViewBookings screen
u21631532 Sep 19, 2024
3dff3ce
Refactor Navbar positioning in Dashboard screen
u21631532 Sep 19, 2024
e6336a0
Refactor Navbar positioning in Notifications screen
u21631532 Sep 19, 2024
0cfd2d9
Refactor biometric sign-in icon in SignInForm
u21631532 Sep 19, 2024
8a28c70
Refactor color scheme and text styling in Dashboard component
KamogeloMoeketse Sep 20, 2024
083206d
Merge branch 'mobile/feat/analytics' of https://github.com/COS301-SE-…
KamogeloMoeketse Sep 20, 2024
65ddbc9
Refactor console.log statement in getUserBookings function
KamogeloMoeketse Sep 20, 2024
794976b
Refactor color scheme and text styling in AnalyticsGraph and Comparat…
KamogeloMoeketse Sep 20, 2024
78c779e
Refactor styling in Notifications, Tooltip, NavBarProvider, SplashScr…
KamogeloMoeketse Sep 22, 2024
6bb9b58
Refactor notification swipe actions and styling in Notifications comp…
u21631532 Sep 22, 2024
1ba17a7
Refactor markNotificationRead function to remove unused code
u21631532 Sep 22, 2024
849d445
bookins rerouting
u21631532 Sep 22, 2024
f8e3f56
Refactor appearance settings styling and accent color selection
u21631532 Sep 22, 2024
fe35788
Refactor accent color toggle button in ViewBookings component
u21631532 Sep 22, 2024
0a40a96
integrate top bookings
KamogeloMoeketse Sep 22, 2024
24cff80
Merge branch 'mobile/feat/analytics' of https://github.com/COS301-SE-…
KamogeloMoeketse Sep 22, 2024
3a03201
Refactor room card styling and layout in ViewBookings component
KamogeloMoeketse Sep 22, 2024
abb9be3
no booking on dashboard handling
KamogeloMoeketse Sep 22, 2024
29cface
Refactor booking details screen and add booking active check
u21631532 Sep 22, 2024
b998333
Refactor room card click handling in ViewBookings component
u21631532 Sep 22, 2024
949e0e4
Refactor button background color in Settings component
u21631532 Sep 22, 2024
9fcf559
Refactor PieGraph component to accept data prop and display a pie cha…
KamogeloMoeketse Sep 22, 2024
d9f0b90
Merge branch 'mobile/feat/analytics' of https://github.com/COS301-SE-…
KamogeloMoeketse Sep 22, 2024
ef679f4
Add downloadable user performnce summary
KamogeloMoeketse Sep 23, 2024
4b9942d
Refactor package dependencies and add Centrifuge library
KamogeloMoeketse Sep 23, 2024
65b3b71
Refactor console logs and comments in Dashboard and apiservices files
KamogeloMoeketse Sep 23, 2024
c507223
feat: added rtc for counter, enter and exit
KamogeloMoeketse Sep 24, 2024
9b2eede
Refactor SignIn and SplashScreen components
u21631532 Sep 24, 2024
c3f9208
Merge branch 'mobile/feat/analytics' of https://github.com/COS301-SE-…
u21631532 Sep 24, 2024
8c446b1
Refactor console logs and comments in Dashboard and apiservices files
KamogeloMoeketse Sep 24, 2024
04d33c0
Merge branch 'mobile/feat/analytics' of https://github.com/COS301-SE-…
KamogeloMoeketse Sep 24, 2024
9dfbfd4
Refactor navigation link in Dashboard component
KamogeloMoeketse Sep 25, 2024
3a122f8
Refactor fetchUserPeakHours to return today's top hour
KamogeloMoeketse Sep 25, 2024
9139f27
Refactor fetchUserPeakHours to include all peak hours
KamogeloMoeketse Sep 25, 2024
8fae1d9
fix rtc to fecth current counter
KamogeloMoeketse Sep 25, 2024
172a878
logic for rtc token refresh daily
KamogeloMoeketse Sep 26, 2024
ceff3b9
linting warning
KamogeloMoeketse Sep 26, 2024
bdedad9
Refactor notifications.ts to remove unused function markNotificationRead
u21631532 Sep 26, 2024
33ecd1b
android compatability fixes
KamogeloMoeketse Sep 26, 2024
6601704
account for limit exceeded error when fetching analytics
KamogeloMoeketse Sep 27, 2024
c0aa949
load images for the view-rooms page
KamogeloMoeketse Sep 27, 2024
bbd1820
show relevant images on office details and booking details
KamogeloMoeketse Sep 27, 2024
b287590
Refactor buildOutputCleanup/cache.properties and update gradle versio…
u21631532 Sep 27, 2024
22d9643
Merge branch 'mobile/feat/analytics' of https://github.com/COS301-SE-…
u21631532 Sep 27, 2024
e517e0c
Add navigation to loading screen on flip detection in Security component
u21631532 Sep 27, 2024
c049f2d
Refactor utils.tsx and package.json
u21631532 Sep 27, 2024
1ab9fe9
Refactor code to add on-site functionality
KamogeloMoeketse Sep 27, 2024
5a7c23a
Merge branch 'mobile/feat/analytics' of https://github.com/COS301-SE-…
KamogeloMoeketse Sep 27, 2024
3c1ab06
Refactor code to remove TextGenerateEffect component and update packa…
KamogeloMoeketse Sep 27, 2024
1b228d0
Refactor code to handle errors in bookings.ts and rtc.ts
KamogeloMoeketse Sep 27, 2024
367110a
Refactor code to add Recommendations component
u21631532 Sep 29, 2024
8341aec
Add Recommendations screen to navigation stack
u21631532 Sep 29, 2024
20426e4
Add Recommendations screen component
u21631532 Sep 29, 2024
d1c14a5
Add Recommendations screen component and integrate it into the Dashbo…
u21631532 Sep 29, 2024
8d76b8e
Update tsconfig.json to include TypeScript files and remove unnecessa…
u21631532 Sep 29, 2024
8e0676a
Refactor Recommendations component and API calls
u21631532 Sep 29, 2024
ba78d8c
Refactor code to add HourlyPrediction interface and update Dashboard.tsx
KamogeloMoeketse Sep 29, 2024
f7759e8
Merge branch 'mobile/feat/analytics' of https://github.com/COS301-SE-…
KamogeloMoeketse Sep 29, 2024
dbfc523
Refactor Recommendations component and API calls
KamogeloMoeketse Sep 29, 2024
0964357
Refactor files
u21631532 Sep 29, 2024
072829a
Merge branch 'mobile/feat/analytics' of https://github.com/COS301-SE-…
u21631532 Sep 29, 2024
9c92a1f
Refactor navigation in Dashboard and Stats screens
KamogeloMoeketse Sep 29, 2024
a33af00
Refactor console logs in ViewBookings, Dashboard, ForgotPassword, Spl…
KamogeloMoeketse Sep 30, 2024
7ddeb8e
Merge branch 'mobile/feat/analytics' of https://github.com/COS301-SE-…
KamogeloMoeketse Sep 30, 2024
f3cd5f2
More error logs to identify problem in build
KamogeloMoeketse Sep 30, 2024
1afe0ec
Refactor modal height in Dashboard screen
u21631532 Sep 30, 2024
eb3f917
Refactor OccupancyModel component
u21631532 Sep 30, 2024
0051e43
Refactor error logging in fetchLatestCount function
KamogeloMoeketse Sep 30, 2024
dab5a15
Merge branch 'mobile/feat/analytics' of https://github.com/COS301-SE-…
KamogeloMoeketse Sep 30, 2024
03e397f
Refactor speakRecommendation function in Recommendations.tsx
u21631532 Sep 30, 2024
f556038
Merge branch 'mobile/feat/analytics' of https://github.com/COS301-SE-…
u21631532 Sep 30, 2024
51f82f4
Refactor text-to-speech settings in Recommendations component
KamogeloMoeketse Sep 30, 2024
87ea8d8
Merge branch 'mobile/feat/analytics' of https://github.com/COS301-SE-…
KamogeloMoeketse Sep 30, 2024
a466af3
Refactor fetchUserBookings function in bookings utils
u21631532 Sep 30, 2024
cafbf73
Refactor date picker in Dashboard component
KamogeloMoeketse Sep 30, 2024
0b2b4ca
Merge branch 'mobile/feat/analytics' of https://github.com/COS301-SE-…
KamogeloMoeketse Sep 30, 2024
585b46c
100% working tests
u21631532 Sep 30, 2024
2ec0100
Merge branch 'mobile/feat/analytics' of https://github.com/COS301-SE-…
u21631532 Sep 30, 2024
21be248
Refactor package dependencies to include @react-native-community/date…
KamogeloMoeketse Sep 30, 2024
2e37eec
Merge branch 'mobile/feat/analytics' of https://github.com/COS301-SE-…
KamogeloMoeketse Sep 30, 2024
9a1d1f9
Refactor login function in auth services
u21631532 Sep 30, 2024
0d8ff16
Merge branch 'mobile/feat/analytics' of https://github.com/COS301-SE-…
u21631532 Sep 30, 2024
2f9d3ac
Refactor API services and authentication
KamogeloMoeketse Sep 30, 2024
dfdd37c
predict hourly by day
KamogeloMoeketse Oct 1, 2024
65e0a83
Merge branch 'mobile/feat/analytics' of https://github.com/COS301-SE-…
KamogeloMoeketse Oct 1, 2024
4c72da9
Merge branch 'develop' into mobile/feat/analytics
KamogeloMoeketse Oct 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Thu Jul 04 00:58:00 SAST 2024
gradle.version=8.1.1
#Thu Sep 26 13:00:57 CAT 2024
gradle.version=8.9
Binary file not shown.
11 changes: 10 additions & 1 deletion frontend/occupi-mobile4/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"icon": "./assets/images/icon.png",
"scheme": "myapp",
"userInterfaceStyle": "automatic",
"assetBundlePatterns": [
"**/*"
],
"splash": {
"image": "./assets/images/splash.png",
"resizeMode": "contain",
Expand Down Expand Up @@ -46,7 +49,13 @@
"expo-secure-store",
"expo-location",
"expo-notifications",
"expo-sensors"
"expo-sensors",
[
"expo-av",
{
"microphonePermission": "Allow $(PRODUCT_NAME) to access your microphone."
}
]
],
"experiments": {
"typedRoutes": true
Expand Down
80 changes: 43 additions & 37 deletions frontend/occupi-mobile4/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import { GluestackUIProvider } from "@gluestack-ui/themed";
import { ThemeProvider } from '@/components/ThemeContext';
import { NavBarProvider } from '@/components/NavBarProvider';
import { config } from "@gluestack-ui/config"; // Optional if you want to use default theme
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { config } from "@gluestack-ui/config";

// Prevent the splash screen from auto-hiding before asset loading is complete.
SplashScreen.preventAutoHideAsync();

export default function RootLayout() {
Expand All @@ -29,43 +29,49 @@
return null;
}

const theme = colorScheme === 'dark' ? DarkTheme : DefaultTheme;

Check warning on line 32 in frontend/occupi-mobile4/app/_layout.tsx

View workflow job for this annotation

GitHub Actions / 🌸 Lint

'theme' is assigned a value but never used

return (
<GluestackUIProvider config={config} theme={theme}>
<ThemeProvider>
<NavBarProvider>
<Stack>
<Stack.Screen name="index" options={{ headerShown: false }} />
<Stack.Screen name="login" options={{ headerShown: false }} />
<Stack.Screen name="signup" options={{ headerShown: false }} />
<Stack.Screen name="forgot-password" options={{ headerShown: false }} />
<Stack.Screen name="verify-otp" options={{ headerShown: false }} />
<Stack.Screen name="create-password" options={{ headerShown: false }} />
<Stack.Screen name="home" options={{ headerShown: false }} />
<Stack.Screen name="bookings" options={{ headerShown: false }} />
<Stack.Screen name="viewbookings" options={{ headerShown: false }} />
<Stack.Screen name="notifications" options={{ headerShown: false }} />
<Stack.Screen name="onboarding1" options={{ headerShown: false }} />
<Stack.Screen name="onboarding2" options={{ headerShown: false }} />
<Stack.Screen name="onboarding3" options={{ headerShown: false }} />
<Stack.Screen name="profile" options={{ headerShown: false }} />
<Stack.Screen name="welcome" options={{ headerShown: false }} />
<Stack.Screen name="settings" options={{ headerShown: false }} />
<Stack.Screen name="office-details" options={{ headerShown: false }} />
<Stack.Screen name="booking-details" options={{ headerShown: false }} />
<Stack.Screen name="viewbookingdetails" options={{ headerShown: false }} />
<Stack.Screen name="faqpage" options={{ headerShown: false }} />
<Stack.Screen name="set-details" options={{ headerShown: false }} />
<Stack.Screen name="set-notifications" options={{ headerShown: false }} />
<Stack.Screen name="set-security" options={{ headerShown: false }} />
<Stack.Screen name="set-appearance" options={{ headerShown: false }} />
<Stack.Screen name="notiftester" options={{ headerShown: false }} />
<Stack.Screen name="changepassword" options={{ headerShown: false }} />
<Stack.Screen name="info" options={{ headerShown: false }} />
</Stack>
</NavBarProvider>
</ThemeProvider>
</GluestackUIProvider>
<GestureHandlerRootView style={{ flex: 1 }}>
<GluestackUIProvider config={config}>
<ThemeProvider>
<NavBarProvider>
<Stack>
<Stack.Screen name="index" options={{ headerShown: false }} />
<Stack.Screen name="login" options={{ headerShown: false }} />
<Stack.Screen name="signup" options={{ headerShown: false }} />
<Stack.Screen name="forgot-password" options={{ headerShown: false }} />
<Stack.Screen name="verify-otp" options={{ headerShown: false }} />
<Stack.Screen name="create-password" options={{ headerShown: false }} />
<Stack.Screen name="home" options={{ headerShown: false }} />
<Stack.Screen name="bookings" options={{ headerShown: false }} />
<Stack.Screen name="viewbookings" options={{ headerShown: false }} />
<Stack.Screen name="notifications" options={{ headerShown: false }} />
<Stack.Screen name="onboarding1" options={{ headerShown: false }} />
<Stack.Screen name="onboarding2" options={{ headerShown: false }} />
<Stack.Screen name="onboarding3" options={{ headerShown: false }} />
<Stack.Screen name="profile" options={{ headerShown: false }} />
<Stack.Screen name="welcome" options={{ headerShown: false }} />
<Stack.Screen name="settings" options={{ headerShown: false }} />
<Stack.Screen name="office-details" options={{ headerShown: false }} />
<Stack.Screen name="booking-details" options={{ headerShown: false }} />
<Stack.Screen name="viewbookingdetails" options={{ headerShown: false }} />
<Stack.Screen name="faqpage" options={{ headerShown: false }} />
<Stack.Screen name="set-details" options={{ headerShown: false }} />
<Stack.Screen name="set-notifications" options={{ headerShown: false }} />
<Stack.Screen name="set-security" options={{ headerShown: false }} />
<Stack.Screen name="set-appearance" options={{ headerShown: false }} />
<Stack.Screen name="notiftester" options={{ headerShown: false }} />
<Stack.Screen name="changepassword" options={{ headerShown: false }} />
<Stack.Screen name="info" options={{ headerShown: false }} />
<Stack.Screen name="loadingscreen" options={{ headerShown: false }} />
<Stack.Screen name="occubot" options={{ headerShown: false }} />
<Stack.Screen name="stats" options={{ headerShown: false }} />
<Stack.Screen name="recommendations" options={{ headerShown: false }} />
</Stack>
</NavBarProvider>
</ThemeProvider>
</GluestackUIProvider>
</GestureHandlerRootView>
);
}
7 changes: 7 additions & 0 deletions frontend/occupi-mobile4/app/loadingscreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import LoadingScreen from "../screens/Dashboard/LoadingScreen";

export default function Home() {
return (
<LoadingScreen />
);
}
7 changes: 7 additions & 0 deletions frontend/occupi-mobile4/app/occubot.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import OccuBot from "../screens/Dashboard/OccuBot";

export default function Home() {
return (
<OccuBot />
);
}
14 changes: 14 additions & 0 deletions frontend/occupi-mobile4/app/recommendations.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';
import Recommendations from "../screens/Dashboard/Recommendations";

export default function Home() {
const handleClose = () => {
// Add your close logic here

console.log('Recommendations closed');
};

return (
<Recommendations onClose={handleClose} />
);
}
7 changes: 7 additions & 0 deletions frontend/occupi-mobile4/app/stats.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Stats from "../screens/Dashboard/Stats";

export default function Home() {
return (
<Stats />
);
}
76 changes: 76 additions & 0 deletions frontend/occupi-mobile4/components/AnalyticsGraph.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import React, { useEffect, useState } from 'react';
import { widthPercentageToDP as wp } from 'react-native-responsive-screen';
import {
View, Text
} from '@gluestack-ui/themed';
import * as SecureStore from 'expo-secure-store';
import { LineChart } from "react-native-gifted-charts";
import { useColorScheme } from 'react-native';
import { useTheme } from './ThemeContext';


const AnalyticsGraph = ({data,title,x_axis}) => {
const colorscheme = useColorScheme();
const { theme } = useTheme();
const currentTheme = theme === "system" ? colorscheme : theme;
// console.log(data);
const labels = currentTheme === 'dark' ? "lightgray" : "#242424";
const [accentColour, setAccentColour] = useState<string>('greenyellow');
useEffect(() => {
const getAccentColour = async () => {
let accentcolour = await SecureStore.getItemAsync('accentColour');
setAccentColour(accentcolour);
};
getAccentColour();
}, []);

return (
<View my="$2" w="$full" flexDirection='column' alignItems='center' justifyContent='space-around'>
<Text underline color={currentTheme === 'dark' ? "$white" : "$black"}>{title}</Text>
<LineChart
isAnimated
width={wp('85%')}
thickness={3}
color={accentColour}
maxValue={10}
noOfSections={10}
hideRules
animateOnDataChange
animationDuration={1000}
onDataChangeAnimationDuration={300}
areaChart
focusEnabled
showDataPointOnFocus
textColor1={currentTheme === 'dark' ? "white" : "black"}
focusedDataPointColor={'white'}
showStripOnFocus
showTextOnFocus
endSpacing={20}
yAxisTextStyle={{color: labels}}
xAxisLabelTextStyle={{color: labels, fontSize: 8.5}}
data={data}
// hideDataPoints
curved
startFillColor={accentColour}
endFillColor={accentColour}
startOpacity={0.5}
endOpacity={0.1}
spacing={data.length > 30 ? 30 : data.length*2}
// rotateLabel
backgroundColor="transparent"
// showVerticalLines
// verticalLinesColor="rgba(14,164,164,0.5)"
// rulesColor="gray"
// rulesType="dashed"
xAxisColor="transparent"
yAxisColor="transparent"
initialSpacing={2}
// yAxisColor={currentTheme === 'dark' ? "lightgray" : "darkgrey"}
// xAxisColor={currentTheme === 'dark' ? "lightgray" : "darkgrey"}
/>
<Text color={currentTheme === 'dark' ? "$white" : "$black"}>{x_axis}</Text>
</View>
)
}

export default AnalyticsGraph;
33 changes: 17 additions & 16 deletions frontend/occupi-mobile4/components/BarGraph.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import React, { useEffect, useState } from 'react'
import { widthPercentageToDP as wp, heightPercentageToDP as hp } from 'react-native-responsive-screen';
import React, { useEffect, useState } from 'react';
import { widthPercentageToDP as wp } from 'react-native-responsive-screen';
import {
View, Text
} from '@gluestack-ui/themed';
import * as SecureStore from 'expo-secure-store';
import { BarChart } from "react-native-gifted-charts"
View
} from '@gluestack-ui/themed';
import * as SecureStore from 'expo-secure-store';
import { BarChart } from "react-native-gifted-charts";
import { useColorScheme } from 'react-native';
import { useTheme } from './ThemeContext';
import { convertValues } from '@/utils/occupancy';
import { convertValues, convertValuesHour } from '@/utils/occupancy';


const BarGraph = (data) => {
const BarGraph = ({data,tab}) => {
console.log('tab',data)
const colorscheme = useColorScheme();
const { theme } = useTheme();
const currentTheme = theme === "system" ? colorscheme : theme;
Expand All @@ -27,14 +28,13 @@ const BarGraph = (data) => {
}, []);
return (
<View
style={{ width: wp('100%'), height: hp('35%'), flexDirection: 'column' }}
style={{ width: wp('100%'), flexDirection: 'column' }}
// style={{
// // marginVertical: 100,
// paddingVertical: 20,
// backgroundColor: '#414141',
// }}
>
<Text color={currentTheme === "dark" ? 'white' : 'black'} fontWeight="$medium" underline mb="$4" alignSelf='center'>Predicted Occupancy by Number</Text>
<BarChart
isAnimated
width={wp('80%')}
Expand All @@ -48,21 +48,22 @@ const BarGraph = (data) => {
endSpacing={0}
yAxisTextStyle={{color: labels}}
xAxisLabelTextStyle={{color: labels}}
data={convertValues(data.data)}
data={tab === 3 ? convertValues(data) : convertValuesHour(data)}
showGradient
hideRules
frontColor={currentTheme === 'dark' ? "lightgray" : "darkgrey"}
gradientColor={accentColour}
// barBorderTopLeftRadius={5}
// barBorderTopRightRadius={5}
spacing={20}
backgroundColor={currentTheme === 'dark' ? "#414141" : "white"}
spacing={12}
backgroundColor={currentTheme === 'dark' ? "transparent" : "white"}
// showVerticalLines
// verticalLinesColor="rgba(14,164,164,0.5)"
// rulesColor="gray"
rulesType="dashed"
// rulesType="dashed"
xAxisColor="transparent"
yAxisColor="transparent"
initialSpacing={16}
yAxisColor={currentTheme === 'dark' ? "lightgray" : "darkgrey"}
xAxisColor={currentTheme === 'dark' ? "lightgray" : "darkgrey"}
/>
</View>
)
Expand Down
Loading