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

Updated the Upcoming Events list UI on the Organization dashboard. #1366

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
6f55b51
Updated the Upcoming Events list UI of the Organization Dashboard.
AmitSharma512 Jan 3, 2024
7f30d18
Merge branch 'develop' of https://github.com/AmitSharma512/talawa-adm…
AmitSharma512 Jan 3, 2024
68f0359
Merge branch 'develop' of https://github.com/AmitSharma512/talawa-adm…
AmitSharma512 Jan 5, 2024
6f2ed65
Updated the logo on the dashboard
AmitSharma512 Jan 5, 2024
8e8f67b
Updated the CSS and the logo styling.
AmitSharma512 Jan 6, 2024
1b4eeb1
Merge branch 'develop' of https://github.com/AmitSharma512/talawa-adm…
AmitSharma512 Jan 6, 2024
0cefba9
Merge branch 'develop' of https://github.com/AmitSharma512/talawa-adm…
AmitSharma512 Jan 6, 2024
ff3d0d7
Merge branch 'develop' of https://github.com/AmitSharma512/talawa-adm…
AmitSharma512 Jan 7, 2024
a4033cb
Merge branch 'develop' of https://github.com/AmitSharma512/talawa-adm…
AmitSharma512 Jan 7, 2024
492ba6a
Merge branch 'develop' of https://github.com/AmitSharma512/talawa-adm…
AmitSharma512 Jan 8, 2024
e73a825
Merge branch 'develop' of https://github.com/AmitSharma512/talawa-adm…
AmitSharma512 Jan 10, 2024
6941ad1
Updated the location logo on the Organization Dashboard.
AmitSharma512 Jan 10, 2024
0b40f69
Fixed the Failing tests.
AmitSharma512 Jan 10, 2024
b1778c1
Merge branch 'develop' of https://github.com/AmitSharma512/talawa-adm…
AmitSharma512 Jan 13, 2024
25cd687
Updated the names of the svgs.
AmitSharma512 Jan 13, 2024
63fc6ed
Merge branch 'develop' of https://github.com/AmitSharma512/talawa-adm…
AmitSharma512 Jan 14, 2024
d36bb9e
Merge branch 'develop' of https://github.com/AmitSharma512/talawa-adm…
AmitSharma512 Jan 15, 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
3 changes: 3 additions & 0 deletions src/assets/svgs/cardItemDate.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 src/assets/svgs/cardItemEvent.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/assets/svgs/cardItemLocation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 23 additions & 2 deletions src/components/OrganizationDashCards/CardItem.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
position: relative;
display: flex;
align-items: center;
padding: 0.75rem 0;
border: 1px solid var(--bs-gray-200);
border-radius: 8px;
margin-top: 20px;
}

