11import colors from './colors' ;
22import * as React from 'react' ;
3+ import { Animate } from 'react-simple-animate' ;
34import { Button , paraGraphDefaultStyle } from './styled' ;
45
56type Props = {
@@ -18,76 +19,89 @@ const FormStateTable = ({
1819 alignSelf : 'end' ,
1920 } }
2021 >
21- { showFormState && (
22- < table
23- style = { {
24- padding : 10 ,
25- display : 'block' ,
26- background : 'black' ,
27- borderTop : `1px solid ${ colors . lightPink } ` ,
28- } }
29- >
30- < tbody >
31- < tr >
32- < td align = "right" style = { { width : 90 , ...paraGraphDefaultStyle } } >
33- Valid:
34- </ td >
35- < td
36- style = { {
37- color : formState . isValid ? colors . green : colors . lightPink ,
38- ...paraGraphDefaultStyle ,
39- } }
40- >
41- { formState . isValid ? 'true' : 'false' }
42- </ td >
43- </ tr >
44- < tr >
45- < td align = "right" style = { { ...paraGraphDefaultStyle } } >
46- Submitted:
47- </ td >
48- < td
49- style = { {
50- color : formState . isSubmitted ? colors . green : colors . lightPink ,
51- ...paraGraphDefaultStyle ,
52- } }
53- >
54- { formState . isSubmitted ? 'true' : 'false' }
55- </ td >
56- </ tr >
57- < tr >
58- < td align = "right" style = { { ...paraGraphDefaultStyle } } >
59- Count:
60- </ td >
61- < td
62- style = { {
63- color : formState . submitCount ? colors . green : colors . lightPink ,
64- ...paraGraphDefaultStyle ,
65- } }
66- >
67- { formState . submitCount }
68- </ td >
69- </ tr >
70- < tr >
71- < td
72- align = "right"
73- style = { {
74- ...paraGraphDefaultStyle ,
75- } }
76- >
77- Submitting:
78- </ td >
79- < td
80- style = { {
81- color : formState . isSubmitting ? colors . green : colors . lightPink ,
82- ...paraGraphDefaultStyle ,
83- } }
84- >
85- { formState . isSubmitting ? 'true' : 'false' }
86- </ td >
87- </ tr >
88- </ tbody >
89- </ table >
90- ) }
22+ < Animate
23+ play = { showFormState }
24+ start = { { opacity : 0 } }
25+ end = { { opacity : 1 } }
26+ render = { ( { style } ) => (
27+ < table
28+ style = { {
29+ padding : '5px 10px' ,
30+ display : 'block' ,
31+ background : 'black' ,
32+ borderTop : `1px solid ${ colors . lightPink } ` ,
33+ pointerEvents : 'none' ,
34+ ...style ,
35+ } }
36+ >
37+ < tbody >
38+ < tr >
39+ < td align = "right" style = { { width : 90 , ...paraGraphDefaultStyle } } >
40+ Valid:
41+ </ td >
42+ < td
43+ style = { {
44+ color : formState . isValid ? colors . green : colors . lightPink ,
45+ ...paraGraphDefaultStyle ,
46+ } }
47+ >
48+ { formState . isValid ? 'true' : 'false' }
49+ </ td >
50+ </ tr >
51+ < tr >
52+ < td align = "right" style = { { ...paraGraphDefaultStyle } } >
53+ Submitted:
54+ </ td >
55+ < td
56+ style = { {
57+ color : formState . isSubmitted
58+ ? colors . green
59+ : colors . lightPink ,
60+ ...paraGraphDefaultStyle ,
61+ } }
62+ >
63+ { formState . isSubmitted ? 'true' : 'false' }
64+ </ td >
65+ </ tr >
66+ < tr >
67+ < td align = "right" style = { { ...paraGraphDefaultStyle } } >
68+ Count:
69+ </ td >
70+ < td
71+ style = { {
72+ color : formState . submitCount
73+ ? colors . green
74+ : colors . lightPink ,
75+ ...paraGraphDefaultStyle ,
76+ } }
77+ >
78+ { formState . submitCount }
79+ </ td >
80+ </ tr >
81+ < tr >
82+ < td
83+ align = "right"
84+ style = { {
85+ ...paraGraphDefaultStyle ,
86+ } }
87+ >
88+ Submitting:
89+ </ td >
90+ < td
91+ style = { {
92+ color : formState . isSubmitting
93+ ? colors . green
94+ : colors . lightPink ,
95+ ...paraGraphDefaultStyle ,
96+ } }
97+ >
98+ { formState . isSubmitting ? 'true' : 'false' }
99+ </ td >
100+ </ tr >
101+ </ tbody >
102+ </ table >
103+ ) }
104+ />
91105 < Button
92106 style = { {
93107 margin : 0 ,
0 commit comments