1
1
// Libraries
2
2
import React , { useEffect , useState } from "react"
3
- import styled from "@emotion/styled "
3
+ import { Box } from "@chakra-ui/react "
4
4
5
5
// Components
6
6
import EventCard from "./EventCard"
@@ -12,43 +12,6 @@ import Button from "./Button"
12
12
// Data
13
13
import events from "../data/community-events.json"
14
14
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
- `
52
15
53
16
interface ICommunityEventData {
54
17
title : string
@@ -142,7 +105,16 @@ const UpcomingEventsList: React.FC<IProps> = () => {
142
105
143
106
return (
144
107
< >
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
+ >
146
118
{ orderedUpcomingEvents
147
119
?. slice ( 0 , maxRange )
148
120
. map ( ( { title, to, formattedDetails, date, location } , idx ) => {
@@ -158,14 +130,19 @@ const UpcomingEventsList: React.FC<IProps> = () => {
158
130
/>
159
131
)
160
132
} ) }
161
- </ EventList >
162
- < ButtonLinkContainer >
133
+ </ Box >
134
+ < Box
135
+ display = "flex"
136
+ justifyContent = "center"
137
+ maxWidth = "620px"
138
+ marginTop = "5"
139
+ >
163
140
{ isVisible && (
164
141
< Button onClick = { loadMoreEvents } >
165
142
< Translation id = "page-community-upcoming-events-load-more" />
166
143
</ Button >
167
144
) }
168
- </ ButtonLinkContainer >
145
+ </ Box >
169
146
</ >
170
147
)
171
148
}
0 commit comments