Skip to content

Commit 0527409

Browse files
committed
expansion feature
1 parent f7885e8 commit 0527409

File tree

2 files changed

+30
-20
lines changed

2 files changed

+30
-20
lines changed

src/activity/events/EventsList.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ function ExpandButton(buttonState, isExpanded) {
8989
>
9090
<IconButton type="button" onClick={buttonState}>
9191
<KeyboardArrowDown
92-
id={isExpanded ? "open" : "closed"}
92+
className="expand-icon"
9393
fontSize="large"
94+
id={isExpanded ? "open" : "closed"}
9495
/>
9596
</IconButton>
9697
</Tooltip>
@@ -126,12 +127,13 @@ function EventsList() {
126127
isExpanded[singleEvent.id],
127128
)}
128129
</div>
129-
{isExpanded[singleEvent.id] && (
130-
<div className="event-expand">
131-
{EventDetails(singleEvent.description, singleEvent.meetingUrl)}
132-
{EventPosters(singleEvent.images)}
133-
</div>
134-
)}
130+
<div
131+
className="event-expand"
132+
id={isExpanded[singleEvent.id] ? "expanded" : "collapsed"}
133+
>
134+
{EventDetails(singleEvent.description, singleEvent.meetingUrl)}
135+
{EventPosters(singleEvent.images)}
136+
</div>
135137
</div>
136138
);
137139
})}

src/activity/events/events.css

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
.event {
4949
display: inline-flexbox;
5050
max-width: 800px;
51+
height: auto;
5152
width: 90%;
5253
padding: 5px;
5354
margin: 20px auto 40px auto;
@@ -59,10 +60,6 @@
5960
transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
6061
}
6162

62-
.event #expanding {
63-
animation: all expanding 1s ease-in-out;
64-
}
65-
6663
.event:hover {
6764
transform: translateY(-15px);
6865
box-shadow: 0px 20px 15px 0px rgb(0, 0, 0, 0.5);
@@ -114,20 +111,19 @@
114111
}
115112

116113
.event-info #title {
117-
margin: 0.2rem 0 10px 0;
118-
padding: 5px 0.75rem;
114+
margin: 0.1rem 0 10px 0;
115+
padding: 0.5rem 0.75rem;
119116
color: white;
120117
font-size: 2.5vh;
121-
font-family: "Times New Roman", Times, serif;
122118
font-size-adjust: inherit;
123119
font-weight: bold;
124-
border-radius: 8px;
120+
border-radius: 5px;
125121
background-color: #21262d;
126122
}
127123

128124
.event-info #important {
129125
display: inline-block;
130-
margin: 0px 20px 5px 0;
126+
margin: 5px 20px 5px 0;
131127
padding: 5px 10px;
132128
font-size: 18px;
133129
color: white;
@@ -157,12 +153,12 @@
157153
}
158154

159155
#open {
160-
transition: 0.5s;
156+
transition: all 0.5s;
161157
transform: rotate(-180deg);
162158
}
163159

164160
#closed {
165-
transition: 0.5s;
161+
transition: all 0.5s;
166162
transform: rotate(0deg);
167163
}
168164

@@ -172,12 +168,24 @@
172168

173169
/* Expand content */
174170
.event-expand {
175-
margin: 0.5rem 1.5rem 2rem 1.5rem;
176-
padding: 1.5rem;
177171
font-size: 18px;
178172
color: white;
179173
background-color: #21262d;
180174
border-radius: 10px;
175+
overflow: hidden;
176+
transition: all 0.5s;
177+
}
178+
179+
#expanded {
180+
max-height: 800px;
181+
margin: 0.5rem 1.5rem 2rem 1.5rem;
182+
padding: 1.5rem;
183+
}
184+
185+
#collapsed {
186+
max-height: 0;
187+
margin: 0 1.5rem;
188+
padding: 0px 1.5rem;
181189
}
182190

183191
.event-expand .details {

0 commit comments

Comments
 (0)