A new Component and Container is introduced: Modal. It dispatches an UNSELECT_ALBUM action when clicked on. Some CSS is added to bur out the background and display the modal content properly.
14 lines
410 B
JavaScript
14 lines
410 B
JavaScript
import React from 'react';
|
|
import { connect } from 'react-redux';
|
|
import Modal from '../components/modal';
|
|
import { unselectAlbum } from '../actions';
|
|
|
|
const mapStateToProps = state => ({
|
|
...state.selectedAlbum,
|
|
});
|
|
|
|
const mapDispatchToProps = dispatch => ({
|
|
handleOnClick: album => dispatch(unselectAlbum(album)),
|
|
});
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(Modal);
|