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.
26 lines
664 B
26 lines
664 B
import { FocusEventHandler } from 'react'
|
|
import { connect } from 'react-redux'
|
|
|
|
import { checkGroupAvailability } from 'src/actions/registration'
|
|
import { AppThunkDispatch } from 'src/types'
|
|
|
|
import CreateGroupForm from './create-group-form'
|
|
|
|
const mapDispatchToProps = (dispatch: AppThunkDispatch) => {
|
|
const checkAvailability: FocusEventHandler<HTMLInputElement> = event => {
|
|
const value = event.target.value
|
|
|
|
if (value.length > 3) {
|
|
dispatch(checkGroupAvailability(event.target.value))
|
|
}
|
|
}
|
|
|
|
return {
|
|
checkAvailability,
|
|
}
|
|
}
|
|
|
|
export default connect(
|
|
null,
|
|
mapDispatchToProps
|
|
)(CreateGroupForm)
|