-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathheader.tsx
More file actions
52 lines (47 loc) · 1.07 KB
/
header.tsx
File metadata and controls
52 lines (47 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import * as React from 'react';
import { Control, useFormState } from 'react-hook-form';
import colors from './colors';
import { CircleButton, paraGraphDefaultStyle } from './styled';
type Props = {
setVisible: any;
control: Control;
};
const Header = ({ setVisible, control }: Props) => {
const { isValid } = useFormState({
control,
});
return (
<header
style={{
display: 'flex',
alignItems: 'center',
paddingLeft: 10,
backgroundColor: 'transparent',
}}
>
<p
style={{
...paraGraphDefaultStyle,
margin: 0,
padding: 0,
fontWeight: 400,
fontSize: 12,
}}
>
<span
style={{
transition: '0.5s all',
color: isValid ? colors.green : colors.lightPink,
}}
>
■
</span>{' '}
React Hook Form
</p>
<CircleButton type="button" title="Close dev panel" onClick={() => setVisible(false)}>
✕
</CircleButton>
</header>
);
};
export default Header;