Skip to content

Commit 77c61c6

Browse files
committed
updated ASP calender colors
1 parent 4ed8a99 commit 77c61c6

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

frontend/src/components/common/MealRequestCalendarView.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,16 @@ export const MealRequestCalendarView = ({
234234
const getEventColor = (mealRequest: MealRequest) => {
235235
if (pageContext === "asp") {
236236
if (mealRequest.donationInfo) {
237+
if (mealRequest.status === MealStatus.FULFILLED) {
238+
// return "#2e8438";
239+
return "#C6F6D5";
240+
}
241+
if (mealRequest.status === MealStatus.UPCOMING) {
242+
return "#D5C4EC"
243+
}
244+
237245
return mealRequest.id === selectedMealRequests[0]
238-
? "#2e8438"
246+
? "#C6F6D5"
239247
: "#3BA948";
240248
}
241249

@@ -266,7 +274,7 @@ export const MealRequestCalendarView = ({
266274
mealRequest,
267275
},
268276
backgroundColor: getEventColor(mealRequest),
269-
textColor: mealRequest.donationInfo ? "white" : "black",
277+
textColor: "black",
270278
display: "block",
271279
};
272280
},

frontend/src/pages/ASPCalendar.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import EditMealRequestForm from "./EditMealRequestForm";
4242
import { MealRequestCalendarView } from "../components/common/MealRequestCalendarView";
4343
import { CREATE_MEAL_REQUEST_PAGE, LOGIN_PAGE } from "../constants/Routes";
4444
import AuthContext from "../contexts/AuthContext";
45-
import { MealRequest } from "../types/MealRequestTypes";
45+
import { MealRequest, MealStatus } from "../types/MealRequestTypes";
4646
import { logPossibleGraphQLError } from "../utils/GraphQLUtils";
4747

4848
const DELETE_MEAL_REQUEST = gql`
@@ -234,7 +234,7 @@ const ASPCalendar = ({ authId }: ASPCalendarProps) => {
234234
<Box textAlign="center" marginBottom={4}>
235235
{selectedMealRequest.donationInfo ? (
236236
<Text fontSize="20px" as="b">
237-
Upcoming Delivery
237+
{ selectedMealRequest.status === MealStatus.UPCOMING ? "Upcoming Delivery" : "Fulfilled Meal" }
238238
</Text>
239239
) : (
240240
<Text fontSize="20px" as="b">
@@ -373,6 +373,7 @@ const ASPCalendar = ({ authId }: ASPCalendarProps) => {
373373
) : null}
374374
</Table>
375375
<Box position="absolute" bottom={2} right={2}>
376+
{selectedMealRequest.status !== MealStatus.FULFILLED ?
376377
<HStack spacing={2}>
377378
<Button
378379
variant="link"
@@ -386,6 +387,7 @@ const ASPCalendar = ({ authId }: ASPCalendarProps) => {
386387
Edit
387388
</Button>
388389
</HStack>
390+
: null}
389391
</Box>
390392
</Card>
391393
) : (

0 commit comments

Comments
 (0)