File tree 1 file changed +11
-12
lines changed
1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change 1
1
import styles from '../css/ShortUpcomingEvent.module.css'
2
2
import useMediaQuery from '../utils/useMediaQuery'
3
- import allEvents from '../utils/upcomingEvents'
3
+ import { byDate } from '../utils/upcomingEvents'
4
4
import UpcomingEvent from './UpcomingEvent'
5
5
6
6
const EventSelector = props => {
7
7
const isDesktop = useMediaQuery ( '(min-width: 600px)' )
8
+ const events = byDate . slice ( 0 , 3 ) ;
8
9
9
10
return (
10
11
< div
@@ -19,9 +20,9 @@ const EventSelector = props => {
19
20
< div
20
21
className = { isDesktop ? styles . eventsNotes : styles . eventsNotesMobile }
21
22
>
22
- { allEvents . map ( ( event , i ) => (
23
+ { events . map ( ( event , i ) => (
23
24
< >
24
- { i < 3 && (
25
+ {
25
26
< div className = { ! isDesktop && styles . notesMargin } >
26
27
< UpcomingEvent
27
28
primaryColor = { event . primaryColor && event . primaryColor }
@@ -35,17 +36,15 @@ const EventSelector = props => {
35
36
fbEvent = { event . fbEvent }
36
37
/>
37
38
</ div >
38
- ) }
39
+ }
39
40
</ >
40
41
) ) }
41
- { allEvents . length <= 0 &&
42
- < p
43
- style = { isDesktop ? { fontSize : '2rem' } : { fontSize : '1rem' } }
44
- className = { styles . title }
45
- >
46
- Stay tuned for future events
47
- </ p >
48
- }
42
+ < p
43
+ style = { isDesktop ? { fontSize : '30px' } : { fontSize : '18px' } }
44
+ className = { styles . title }
45
+ >
46
+ { events . length > 0 ? '' : 'Stay tuned for future events' }
47
+ </ p >
49
48
</ div >
50
49
</ div >
51
50
)
You can’t perform that action at this time.
0 commit comments