fix: rework wallet screen

This commit is contained in:
Taranto 2020-04-07 19:03:18 +01:00 committed by Josh Harvey
parent 1f7ae74b42
commit 1f6d272aa0
103 changed files with 2094 additions and 3892 deletions

View file

@ -1,11 +1,17 @@
import { useFormikContext } from 'formik'
import * as R from 'ramda'
import React from 'react'
import { Autocomplete } from '../base'
const AutocompleteFormik = props => {
const AutocompleteFormik = ({ options, ...props }) => {
const { name, onBlur, value } = props.field
const { touched, errors, setFieldValue } = props.form
const error = !!(touched[name] && errors[name])
const { initialValues } = useFormikContext()
const iOptions =
R.type(options) === 'Function' ? options(initialValues) : options
return (
<Autocomplete
@ -14,6 +20,7 @@ const AutocompleteFormik = props => {
onBlur={onBlur}
value={value}
error={error}
options={iOptions}
{...props}
/>
)