Skip to content

Commit 2d2e1b7

Browse files
committed
albums show up.. Need to be formatted and fetched from server.
1 parent 0d6390f commit 2d2e1b7

3 files changed

Lines changed: 6 additions & 11 deletions

File tree

src/components/album/album-gallery.jsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@ import map from 'lodash/map'
55
import Container from 'react-bootstrap/Container'
66
import Album from './album.jsx'
77

8-
const AlbumGallery = gallery => {
9-
console.info('gallery')
10-
8+
const AlbumGallery = ({ gallery }) => {
119
return (
1210
<div className="album-gallery">
1311
<h3>Albums</h3>
1412
<Container>
15-
{!isEmpty(gallery) && map(gallery, album => <Album key={album.name} name={album.name} />)}
16-
<Album create />
13+
{!isEmpty(gallery) && map(gallery, (album, index) => <Album key={index} name={album.name} />)}
14+
<Album key="new" create />
1715
</Container>
1816
</div>
1917
)

src/components/album/album.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import React from 'react'
22

33
const Album = ({ create, name }) => {
4-
console.info('Console name: ', name)
5-
64
const getAlbumName = () => {
75
console.info('get name')
86
}

src/containers/pages/home-page.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ import AlbumGallery from '../../components/album/album-gallery'
55
import PhotoCard from '../../components/photo/photo-card'
66

77
const HomePage = ({ albums }) => {
8+
console.info(albums)
9+
810
return (
911
<div>
1012
<h2>Home Page</h2>
1113

12-
<br />
13-
<br />
14-
<br />
1514
<PhotoCard title="Photo Title" description="This is some text" />
1615

1716
<AlbumGallery gallery={albums} />
@@ -21,7 +20,7 @@ const HomePage = ({ albums }) => {
2120

2221
const mapStateToProps = state => {
2322
return {
24-
albums: () => getAlbumList(state),
23+
albums: getAlbumList(state),
2524
}
2625
}
2726

0 commit comments

Comments
 (0)