File Editor
Directories:
.. (Back)
__tests__
action-buttons
action-dashboard
availability
capacity-table
container
controls
dashboard
header-image
settings-dashboard
Files:
container.js
index.js
template.js
Create New File
Create
Edit File: container.js
/** * External dependencies */ import { connect } from 'react-redux'; import { compose } from 'redux'; /** * Internal dependencies */ import Template from './template'; import { withStore } from '@moderntribe/common/hoc'; import withSaveData from '@moderntribe/tickets/blocks/hoc/with-save-data'; import { actions, selectors } from '@moderntribe/tickets/data/blocks/ticket'; import { hasRecurrenceRules, noTicketsOnRecurring } from '@moderntribe/common/utils/recurrence'; const mapStateToProps = ( state ) => { const headerImageId = selectors.getTicketsHeaderImageId( state ); return { header: headerImageId ? `${ headerImageId }` : '', hasProviders: selectors.hasTicketProviders(), isSettingsOpen: selectors.getTicketsIsSettingsOpen( state ), provider: selectors.getTicketsProvider( state ), sharedCapacity: selectors.getTicketsSharedCapacity( state ), canCreateTickets: selectors.canCreateTickets(), hasRecurrenceRules: hasRecurrenceRules( state ), noTicketsOnRecurring: noTicketsOnRecurring(), }; }; const mapDispatchToProps = ( dispatch ) => ( { setInitialState: ( props ) => { dispatch( actions.setTicketsInitialState( props ) ); }, onBlockUpdate: ( isSelected ) => { dispatch( actions.setTicketsIsSelected( isSelected ) ); }, onBlockRemoved: () => { dispatch( actions.resetTicketsBlock() ); }, } ); export default compose( withStore(), connect( mapStateToProps, mapDispatchToProps ), withSaveData(), )( Template );
Save Changes
Rename File
Rename