.cardItem .iconWrapper {
Expand Down Expand Up @@ -39,6 +41,22 @@
.cardItem .title {
font-size: 1rem;
flex: 1;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 1;
line-clamp: 1;
-webkit-box-orient: vertical;
margin-left: 3px;
}

.cardItem .location {
font-size: 0.9rem;
color: var(--bs-primary);
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 1;
line-clamp: 1;
-webkit-box-orient: vertical;
}

.cardItem .time {
Expand All @@ -53,8 +71,11 @@

.rightCard {
display: flex;
gap: 5px;
gap: 7px;
min-width: 170px;
justify-content: center;
flex-direction: column;
margin-left: 10px;
overflow-x: hidden;
width: 210px;
}
9 changes: 7 additions & 2 deletions src/components/OrganizationDashCards/CardItem.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,20 @@ describe('Testing the Organization Card', () => {
const props: InterfaceCardItem = {
type: 'Event',
title: 'Event Title',
time: '2023-09-03',
startdate: '2023-09-13',
enddate: '2023-09-14',
location: 'Event Location',
};

render(<CardItem {...props} />);

expect(screen.getByText(/Event Title/i)).toBeInTheDocument();
expect(
screen.getByText(dayjs(props.time).format('MMM D, YYYY'))
screen.getByText(
`${dayjs(props.startdate).format('MMM D, YYYY')} - ${dayjs(
props.enddate
).format('MMM D, YYYY')}`
)
).toBeInTheDocument();
expect(screen.getByText(/Event Location/i)).toBeInTheDocument();
});
Expand Down
49 changes: 36 additions & 13 deletions src/components/OrganizationDashCards/CardItem.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import { ReactComponent as EventsIcon } from 'assets/svgs/events.svg';
import { ReactComponent as EventsIcon } from 'assets/svgs/cardItemEvent.svg';
import { ReactComponent as PostsIcon } from 'assets/svgs/post.svg';
import { ReactComponent as MarkerIcon } from 'assets/svgs/location.svg';
import { ReactComponent as DateIcon } from 'assets/svgs/date.svg';
import { ReactComponent as MarkerIcon } from 'assets/svgs/cardItemLocation.svg';
import { ReactComponent as DateIcon } from 'assets/svgs/cardItemDate.svg';
import { ReactComponent as UserIcon } from 'assets/svgs/user.svg';
import dayjs from 'dayjs';
import styles from './CardItem.module.css';
Expand All @@ -12,15 +12,17 @@ export interface InterfaceCardItem {
type: 'Event' | 'Post' | 'MembershipRequest';
title: string;
time?: string;
startdate?: string;
enddate?: string;
creator?: any;
location?: string;
}

const cardItem = (props: InterfaceCardItem): JSX.Element => {
const { creator, type, title, time, location } = props;
const { creator, type, title, startdate, time, enddate, location } = props;
return (
<>
<div className={`${styles.cardItem} border-bottom`}>
<div className={`${styles.cardItem} border-bottom py-3 pe-5 ps-4`}>
<div className={`${styles.iconWrapper} me-3`}>
<div className={styles.themeOverlay} />
{type == 'Event' ? (
Expand All @@ -37,7 +39,6 @@ const cardItem = (props: InterfaceCardItem): JSX.Element => {
)
)}
</div>
<span className={styles.title}>{`${title}`}</span>

<div className={styles.rightCard}>
{creator && (
Expand All @@ -55,23 +56,45 @@ const cardItem = (props: InterfaceCardItem): JSX.Element => {
</small>
)}

{title && (
<span
className={`${styles.title} fst-normal fw-semibold --bs-black`}
>
{title}
</span>
)}

{location && (
<span className={styles.location}>
<span className={`${styles.location} fst-normal fw-semibold`}>
<MarkerIcon
title="Event Location"
fill="var(--bs-primary)"
width={20}
height={20}
stroke="var(--bs-primary)"
width={22}
height={22}
/>{' '}
{location}
</span>
)}
{time && (
<span className={styles.time}>
{type == 'Event' && startdate && (
<span className={`${styles.time} fst-normal fw-semibold`}>
{type === 'Event' && (
<DateIcon
title="Event Date"
fill="#4cd964"
fill="var(--bs-gray-600)"
width={20}
height={20}
/>
)}{' '}
{dayjs(startdate).format('MMM D, YYYY')} -{' '}
{dayjs(enddate).format('MMM D, YYYY')}
</span>
)}
{type == 'Post' && time && (
<span className={`${styles.time} fst-normal fw-semibold`}>
{type === 'Post' && (
<DateIcon
title="Event Date"
fill="var(--bs-gray-600)"
width={20}
height={20}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}

.cardHeader .cardTitle {
Expand Down
3 changes: 2 additions & 1 deletion src/screens/OrganizationDashboard/OrganizationDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ function organizationDashboard(): JSX.Element {
<CardItem
type="Event"
key={event._id}
time={event.startDate}
startdate={event.startDate}
enddate={event.endDate}
title={event.title}
location={event.location}
/>
Expand Down
Loading