Skip to content

Commit

Permalink
Fixed-Issue-PalisadoesFoundation#1266 Bug Report When a new post is a…
Browse files Browse the repository at this point in the history
…dded, the latest post section in the organization's dashboard becomes distorted Updated
  • Loading branch information
gauravsingh94 committed Jan 5, 2024
1 parent d3642ed commit afdbb44
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 91 deletions.
9 changes: 5 additions & 4 deletions src/components/OrganizationDashCards/CardItem.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
align-items: center;
background-color: #f1f3f68f;
border-radius: 8px;
padding: 16px;
padding: 15px;
margin-top: 20px;
}

Expand All @@ -15,7 +15,7 @@
display: flex;
justify-content: center;
align-items: center;
margin-left: 18px;
/* margin-right: 18px; */
}

.cardItem .iconWrapper .themeOverlay {
Expand All @@ -27,6 +27,7 @@
left: 0;
opacity: 0.12;
border-radius: 4px;
/* margin-right: 18px; */
}

.cardItem .iconWrapper .dangerOverlay {
Expand All @@ -48,7 +49,7 @@
word-wrap: break-word;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}

Expand All @@ -74,5 +75,5 @@
.content {
display: flex;
flex-direction: column;
max-width: 60%;
max-width: 85%;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@
justify-content: center;
align-items: center;
}
.BottomRow {
margin-top: 45px;
}
172 changes: 85 additions & 87 deletions src/screens/OrganizationDashboard/OrganizationDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,93 +210,6 @@ function organizationDashboard(): JSX.Element {
</Col>
</Row>
)}
<Row>
<Col lg={6} className="mb-4">
<Card border="0" className="rounded-4">
<div className={styles.cardHeader}>
<div className={styles.cardTitle}>
{t('upcomingEvents')}
</div>
<Button
size="sm"
variant="light"
data-testid="viewAllEvents"
onClick={(): void => history.push(eventsLink)}
>
{t('viewAll')}
</Button>
</div>
<Card.Body className={styles.cardBody}>
{loadingEvent ? (
[...Array(4)].map((_, index) => {
return <CardItemLoading key={index} />;
})
) : upcomingEvents.length == 0 ? (
<div className={styles.emptyContainer}>
<h6>{t('noUpcomingEvents')}</h6>
</div>
) : (
upcomingEvents.map(
(event: InterfaceQueryOrganizationEventListItem) => {
return (
<CardItem
type="Event"
key={event._id}
time={event.startDate}
title={event.title}
location={event.location}
/>
);
}
)
)}
</Card.Body>
</Card>
</Col>
<Col lg={6} className="mb-4">
<Card border="0" className="rounded-4">
<div className={styles.cardHeader}>
<div className={styles.cardTitle}>{t('latestPosts')}</div>
<Button
size="sm"
variant="light"
data-testid="viewAllPosts"
onClick={(): void => history.push(postsLink)}
>
{t('viewAll')}
</Button>
</div>
<Card.Body className={styles.cardBody}>
{loadingPost ? (
[...Array(4)].map((_, index) => {
return <CardItemLoading key={index} />;
})
) : postData?.postsByOrganizationConnection.edges.length ==
0 ? (
/* eslint-disable */
<div className={styles.emptyContainer}>
<h6>{t('noPostsPresent')}</h6>
</div>
) : (
/* eslint-enable */
postData?.postsByOrganizationConnection.edges
.slice(0, 5)
.map((post: any) => {
return (
<CardItem
type="Post"
key={post._id}
title={post.title}
time={post.createdAt}
creator={post.creator}
/>
);
})
)}
</Card.Body>
</Card>
</Col>
</Row>
</Col>
<Col xl={4}>
<Card border="0" className="rounded-4">
Expand Down Expand Up @@ -341,6 +254,91 @@ function organizationDashboard(): JSX.Element {
</Card>
</Col>
</Row>
<Row className={styles.BottomRow}>
<Col lg={6} className="mb-4">
<Card border="0" className="rounded-4">
<div className={styles.cardHeader}>
<div className={styles.cardTitle}>{t('upcomingEvents')}</div>
<Button
size="sm"
variant="light"
data-testid="viewAllEvents"
onClick={(): void => history.push(eventsLink)}
>
{t('viewAll')}
</Button>
</div>
<Card.Body className={styles.cardBody}>
{loadingEvent ? (
[...Array(4)].map((_, index) => {
return <CardItemLoading key={index} />;
})
) : upcomingEvents.length == 0 ? (
<div className={styles.emptyContainer}>
<h6>{t('noUpcomingEvents')}</h6>
</div>
) : (
upcomingEvents.map(
(event: InterfaceQueryOrganizationEventListItem) => {
return (
<CardItem
type="Event"
key={event._id}
time={event.startDate}
title={event.title}
location={event.location}
/>
);
}
)
)}
</Card.Body>
</Card>
</Col>
<Col lg={6} className="mb-4">
<Card border="0" className="rounded-4">
<div className={styles.cardHeader}>
<div className={styles.cardTitle}>{t('latestPosts')}</div>
<Button
size="sm"
variant="light"
data-testid="viewAllPosts"
onClick={(): void => history.push(postsLink)}
>
{t('viewAll')}
</Button>
</div>
<Card.Body className={styles.cardBody}>
{loadingPost ? (
[...Array(4)].map((_, index) => {
return <CardItemLoading key={index} />;
})
) : postData?.postsByOrganizationConnection.edges.length ==
0 ? (
/* eslint-disable */
<div className={styles.emptyContainer}>
<h6>{t('noPostsPresent')}</h6>
</div>
) : (
/* eslint-enable */
postData?.postsByOrganizationConnection.edges
.slice(0, 5)
.map((post: any) => {
return (
<CardItem
type="Post"
key={post._id}
title={post.title}
time={post.createdAt}
creator={post.creator}
/>
);
})
)}
</Card.Body>
</Card>
</Col>
</Row>
</OrganizationScreen>
</>
);
Expand Down

0 comments on commit afdbb44

Please sign in to comment.