about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/list_editor/containers/search_container.js
blob: 5af20efbd6c4534edede2049e2bb0919d0e06ee1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import React from 'react';
import { connect } from 'react-redux';
import { injectIntl } from 'react-intl';
import { fetchListSuggestions, clearListSuggestions, changeListSuggestions } from '../../../actions/lists';
import Search from '../components/search';

const mapStateToProps = state => ({
  value: state.getIn(['listEditor', 'suggestions', 'value']),
});

const mapDispatchToProps = dispatch => ({
  onSubmit: value => dispatch(fetchListSuggestions(value)),
  onClear: () => dispatch(clearListSuggestions()),
  onChange: value => dispatch(changeListSuggestions(value)),
});

export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(Search));