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

Notification List Styling #88

Merged
merged 6 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion client/assets/background.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions client/assets/notifications/arrow-drop-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions client/assets/notifications/back-arrow-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions client/assets/notifications/check-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions client/assets/notifications/clock-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions client/assets/notifications/confirmation-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion client/components/Background.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import BackgroundPattern from '../assets/background.svg';

export function Background() {
return (
<View className="absolute -z-50 h-[120vh] w-[100vw]">
<View className="absolute -z-50 h-[100vh] w-[100vw]">
<BackgroundPattern />
</View>
);
Expand Down
106 changes: 106 additions & 0 deletions client/components/NotificationCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import React from 'react';
import { Text, View } from 'react-native';

import moment from 'moment';

import ArrowRight from '../assets/notifications/arrow-drop-right.svg';
import Check from '../assets/notifications/check-icon.svg';
import Clock from '../assets/notifications/clock-icon.svg';
import Confirmation from '../assets/notifications/confirmation-icon.svg';

interface notifCardElements {
title: string;
description: string;
icon: JSX.Element;
}

export function NotificationCard({
notification_type,
task_title,
due_date
}: {
notification_type: string;
task_title: string;
due_date: Date;
}) {
// notification_type: 'due_soon' | 'status_update' | 'task_confirmation' | 'task_accepted'';

const stuff = (): notifCardElements => {
switch (notification_type) {
case 'due_soon':
return {
title: 'TASK DUE SOON',
description: task_title + ' due in ' + moment(due_date).fromNow(true),
icon: <Clock />
};
case 'task_confirmation':
return {
title: 'TASK CONFIRMATION',
description: task_title + ' task created',
icon: <Confirmation />
};
case 'task_accepted':
return {
title: 'TASK ACCEPTED',
description: /*USERNAME*/ 'Someone accepted this task',
icon: <Check />
};
case 'status_update':
return {
title: 'UPDATE TASK',
description: task_title + ' task needs to be updated',
icon: <Check />
};
case 'pending':
return {
title: 'PENDING TASK',
description: 'You have been assigned a task. Accept or Decline',
icon: <Check />
};
default:
return {
title: 'TASK NOTIFICATION',
description: 'task notification',
icon: <Confirmation />
};
}
};

const notif = stuff();

/** <Text className="mt-3 flex flex-row space-x-10">
{descriptionText()}
</Text>
*/

return (
<View className="mb-6 flex rounded-lg border border-carewallet-lightgray bg-carewallet-white p-4 ">
<View className="flex flex-row justify-between ">
<View className="flex flex-row items-center">
{notif.icon}

<View className="flex w-[60vw] flex-col pl-4">
<Text className="mb-2 mt-3 font-carewallet-montserrat-bold">
{notif.title}
</Text>
<Text className="mb-3 font-carewallet-montserrat text-carewallet-black">
{notif.description}
</Text>
</View>
{/*
<View className="flex w-fit flex-col pl-4">
<Text className="mb-2 font-carewallet-montserrat-bold">
{notif.title}
</Text>
<Text className="mb-2 font-carewallet-montserrat text-carewallet-black">
{notif.description}
</Text>
</View> */}
</View>
<View className="flex flex-row items-center">
<ArrowRight />
</View>
</View>
</View>
);
}
8 changes: 4 additions & 4 deletions client/navigation/AppStackBottomTabNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import Bell from '../assets/bottom-nav/bell.svg';
import Calendar from '../assets/bottom-nav/calendar.svg';
import HomeIcon from '../assets/bottom-nav/home.svg';
import User from '../assets/bottom-nav/user.svg';
import Home from '../screens/Home';
import { CalendarNavigationContainer } from './containers/CalendarNavigationContainer';
import { HomeNavigationContainer } from './containers/HomeNavigationContainer';
import { NotificationNavigationContainer } from './containers/NotificationNavigationContainer';
import { ProfileNavigationContainer } from './containers/ProfileNavigationContainer';

const AppStackBottomTab = createBottomTabNavigator();
Expand Down Expand Up @@ -45,13 +45,13 @@ export function AppStackBottomTabNavigator() {
component={CalendarNavigationContainer}
/>
<AppStackBottomTab.Screen
name="Notifications"
name="NotificationsContainer"
options={{
headerShown: true,
headerShown: false,
tabBarIcon: ({ color }) => <Bell color={color} />,
tabBarLabel: () => null
}}
component={Home}
component={NotificationNavigationContainer}
/>
<AppStackBottomTab.Screen
name="ProfileScreens"
Expand Down
26 changes: 26 additions & 0 deletions client/navigation/containers/NotificationNavigationContainer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react';

import Notifications from '../../screens/NotificationList';
import SingleTaskScreen from '../../screens/SingleTask';
import { AppStack } from '../types';

export function NotificationNavigationContainer() {
return (
<AppStack.Navigator
screenOptions={{
headerShown: false
}}
>
<AppStack.Screen
name="Notifications"
options={{ headerShown: false }}
component={Notifications}
/>
<AppStack.Screen
name="TaskDisplay"
options={{ headerShown: false }}
component={SingleTaskScreen}
/>
</AppStack.Navigator>
);
}
Loading
Loading