@@ -18,6 +18,7 @@ const Card = styled(Flex)`
1818 border: 1px solid ${ graySecondary } ;
1919 min-height: 120px;
2020 color: #8393a7;
21+ text-align: left;
2122 & .eventPhoto {
2223 height: 120px;
2324 width: 100%;
@@ -75,39 +76,63 @@ const CardTitle = styled.h3`
7576
7677export default props => (
7778 < 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 ] } >
8891 < Flex className = "eventDetails" column justify = "space-between" >
8992 < CardTitle inverted color = "#222" px = { [ 2 ] } py = { [ 1 ] } m = { 0 } >
9093 { truncateString ( props . name , 64 ) }
9194 </ 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 ] } >
9396 < LocationIcon className = "icons" />
9497 < span > { truncateString ( props . location , 55 ) } </ span >
9598 </ Box >
9699 < Box px = { 2 } pb = { [ 2 , 1 ] } >
97100 < 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 ] } >
99108 < TimeIcon className = "icons" />
100109 < span > { format ( props . time , "ddd MMM Do 'YY, h:mm A" ) } </ span >
101110 </ Box >
102- < Box fontSize = { [ 12 , 14 , 16 ] } width = { [ 1 , 1 , 0.24 ] } className = "secondaryText" pr = { 1 } mx = { [ 0 ] } my = { [ 1 , 1 , 0 ] } >
111+ < Box
112+ fontSize = { [ 12 , 14 , 16 ] }
113+ width = { props . showImg ? [ 1 , 1 , 0.24 ] : [ 1 , 1 , 1 / 2 ] }
114+ className = "secondaryText"
115+ pr = { 1 }
116+ mx = { [ 0 ] }
117+ my = { props . showImg ? [ 1 , 1 , 0 ] : [ 1 , 1 , 1 ] } >
103118 < AttendeesIcon className = "icons" />
104119 < span > { props . tense === 'past' ? `${ props . attendees } attended` : `${ props . attendees } attending` } </ span >
105120 </ Box >
106- < Box fontSize = { [ 12 , 14 , 16 ] } width = { [ 1 , 1 , 0.21 ] } className = "secondaryText" pr = { 1 } mx = { [ 0 ] } my = { [ 1 , 1 , 0 ] } >
121+ < Box
122+ fontSize = { [ 12 , 14 , 16 ] }
123+ width = { props . showImg ? [ 1 , 1 , 0.21 ] : [ 1 , 1 , 1 / 2 ] }
124+ className = "secondaryText"
125+ pr = { 1 }
126+ mx = { [ 0 ] }
127+ my = { props . showImg ? [ 1 , 1 , 0 ] : [ 1 , 1 , 1 ] } >
107128 { props . online ? < StreamIcon className = "icons" /> : < TicketIcon className = "icons" /> }
108129 < span > { props . online ? 'Free session' : 'Free entry' } </ span >
109130 </ Box >
110- < Box fontSize = { [ 12 , 14 , 16 ] } width = { [ 1 , 1 , 0.17 ] } mt = { [ 1 , 1 , 0 ] } className = "rsvp" >
131+ < Box
132+ fontSize = { [ 12 , 14 , 16 ] }
133+ width = { props . showImg ? [ 1 , 1 , 0.17 ] : [ 1 , 1 , 1 / 2 ] }
134+ mt = { props . showImg ? [ 1 , 1 , 0 ] : [ 1 , 1 , 1 ] }
135+ className = "rsvp" >
111136 < Button href = { props . link } inverted medium >
112137 { props . tense === 'past' ? 'View' : 'RSVP' }
113138 </ Button >
0 commit comments