Skip to content

Commit

Permalink
Fix layout distortion due to untruncated title description of events
Browse files Browse the repository at this point in the history
  • Loading branch information
skbhagat0502 committed Nov 6, 2023
1 parent 0980326 commit 7c289c8
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 9 deletions.
17 changes: 16 additions & 1 deletion src/components/EventListCard/EventListCard.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,24 @@
.cards a:hover {
color: black;
}
.cards {
position: relative;
overflow: hidden;
transition: all 0.3s;
}
.dispflex {
display: flex;
justify-content: space-between;
height: 50px;
transition: transform 0.3s ease;
cursor: pointer;
}
.cards:hover {
transform: scale(2.5);
z-index: 5;
}
.cards:hover h2 {
font-size: 0.4vmax;
margin-bottom: 0;
}
.iconContainer {
display: flex;
Expand Down
30 changes: 27 additions & 3 deletions src/components/EventListCard/EventListCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,17 @@ function eventListCard(props: InterfaceEventListCardProps): JSX.Element {
>
<div className={styles.dispflex}>
<h2>
{props.eventName ? <>{props.eventName}</> : <>Dogs Care</>}{' '}
{props.eventName ? (
<>
{props.eventName.length > 150 ? (
<>{props.eventName.substring(0, 150)}...</>

Check warning on line 146 in src/components/EventListCard/EventListCard.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/EventListCard/EventListCard.tsx#L146

Added line #L146 was not covered by tests
) : (
<>{props.eventName}</>
)}
</>
) : (
<>Dogs Care</>
)}
</h2>
</div>
</div>
Expand All @@ -162,7 +172,17 @@ function eventListCard(props: InterfaceEventListCardProps): JSX.Element {
<p className={styles.preview}>
{t('eventTitle')}:{' '}
<span className={styles.view}>
{props.eventName ? <>{props.eventName}</> : <>Dogs Care</>}{' '}
{props.eventName ? (
<>
{props.eventName.length > 100 ? (
<>{props.eventName.substring(0, 100)}...</>

Check warning on line 178 in src/components/EventListCard/EventListCard.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/EventListCard/EventListCard.tsx#L178

Added line #L178 was not covered by tests
) : (
<>{props.eventName}</>
)}
</>
) : (
<>Dogs Care</>
)}
</span>
</p>
<p className={styles.preview}>
Expand All @@ -177,7 +197,11 @@ function eventListCard(props: InterfaceEventListCardProps): JSX.Element {
</p>
<p className={styles.preview}>
{t('description')}:{' '}
<span className={styles.view}>{props.eventDescription}</span>
<span className={styles.view}>
{props.eventDescription && props.eventDescription.length > 256
? props.eventDescription.substring(0, 256) + '...'

Check warning on line 202 in src/components/EventListCard/EventListCard.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/EventListCard/EventListCard.tsx#L202

Added line #L202 was not covered by tests
: props.eventDescription}
</span>
</p>
<p className={styles.preview}>
{t('on')}: <span className={styles.view}>{props.regDate}</span>
Expand Down
12 changes: 10 additions & 2 deletions src/components/LeftDrawerEvent/LeftDrawerEvent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,16 @@ const leftDrawerEvent = ({
/>
</div>
<div className={styles.profileText}>
<span className={styles.primaryText}>{event.title}</span>
<span className={styles.secondaryText}>{event.description}</span>
<span className={styles.primaryText}>
{event.title && event.title.length > 20
? event.title.substring(0, 20) + '...'

Check warning on line 89 in src/components/LeftDrawerEvent/LeftDrawerEvent.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/LeftDrawerEvent/LeftDrawerEvent.tsx#L89

Added line #L89 was not covered by tests
: event.title}
</span>
<span className={styles.secondaryText}>
{event.description && event.description.length > 30
? event.description.substring(0, 30) + '...'

Check warning on line 94 in src/components/LeftDrawerEvent/LeftDrawerEvent.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/LeftDrawerEvent/LeftDrawerEvent.tsx#L94

Added line #L94 was not covered by tests
: event.description}
</span>
</div>
</button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/screens/EventDashboard/EventDashboard.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
font-size: 20px;
margin-bottom: 30px;
padding-bottom: 5px;
width: 26%;
width: 100%;
}
.tagdetailsGreen > button {
background-color: #31bb6b;
Expand Down
4 changes: 2 additions & 2 deletions src/screens/EventDashboard/EventDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const EventDashboard = (): JSX.Element => {
setShowAddEventProjectModal={setShowAddEventProjectModal}
>
<Row>
<Col sm={3}>
<Col sm={4}>
<div className={styles.sidebar}>
<div className={styles.sidebarsticky}>
{/* Side Bar - Static Information about the Event */}
Expand Down Expand Up @@ -110,7 +110,7 @@ const EventDashboard = (): JSX.Element => {
</div>
</div>
</Col>
<Col sm={8} className="mt-sm-0 mt-5 ml-4 ml-sm-0">
<Col sm={6} className="mt-sm-0 mt-5 ml-4 ml-sm-0">
{/* Main Screen Container */}
<Container>
<div className={styles.mainpageright}>
Expand Down

0 comments on commit 7c289c8

Please sign in to comment.