[ABANDONED] React/Redux front end for the Flexor social network.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

24 lines
737 B

import { Dispatch } from 'redux'
import { connect } from 'react-redux'
import { setFieldValue } from 'src/actions/forms'
import { getFieldValue, getFieldNotification } from 'src/selectors/forms'
import { AppState } from 'src/types'
import TextareaField, { Props } from './textarea-field'
const mapStateToProps = (state: AppState, ownProps: Props) => ({
value: getFieldValue<string>(state, ownProps.name, ''),
notification: getFieldNotification(state, ownProps.name),
})
const mapDispatchToProps = (dispatch: Dispatch, ownProps: Props) => ({
setValue: (value: string) => {
dispatch(setFieldValue(ownProps.name, value))
}
})
export default connect(
mapStateToProps,
mapDispatchToProps
)(TextareaField)