Skip to content

Commit cbcf8e6

Browse files
committed
Made UI changes and ensured functionality of capacity reminders
1 parent 4ea3909 commit cbcf8e6

9 files changed

Lines changed: 217 additions & 108 deletions

File tree

app/src/main/graphql/CapacityReminders.graphql

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ mutation CreateCapacityReminder(
1010
id
1111
capacityThreshold
1212
daysOfWeek
13-
fcmToken
1413
gyms
1514
isActive
1615
}
@@ -28,7 +27,6 @@ mutation EditCapacityReminder(
2827
id
2928
capacityThreshold
3029
daysOfWeek
31-
fcmToken
3230
gyms
3331
isActive
3432
}
@@ -39,7 +37,6 @@ mutation DeleteCapacityReminder($reminderId: Int!) {
3937
id
4038
capacityThreshold
4139
daysOfWeek
42-
fcmToken
4340
gyms
4441
isActive
4542
}

app/src/main/graphql/schema.graphqls

Lines changed: 56 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ type Query {
5555
Get all friends for a user.
5656
"""
5757
getUserFriends(userId: Int!): [User]
58+
59+
"""
60+
Get a specific capacity reminder by its ID.
61+
"""
62+
getCapacityReminderById(id: Int!): CapacityReminder
63+
64+
"""
65+
Get all capacity reminders.
66+
"""
67+
getAllCapacityReminders: [CapacityReminder]
5868
}
5969

6070
type Gym {
@@ -438,6 +448,52 @@ type HourlyAverageCapacity {
438448
history: [Float]!
439449
}
440450

451+
type CapacityReminder {
452+
id: ID!
453+
454+
gyms: [CapacityReminderGym]!
455+
456+
capacityThreshold: Int!
457+
458+
daysOfWeek: [DayOfWeekEnum]!
459+
460+
isActive: Boolean
461+
}
462+
463+
"""
464+
An enumeration.
465+
"""
466+
enum CapacityReminderGym {
467+
TEAGLEUP
468+
469+
TEAGLEDOWN
470+
471+
HELENNEWMAN
472+
473+
TONIMORRISON
474+
475+
NOYES
476+
}
477+
478+
"""
479+
An enumeration.
480+
"""
481+
enum DayOfWeekEnum {
482+
MONDAY
483+
484+
TUESDAY
485+
486+
WEDNESDAY
487+
488+
THURSDAY
489+
490+
FRIDAY
491+
492+
SATURDAY
493+
494+
SUNDAY
495+
}
496+
441497
type Mutation {
442498
"""
443499
Creates a new giveaway.
@@ -558,54 +614,6 @@ type CreateReport {
558614
report: Report
559615
}
560616

561-
type CapacityReminder {
562-
id: ID!
563-
564-
fcmToken: String!
565-
566-
gyms: [CapacityReminderGym]!
567-
568-
capacityThreshold: Int!
569-
570-
daysOfWeek: [DayOfWeekEnum]!
571-
572-
isActive: Boolean
573-
}
574-
575-
"""
576-
An enumeration.
577-
"""
578-
enum CapacityReminderGym {
579-
TEAGLEUP
580-
581-
TEAGLEDOWN
582-
583-
HELENNEWMAN
584-
585-
TONIMORRISON
586-
587-
NOYES
588-
}
589-
590-
"""
591-
An enumeration.
592-
"""
593-
enum DayOfWeekEnum {
594-
MONDAY
595-
596-
TUESDAY
597-
598-
WEDNESDAY
599-
600-
THURSDAY
601-
602-
FRIDAY
603-
604-
SATURDAY
605-
606-
SUNDAY
607-
}
608-
609617
type RemoveFriend {
610618
success: Boolean
611619
}

app/src/main/java/com/cornellappdev/uplift/ui/MainNavigationWrapper.kt

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -216,19 +216,20 @@ fun MainNavigationWrapper(
216216
composable<UpliftRootRoute.ProfileCreation> {
217217
ProfileCreationScreen()
218218
}
219-
composable<UpliftRootRoute.CapacityReminders>{
219+
composable<UpliftRootRoute.CapacityReminders> {
220220
CapacityReminderScreen()
221-
composable<UpliftRootRoute.Profile> {
222-
ProfileScreen()
223-
}
224-
composable<UpliftRootRoute.Reminders> {
225-
MainReminderScreen()
226-
}
227-
composable<UpliftRootRoute.Settings> {
228-
SettingsScreen()
221+
composable<UpliftRootRoute.Profile> {
222+
ProfileScreen()
223+
}
224+
composable<UpliftRootRoute.Reminders> {
225+
MainReminderScreen()
226+
}
227+
composable<UpliftRootRoute.Settings> {
228+
SettingsScreen()
229+
}
230+
composable<UpliftRootRoute.Sports> {}
231+
composable<UpliftRootRoute.Favorites> {}
229232
}
230-
composable<UpliftRootRoute.Sports> {}
231-
composable<UpliftRootRoute.Favorites> {}
232233
}
233234
}
234235
}

app/src/main/java/com/cornellappdev/uplift/ui/components/general/UpliftButton.kt

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package com.cornellappdev.uplift.ui.components.general
22

33
import androidx.compose.animation.core.animateFloatAsState
4+
import androidx.compose.foundation.layout.Arrangement
5+
import androidx.compose.foundation.layout.Row
6+
import androidx.compose.foundation.layout.Spacer
7+
import androidx.compose.foundation.layout.defaultMinSize
48
import androidx.compose.foundation.layout.height
59
import androidx.compose.foundation.layout.width
610
import androidx.compose.foundation.layout.wrapContentSize
@@ -11,6 +15,7 @@ import androidx.compose.material3.Surface
1115
import androidx.compose.material3.Text
1216
import androidx.compose.runtime.Composable
1317
import androidx.compose.runtime.getValue
18+
import androidx.compose.ui.Alignment
1419
import androidx.compose.ui.Modifier
1520
import androidx.compose.ui.draw.alpha
1621
import androidx.compose.ui.graphics.Color
@@ -46,7 +51,9 @@ fun UpliftButton(
4651
disabledContainerColor: Color = GRAY02,
4752
contentColor: Color = PRIMARY_BLACK,
4853
disabledContentColor: Color = PRIMARY_BLACK,
49-
elevation: Dp = 4.dp
54+
elevation: Dp = 4.dp,
55+
leadingIcon: (@Composable () -> Unit)? = null,
56+
modifier: Modifier = Modifier
5057
) {
5158
val enabledAlpha by animateFloatAsState(
5259
targetValue = if (enabled) 1f else 0.5f,
@@ -60,8 +67,8 @@ fun UpliftButton(
6067
disabledContentColor = disabledContentColor
6168
),
6269
shape = RoundedCornerShape(38.dp),
63-
modifier = Modifier
64-
.width(width)
70+
modifier = modifier
71+
.defaultMinSize(minWidth = width)
6572
.height(height)
6673
.alpha(enabledAlpha),
6774
elevation = ButtonDefaults.buttonElevation(
@@ -70,15 +77,23 @@ fun UpliftButton(
7077
onClick = { onClick() },
7178
enabled = enabled,
7279
) {
73-
Text(
74-
text = text,
75-
color = PRIMARY_BLACK,
76-
fontFamily = montserratFamily,
77-
fontSize = fontSize.sp,
78-
fontWeight = FontWeight.Bold,
79-
textAlign = TextAlign.Center,
80-
modifier = Modifier.wrapContentSize()
81-
)
80+
Row(
81+
verticalAlignment = Alignment.CenterVertically,
82+
horizontalArrangement = Arrangement.Center
83+
) {
84+
leadingIcon?.let {
85+
it()
86+
}
87+
Text(
88+
text = text,
89+
color = contentColor,
90+
fontFamily = montserratFamily,
91+
fontSize = fontSize.sp,
92+
fontWeight = FontWeight.Bold,
93+
textAlign = TextAlign.Center,
94+
modifier = modifier.wrapContentSize()
95+
)
96+
}
8297
}
8398
}
8499

0 commit comments

Comments
 (0)