File tree Expand file tree Collapse file tree 4 files changed +27
-9
lines changed Expand file tree Collapse file tree 4 files changed +27
-9
lines changed Original file line number Diff line number Diff line change 2121 "react-helmet" : " ^6.1.0" ,
2222 "react-hook-form" : " ^6.3.2" ,
2323 "react-i18next" : " ^11.5.0" ,
24+ "react-image-gallery" : " ^1.2.5" ,
2425 "react-markdown" : " ^5.0.2" ,
2526 "react-markdown-editor-lite" : " ^1.2.4" ,
2627 "react-promise-tracker" : " ^2.1.0" ,
Original file line number Diff line number Diff line change 55@import ' ./modules/index' ;
66@import ' ./components/index' ;
77@import ' ./pages/index' ;
8+ @import ' ~react-image-gallery/styles/scss/image-gallery.scss' ;
Original file line number Diff line number Diff line change 66 TwitterIcon ,
77 LinkedinIcon
88} from 'react-share'
9+ import ImageGallery from 'react-image-gallery'
910
1011import { Helmet } from 'react-helmet'
1112
@@ -93,6 +94,19 @@ const Story = (props) => {
9394 const hashtagsArray = [ 'EOS' , 'userstory' ]
9495 const title = 'EOS User Story - POST Stories. GET Features.'
9596
97+ const displayImages = ( ) => {
98+ const images = [ ]
99+ for ( let i = 0 ; i < 3 ; i ++ ) {
100+ images . push ( {
101+ original : story . Attachment [ `${ i } ` ] . url ,
102+ thumbnail : story . Attachment [ `${ i } ` ] . url
103+ } )
104+ }
105+ return images
106+ }
107+
108+ const images = [ ] . concat ( displayImages ( ) )
109+
96110 return (
97111 < >
98112 < Helmet >
@@ -225,15 +239,12 @@ const Story = (props) => {
225239 ) }
226240 </ div >
227241 < div >
228- { story . Attachment &&
229- story . Attachment . map ( ( obj ) => (
230- < img
231- key = { obj . id }
232- src = { obj . url }
233- alt = 'attachment'
234- height = '100'
235- />
236- ) ) }
242+ < ImageGallery
243+ items = { images }
244+ showBullets = { true }
245+ originalClass = { 'galleryoriginal' }
246+ thumbnailClass = { 'galleryThumbnail' }
247+ />
237248 </ div >
238249 < Comments storyId = { storyId } />
239250 </ div >
You can’t perform that action at this time.
0 commit comments