1
1
import { useEffect , useState } from "react"
2
+ import { useTranslation } from "next-i18next"
2
3
import { Box } from "@chakra-ui/react"
3
4
4
5
import type { CommunityConference } from "@/lib/types"
@@ -7,7 +8,6 @@ import { Button } from "@/components/Buttons"
7
8
import EventCard from "@/components/EventCard"
8
9
import InfoBanner from "@/components/InfoBanner"
9
10
import InlineLink from "@/components/Link"
10
- import Translation from "@/components/Translation"
11
11
12
12
import { trackCustomEvent } from "@/lib/utils/matomo"
13
13
@@ -19,9 +19,10 @@ type OrderedUpcomingEvent = CommunityConference & {
19
19
}
20
20
21
21
const UpcomingEventsList = ( ) => {
22
+ const { t } = useTranslation ( "page-community" )
22
23
const eventsPerLoad = 10
23
24
const [ orderedUpcomingEvents , setOrderedUpcomingEvents ] = useState <
24
- OrderedUpcomingEvent [ ]
25
+ OrderedUpcomingEvent [ ]
25
26
> ( [ ] )
26
27
const [ maxRange , setMaxRange ] = useState < number > ( eventsPerLoad )
27
28
@@ -84,9 +85,9 @@ const UpcomingEventsList = () => {
84
85
if ( orderedUpcomingEvents . length === 0 ) {
85
86
return (
86
87
< InfoBanner emoji = ":information_source:" >
87
- < Translation id = "page-community-upcoming-events-no-events" /> { " " }
88
+ { t ( "page-community-upcoming-events-no-events" ) } { " " }
88
89
< InlineLink to = "https://github.com/ethereum/ethereum-org-website/blob/dev/src/data/community-events.json" >
89
- < Translation id = "page-community:page-community- please-add-to-page" />
90
+ { t ( "page-community- please-add-to-page" ) }
90
91
</ InlineLink >
91
92
</ InfoBanner >
92
93
)
@@ -140,7 +141,7 @@ const UpcomingEventsList = () => {
140
141
>
141
142
{ maxRange <= orderedUpcomingEvents . length && (
142
143
< Button onClick = { loadMoreEvents } >
143
- < Translation id = "page-community:page-community- upcoming-events-load-more" />
144
+ { t ( "page-community- upcoming-events-load-more" ) }
144
145
</ Button >
145
146
) }
146
147
</ Box >
0 commit comments