diff --git a/src/components/galleryPage/galleryPage.jsx b/src/components/galleryPage/galleryPage.jsx index 5c1e195..9b423fe 100644 --- a/src/components/galleryPage/galleryPage.jsx +++ b/src/components/galleryPage/galleryPage.jsx @@ -14,7 +14,19 @@ class GalleryPage extends Component{ let photoUrl = urlConstructor.getPhotoUrl(item.farm, item.server, item.id, item.secret, 'b'); return( - + { + this.props.photoClickHandler({ + photoSrc : photoUrl, + title : item.title, + owner : item.ownername + }); + }} + /> ); }); } @@ -25,7 +37,20 @@ class GalleryPage extends Component{ let smallUrl = urlConstructor.getPhotoUrl(item.farm, item.server, item.id, item.secret, 's'); return( - + { + this.props.photoClickHandler({ + photoSrc : photoUrl, + title : item.title, + owner : item.ownername + }); + }} + /> ); }); }; diff --git a/src/routes/galleryPage/GalleryPageContainer.jsx b/src/routes/galleryPage/GalleryPageContainer.jsx index 85e2388..68e1000 100644 --- a/src/routes/galleryPage/GalleryPageContainer.jsx +++ b/src/routes/galleryPage/GalleryPageContainer.jsx @@ -4,6 +4,10 @@ import { connect } from 'react-redux'; import galleryPageActions from '../../actions/galleryPageActions/galleryPageActions'; import GalleryPage from '../../components/galleryPage/galleryPage.jsx'; + +import Modal from '../../components/common/modal.jsx'; + + import '../../styles/galleryPage/galleryPage.scss'; @@ -20,6 +24,8 @@ class GalleryPageContainer extends Component{ this.state ={ callNetworkFlag : true, + showModal : false, + modalPhoto : {} } } @@ -39,7 +45,7 @@ class GalleryPageContainer extends Component{ toast.info(`🚀 Fetching Page #${currentPage + 1}`, { - position: "bottom-center", + position: "bottom-right", autoClose: 5000, hideProgressBar: false, closeOnClick: true, @@ -50,10 +56,44 @@ class GalleryPageContainer extends Component{ } }; + openModal = photoDetails =>{ + this.setState({ + showModal : true, + modalPhoto : photoDetails + }); + }; + + photoClickHandler = photoDetails =>{ + console.log('photo clicked'); + this.openModal(photoDetails); + }; + + closeModal = () =>{ + this.setState({ + showModal : false, + modalPhoto : {} + }); + }; + render(){ const { photos, currentPage, isFetching, totalPageCount} = this.props.galleryPage; return(
+ + + +
+ +
{this.state.modalPhoto.title}
+
{this.state.modalPhoto.owner}
+
+
+ + + } diff --git a/src/styles/components/modal.scss b/src/styles/components/modal.scss index 42ccce5..c8373e7 100644 --- a/src/styles/components/modal.scss +++ b/src/styles/components/modal.scss @@ -7,6 +7,10 @@ position: fixed; z-index: 12; top: 0; + left: 0; + display: flex; + flex-direction: column; + justify-content: space-evenly; transition: $transition_mid; } @@ -15,7 +19,6 @@ } .FF_graphContainer{ - height: 100%; display: flex; flex-direction: column; align-items: center; @@ -24,11 +27,10 @@ } .FF_graphTitle{ - text-align: left; + text-align: center; color: #fff; font-size: 15pt; text-shadow: 0px 0px 15px black; - position: absolute; top: 60px; width: 100%; } \ No newline at end of file diff --git a/src/styles/galleryPage/galleryPage.scss b/src/styles/galleryPage/galleryPage.scss index 9c746af..d21c293 100644 --- a/src/styles/galleryPage/galleryPage.scss +++ b/src/styles/galleryPage/galleryPage.scss @@ -65,3 +65,15 @@ font-size: 11pt; color: $color_text_gray; } + +.FF_modalImage{ + max-width: 60%; + max-height: 50%; +} + +.FF_modalImageContainer{ + background: #fff; + text-align: center; + margin: 10px 50px; + border-radius: 5px; +} \ No newline at end of file