Skip to content

Commit 9ee5739

Browse files
authored
Merge pull request #8731 from frankiefab100/upcoming-eventlist
refactor(UpcomingEventsList): update to chakra ui styling
2 parents bddb811 + bd10f0b commit 9ee5739

File tree

1 file changed

+19
-42
lines changed

1 file changed

+19
-42
lines changed

src/components/UpcomingEventsList.tsx

Lines changed: 19 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Libraries
22
import React, { useEffect, useState } from "react"
3-
import styled from "@emotion/styled"
3+
import { Box } from "@chakra-ui/react"
44

55
// Components
66
import EventCard from "./EventCard"
@@ -12,43 +12,6 @@ import Button from "./Button"
1212
// Data
1313
import events from "../data/community-events.json"
1414

15-
const EventList = styled.div`
16-
/* Adding direction ltr as a temporary fix to styling bug */
17-
/* https://github.com/ethereum/ethereum-org-website/issues/6221 */
18-
direction: ltr;
19-
width: 100%;
20-
margin: 30px auto;
21-
position: relative;
22-
padding: 0 10px;
23-
-webkit-transition: all 0.4s ease;
24-
-moz-transition: all 0.4s ease;
25-
-ms-transition: all 0.4s ease;
26-
transition: all 0.4s ease;
27-
28-
&:before {
29-
content: "";
30-
width: 3px;
31-
height: 100%;
32-
background: ${(props) => props.theme.colors.primary};
33-
left: 50%;
34-
top: 0;
35-
position: absolute;
36-
}
37-
38-
&:after {
39-
content: "";
40-
clear: both;
41-
display: table;
42-
width: 100%;
43-
}
44-
`
45-
46-
const ButtonLinkContainer = styled.div`
47-
display: flex;
48-
justify-content: center;
49-
max-width: 620px;
50-
margin-top: 1.25rem;
51-
`
5215

5316
interface ICommunityEventData {
5417
title: string
@@ -142,7 +105,16 @@ const UpcomingEventsList: React.FC<IProps> = () => {
142105

143106
return (
144107
<>
145-
<EventList>
108+
<Box
109+
width="100%"
110+
margin="30px auto"
111+
position="relative"
112+
padding="0 10px"
113+
transition="all 0.4s ease"
114+
_before={{ content: '""', position: "absolute", width: "3px", height: "full", background: "primary",
115+
top: 0, left: "50%" }}
116+
_after={{ content: '""', display: "table", width: "100%", clear: "both" }}
117+
>
146118
{orderedUpcomingEvents
147119
?.slice(0, maxRange)
148120
.map(({ title, to, formattedDetails, date, location }, idx) => {
@@ -158,14 +130,19 @@ const UpcomingEventsList: React.FC<IProps> = () => {
158130
/>
159131
)
160132
})}
161-
</EventList>
162-
<ButtonLinkContainer>
133+
</Box>
134+
<Box
135+
display="flex"
136+
justifyContent="center"
137+
maxWidth="620px"
138+
marginTop="5"
139+
>
163140
{isVisible && (
164141
<Button onClick={loadMoreEvents}>
165142
<Translation id="page-community-upcoming-events-load-more" />
166143
</Button>
167144
)}
168-
</ButtonLinkContainer>
145+
</Box>
169146
</>
170147
)
171148
}

0 commit comments

Comments
 (0)