diff --git a/public/src/components/albumPhotos.jsx b/public/src/components/albumPhotos.jsx
index 57dd2d3..eab5608 100644
--- a/public/src/components/albumPhotos.jsx
+++ b/public/src/components/albumPhotos.jsx
@@ -1,6 +1,10 @@
import React from 'react';
import Photo from './photo.jsx';
+/* ------------------------------
+defunct not currently in use
+-------------------------------*/
+
const AlbumPhotos = ({}) => {
return (
diff --git a/public/src/components/albumdisplay.jsx b/public/src/components/albumdisplay.jsx
index 3ea297b..8bd0450 100644
--- a/public/src/components/albumdisplay.jsx
+++ b/public/src/components/albumdisplay.jsx
@@ -1,12 +1,15 @@
import React from 'react';
-import AlbumPhotos from './albumPhotos.jsx';
import AlbumPhotoDisplay from './AlbumPhotoDisplay.jsx';
+/* ------------------------------
+Render a single album to the page
+ -calls albumPhotoDisplay
+-------------------------------*/
+
const AlbumDisplay = ({currentAlbum, albums, selectAlbum, currentPhoto}) => {
return (
);
};
diff --git a/public/src/components/albumlist.jsx b/public/src/components/albumlist.jsx
index 3ca6fd4..5140689 100644
--- a/public/src/components/albumlist.jsx
+++ b/public/src/components/albumlist.jsx
@@ -1,6 +1,11 @@
import React from 'react';
import Album from './album.jsx';
+/* ------------------------------
+Render the list of albums from the album state in App.jsx
+ -calls Album.jsx for each album
+-------------------------------*/
+
const AlbumList = ({albums, selectAlbum}) => {
const albumNode = albums.map((album, i) => {
return (
);
diff --git a/public/src/components/app.jsx b/public/src/components/app.jsx
index 6152330..b6abd46 100644
--- a/public/src/components/app.jsx
+++ b/public/src/components/app.jsx
@@ -4,6 +4,12 @@ import AlbumDisplay from './albumdisplay.jsx';
import AlbumList from './albumlist.jsx';
import Album from './album.jsx';
+/* ------------------------------
+Main react App:
+ -holds the states
+ -holds the methods
+-------------------------------*/
+
export default class App extends React.Component {
constructor(props) {
super(props);
@@ -16,12 +22,12 @@ export default class App extends React.Component {
currentAlbumIndex: 5,
currentUser: {
albums: []
- }, // change
- displayUser: {} // change
+ },
+ displayUser: {}
};
}
- addPhoto(photo, albumName, description, newAlbumName) { // pass in album name/id pulled from drop-down selector?
+ addPhoto(photo, albumName, description, newAlbumName) {
var data = new FormData();
data.append('photo', photo, photo.name);
@@ -47,7 +53,6 @@ export default class App extends React.Component {
processData: false,
contentType: false,
success: function(response) {
- console.log('success', response);
this.setState({albums: response.albums, photos: response.photos});
}.bind(this),
error: function(error) {
@@ -58,8 +63,6 @@ export default class App extends React.Component {
selectAlbum(album, photo) {
let photoNum = photo || 0;
- console.log(album);
- console.log(photoNum)
this.setState({currentAlbum: album, currentPhoto: photoNum});
}
@@ -68,9 +71,7 @@ export default class App extends React.Component {
type: 'GET',
url: '/user/' + this.state.currentUser,
success: function(data) {
- console.log(data);
this.setState({albums: data.albums, currentUser: data, displayUser: data});
- console.log(this.state.albums);
}.bind(this),
error: function(err) {
console.error('error', err);
@@ -78,12 +79,7 @@ export default class App extends React.Component {
});
}
- changeAlbum(dir) {
- //dir -1 or 1
- // set.state of current album to next or previous album
- }
-
- renderPage({currentAlbum, albums, selectAlbum, currentPhoto}) {
+ renderPage({currentAlbum, albums, selectAlbum, currentPhoto}) { //logic for whether a single album should display or album list
if (currentAlbum === null) {
return (
);
- //return (
);
} else {
return (
-
-
-*/
diff --git a/public/src/components/navbar.jsx b/public/src/components/navbar.jsx
index 500bf87..1b5c6bd 100644
--- a/public/src/components/navbar.jsx
+++ b/public/src/components/navbar.jsx
@@ -1,7 +1,12 @@
import React from 'react';
-// import Bootstrap from 'bootstrap';
import PhotoForm from './photoform.jsx';
+/* ------------------------------
+Render Navbar to top of page:
+ -uses bootstrap navbar
+ -calls on PhotoForm
+-------------------------------*/
+
const Navbar = ({addPhoto, currentUser}) => {
return (
diff --git a/public/src/components/photo.jsx b/public/src/components/photo.jsx
index c71abd2..2c64291 100644
--- a/public/src/components/photo.jsx
+++ b/public/src/components/photo.jsx
@@ -1,5 +1,9 @@
import React from 'react';
+/* ------------------------------
+renders a single photo currently in use from album.jsx
+-------------------------------*/
+
const Photo = ({photo}) => {
return (
diff --git a/public/src/components/photoform.jsx b/public/src/components/photoform.jsx
index d491179..d0dfd28 100644
--- a/public/src/components/photoform.jsx
+++ b/public/src/components/photoform.jsx
@@ -1,5 +1,10 @@
import React from 'react';
+/* ------------------------------
+Render Photo upload form to dropdown in navbar:
+ -call upon addPhoto method from App.jsx
+-------------------------------*/
+
const PhotoForm = ({addPhoto, currentUser}) => {
let photo;
let name;
@@ -27,11 +32,10 @@ const PhotoForm = ({addPhoto, currentUser}) => {
});
return (
-