File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed
components/collections-overview Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import './collection.styles.scss'
66
77function CollectionPage ( { match, collection } ) {
88 const { title, items } = collection
9+ console . log ( match . params )
910 return (
1011 < div className = "collection-page" >
1112 < h2 className = "title" > { title } </ h2 >
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import React from 'react'
22import { connect } from "react-redux" ;
33import { createStructuredSelector } from "reselect" ;
44import './collections-overview.styles.scss'
5- import { selectCollections } from "../../redux/shop/shop.selector" ;
5+ import { selectCollectionsForPreview } from "../../redux/shop/shop.selector" ;
66import CollectionPreview from "../collection-preview/Collection-preview.component" ;
77
88function CollectionsOverview ( { collections } ) {
@@ -19,6 +19,6 @@ function CollectionsOverview({ collections }) {
1919
2020
2121const mapStatetoProps = createStructuredSelector ( {
22- collections : selectCollections
22+ collections : selectCollectionsForPreview
2323} )
2424export default connect ( mapStatetoProps ) ( CollectionsOverview )
Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ export const selectCollections = createSelector(
77 shop => shop . collections
88)
99
10+ export const selectCollectionsForPreview = createSelector (
11+ [ selectCollections ] ,
12+ collections => Object . keys ( collections ) . map ( key => collections [ key ] )
13+ )
14+
1015export const selectCollection = collectionUrlParam =>
1116 createSelector (
1217 [ selectCollections ] ,
You can’t perform that action at this time.
0 commit comments