-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: move collection items to functional components (#3116)
- Loading branch information
Melisa Anabella Rossi
authored
Jun 7, 2024
1 parent
711ed86
commit d6d9547
Showing
32 changed files
with
501 additions
and
610 deletions.
There are no files selected for viewing
9 changes: 2 additions & 7 deletions
9
src/components/CollectionsPage/CollectionRow/CollectionRow.container.ts
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 |
---|---|---|
@@ -1,16 +1,11 @@ | ||
import { connect } from 'react-redux' | ||
import { push } from 'connected-react-router' | ||
import { RootState } from 'modules/common/types' | ||
import { getCollectionItemCount } from 'modules/collection/selectors' | ||
import { OwnProps, MapStateProps, MapDispatchProps, MapDispatch } from './CollectionRow.types' | ||
import { OwnProps, MapStateProps } from './CollectionRow.types' | ||
import CollectionRow from './CollectionRow' | ||
|
||
const mapState = (state: RootState, ownProps: OwnProps): MapStateProps => ({ | ||
itemCount: getCollectionItemCount(state, ownProps.collection.id) | ||
}) | ||
|
||
const mapDispatch = (dispatch: MapDispatch): MapDispatchProps => ({ | ||
onNavigate: path => dispatch(push(path)) | ||
}) | ||
|
||
export default connect(mapState, mapDispatch)(CollectionRow) | ||
export default connect(mapState)(CollectionRow) |
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
5 changes: 0 additions & 5 deletions
5
src/components/CollectionsPage/CollectionRow/CollectionRow.types.ts
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 |
---|---|---|
@@ -1,14 +1,9 @@ | ||
import { Dispatch } from 'redux' | ||
import { CallHistoryMethodAction } from 'connected-react-router' | ||
import { Collection } from 'modules/collection/types' | ||
|
||
export type Props = { | ||
collection: Collection | ||
itemCount: number | ||
onNavigate: (path: string) => void | ||
} | ||
|
||
export type MapStateProps = Pick<Props, 'itemCount'> | ||
export type MapDispatchProps = Pick<Props, 'onNavigate'> | ||
export type MapDispatch = Dispatch<CallHistoryMethodAction> | ||
export type OwnProps = Pick<Props, 'collection'> |
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
Oops, something went wrong.