@@ -18,6 +18,7 @@ const Card = styled(Flex)`
18
18
border: 1px solid ${ graySecondary } ;
19
19
min-height: 120px;
20
20
color: #8393a7;
21
+ text-align: left;
21
22
& .eventPhoto {
22
23
height: 120px;
23
24
width: 100%;
@@ -75,43 +76,67 @@ const CardTitle = styled.h3`
75
76
76
77
export default props => (
77
78
< Card my = { [ 3 ] } wrap >
78
- < Flex align = "streach" width = { [ 1 , 1 , 1 / 4 ] } >
79
- < img
80
- className = "eventPhoto"
81
- src = { `https://res.cloudinary.com/coderplex/image/fetch/w_200,h_150/${ props . image } ` }
82
- srcSet = { `https://res.cloudinary.com/coderplex/image/fetch/w_300,h_200/${
83
- props . image
84
- } 720w, https://res.cloudinary.com/coderplex/image/fetch/w_200,h_150/${ props . image } 1024w`}
85
- />
86
- </ Flex >
87
- < Box className = "eventDetails" width = { [ 1 , 1 , 3 / 4 ] } >
79
+ { props . showImg && (
80
+ < Flex align = "streach" width = { [ 1 , 1 , 1 / 4 ] } >
81
+ < img
82
+ className = "eventPhoto"
83
+ src = { `https://res.cloudinary.com/coderplex/image/fetch/w_200,h_150/${ props . image } ` }
84
+ srcSet = { `https://res.cloudinary.com/coderplex/image/fetch/w_300,h_200/${
85
+ props . image
86
+ } 720w, https://res.cloudinary.com/coderplex/image/fetch/w_200,h_150/${ props . image } 1024w`}
87
+ />
88
+ </ Flex >
89
+ ) }
90
+ < Box className = "eventDetails" width = { props . showImg ? [ 1 , 1 , 3 / 4 ] : [ 1 , 1 , 1 ] } >
88
91
< Flex className = "eventDetails" column justify = "space-between" >
89
92
< CardTitle inverted color = "#222" px = { [ 2 ] } py = { [ 1 ] } m = { 0 } >
90
93
{ truncateString ( props . name , 64 ) }
91
94
</ CardTitle >
92
- < Box fontSize = { [ 12 , 14 , 16 ] } className = "secondaryText" px = { [ 2 ] } my = { [ 1 , 1 , 0 ] } >
95
+ < Box fontSize = { [ 12 , 14 , 16 ] } className = "secondaryText" px = { [ 2 ] } my = { props . showImg ? [ 1 , 1 , 0 ] : [ 1 , 1 , 1 ] } >
93
96
< LocationIcon className = "icons" />
94
97
< span > { truncateString ( props . location , 55 ) } </ span >
95
98
</ Box >
96
99
< Box px = { 2 } pb = { [ 2 , 1 ] } >
97
100
< Flex wrap >
98
- < Box fontSize = { [ 12 , 14 , 16 ] } width = { [ 1 , 1 , 0.38 ] } className = "secondaryText" pr = { 1 } mr = { [ 0 ] } my = { [ 1 , 1 , 0 ] } >
101
+ < Box
102
+ fontSize = { [ 12 , 14 , 16 ] }
103
+ width = { props . showImg ? [ 1 , 1 , 0.38 ] : [ 1 , 1 , 1 / 2 ] }
104
+ className = "secondaryText"
105
+ pr = { 1 }
106
+ mr = { [ 0 ] }
107
+ my = { props . showImg ? [ 1 , 1 , 0 ] : [ 1 , 1 , 1 ] } >
99
108
< TimeIcon className = "icons" />
100
109
< span >
101
110
{ props . tense === 'past'
102
111
? format ( props . time , "ddd MMM Do 'YY" )
103
112
: format ( props . time , "ddd MMM Do 'YY, h:mm A" ) }
104
113
</ span >
105
114
</ Box >
106
- < Box fontSize = { [ 12 , 14 , 16 ] } width = { [ 1 , 1 , 0.24 ] } className = "secondaryText" pr = { 1 } mx = { [ 0 ] } my = { [ 1 , 1 , 0 ] } >
115
+ < Box
116
+ fontSize = { [ 12 , 14 , 16 ] }
117
+ width = { props . showImg ? [ 1 , 1 , 0.24 ] : [ 1 , 1 , 1 / 2 ] }
118
+ className = "secondaryText"
119
+ pr = { 1 }
120
+ mx = { [ 0 ] }
121
+ my = { props . showImg ? [ 1 , 1 , 0 ] : [ 1 , 1 , 1 ] } >
107
122
< AttendeesIcon className = "icons" />
108
123
< span > { props . tense === 'past' ? `${ props . attendees } attended` : `${ props . attendees } attending` } </ span >
109
124
</ Box >
110
- < Box fontSize = { [ 12 , 14 , 16 ] } width = { [ 1 , 1 , 0.21 ] } className = "secondaryText" pr = { 1 } mx = { [ 0 ] } my = { [ 1 , 1 , 0 ] } >
125
+ < Box
126
+ fontSize = { [ 12 , 14 , 16 ] }
127
+ width = { props . showImg ? [ 1 , 1 , 0.21 ] : [ 1 , 1 , 1 / 2 ] }
128
+ className = "secondaryText"
129
+ pr = { 1 }
130
+ mx = { [ 0 ] }
131
+ my = { props . showImg ? [ 1 , 1 , 0 ] : [ 1 , 1 , 1 ] } >
111
132
{ props . online ? < StreamIcon className = "icons" /> : < TicketIcon className = "icons" /> }
112
133
< span > { props . online ? 'Free session' : 'Free entry' } </ span >
113
134
</ Box >
114
- < Box fontSize = { [ 12 , 14 , 16 ] } width = { [ 1 , 1 , 0.17 ] } mt = { [ 1 , 1 , 0 ] } className = "rsvp" >
135
+ < Box
136
+ fontSize = { [ 12 , 14 , 16 ] }
137
+ width = { props . showImg ? [ 1 , 1 , 0.17 ] : [ 1 , 1 , 1 / 2 ] }
138
+ mt = { props . showImg ? [ 1 , 1 , 0 ] : [ 1 , 1 , 1 ] }
139
+ className = "rsvp" >
115
140
< Button href = { props . link } inverted medium >
116
141
{ props . tense === 'past' ? 'View' : 'RSVP' }
117
142
</ Button >
0 commit comments