-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementing functionalities to get/post images.
- Loading branch information
Showing
17 changed files
with
322 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const Constants = { | ||
SERVER_URL: 'http://localhost:3003/' | ||
}; | ||
|
||
export default Constants; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import React from 'react'; | ||
import PropTypes from "prop-types"; | ||
|
||
import {Button, Grid, Row} from 'react-bootstrap'; | ||
import {inject, observer} from 'mobx-react'; | ||
|
||
import './Upload.css'; | ||
import PhotoGrid from 'react-photo-feed'; | ||
import 'react-photo-feed/library/style.css'; | ||
import Constants from '../../../Constants'; | ||
|
||
@inject('dashboardStore') | ||
@observer | ||
class View extends React.Component { | ||
|
||
static propTypes = { | ||
store: PropTypes.object.isRequired | ||
}; | ||
|
||
render() { | ||
const userImages = this.props.dashboardStore.userImages.map((image, index) => { | ||
return { | ||
id: index+1, | ||
src: `${Constants.SERVER_URL}uploads/${image}`, | ||
bigSrc: `${Constants.SERVER_URL}uploads/${image}` | ||
} | ||
}); | ||
let component = <span> | ||
"You have not images, in order to add them click to "Upload" tab" | ||
</span>; | ||
if (userImages.length) { | ||
component = <PhotoGrid columns={3} photos={userImages} />; | ||
} | ||
return ( | ||
<Grid> | ||
{component} | ||
</Grid> | ||
); | ||
} | ||
} | ||
|
||
export default View; | ||
|
Oops, something went wrong.