Skip to content

Commit

Permalink
Remove recompose from AlbumListComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
nukeop committed Oct 25, 2023
1 parent 713d00f commit 69d6408
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
19 changes: 9 additions & 10 deletions packages/app/app/components/AlbumList/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import React from 'react';
import {compose, withHandlers} from 'recompose';
import {AlbumGrid} from '@nuclear/ui';

const AlbumListComponent = props => <AlbumGrid {...props} autoSize/>;
export default compose(
withHandlers({
onAlbumClick: ({albumInfoSearch, history}) => (album) => {
albumInfoSearch(album.id, album.type, album);
history.push('/album/' + album.id);
}
})
)(AlbumListComponent);
const AlbumListComponent = props => {
const onAlbumClick = (album) => {
props.albumInfoSearch(album.id, album.type, album);
props.history.push('/album/' + album.id);
};

return <AlbumGrid {...props} onAlbumClick={onAlbumClick} autoSize />;
};
export default AlbumListComponent;
4 changes: 2 additions & 2 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start": "webpack-dev-server --env NODE_ENV=development",
"build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 webpack --progress --env NODE_ENV=production",
"test": "cross-env TZ=GMT jest --silent",
"coverage": "cross-env TZ=GMT jest --coverage",
"coverage": "cross-env TZ=GMT jest --coverage --silent",
"lint": "eslint \"{app,test}/**/**.{js,jsx,ts,tsx}\"",
"lint:fix": "eslint \"{app,test}/**/**.{js,jsx,ts,tsx}\" --fix",
"i18n": "sync-i18n --files 'app/locales/*.json' --primary en --languages fr tl nl de dk es pl zh ru tr id sk ko zh_tw se gr hr is --space 2"
Expand Down Expand Up @@ -131,4 +131,4 @@
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.7.4"
}
}
}

0 comments on commit 69d6408

Please sign in to comment.