diff --git a/src/components/SurveyForm/Inputs.js b/src/components/SurveyForm/Inputs.js new file mode 100644 index 000000000..c6221e7b8 --- /dev/null +++ b/src/components/SurveyForm/Inputs.js @@ -0,0 +1,51 @@ +import React from 'react'; + +const styles = require('./SurveyForm.scss'); + +const flags = (field) => +
+ {field.dirty && D} + {field.active && A} + {field.visited && V} + {field.touched && T} +
; + + +export const input = (field, label, asyncValidating, showAsyncValidating) => +
+ +
+ {showAsyncValidating && asyncValidating && } + + {field.error && field.touched &&
{field.error}
} + {flags(field)} +
+
; + +export const textArea = (field, label, asyncValidating, showAsyncValidating) => +
+ +
+ {showAsyncValidating && asyncValidating && } +