2
2
import React , { useEffect , useState , useRef } from 'react'
3
3
import Select , { components } from 'react-select'
4
4
import throttle from 'lodash.throttle'
5
- import styles from './Autocomplete.module.css'
6
5
7
6
// Internal Dependencies
8
7
import { postAutocompleteAddress } from './api'
@@ -11,12 +10,49 @@ const LOB_LABEL = 'lob-label'
11
10
const LOB_URL =
12
11
'https://www.lob.com/address-verification?utm_source=autocomplete&utm_medium=react'
13
12
14
- const LobLogo = ( { className } ) => {
13
+ const lobGrayText = {
14
+ color : '#888' ,
15
+ textDecoration : 'inherit'
16
+ }
17
+
18
+ const lobLabel = {
19
+ alignItems : 'center' ,
20
+ borderBottom : '1px solid #DDDDDD' ,
21
+ cursor : 'pointer' ,
22
+ display : 'flex' ,
23
+ fontSize : '17px' ,
24
+ padding : '16px' ,
25
+ pointerEvents : 'none'
26
+ }
27
+
28
+ const lobLabelLink = {
29
+ fontWeight : 600 ,
30
+ color : '#0699D6' ,
31
+ textDecoration : 'inherit'
32
+ }
33
+
34
+ const lobLabelText = {
35
+ flex : 1 ,
36
+ fontWeight : 400 ,
37
+ marginLeft : '12px'
38
+ }
39
+
40
+ const lobLogo = {
41
+ height : '.9em' ,
42
+ marginLeft : '1px' ,
43
+ marginTop : '3px'
44
+ }
45
+
46
+ const logoLarge = {
47
+ height : '21px'
48
+ }
49
+
50
+ const LobLogo = ( { style } ) => {
15
51
return (
16
52
< svg
17
53
xmlns = 'http://www.w3.org/2000/svg'
18
54
viewBox = '0 0 1259 602'
19
- className = { className }
55
+ style = { style }
20
56
>
21
57
< path
22
58
fill = '#0099d7'
@@ -28,17 +64,21 @@ const LobLogo = ({ className }) => {
28
64
}
29
65
30
66
const poweredByLob = ( ) => (
31
- < a href = { LOB_URL } className = { styles . lobGrayText } >
67
+ < a href = { LOB_URL } style = { lobGrayText } >
32
68
< span style = { { verticalAlign : 'top' } } > Powered by </ span >
33
- < LobLogo className = { styles . lobLogo } />
69
+ < LobLogo style = { lobLogo } />
34
70
</ a >
35
71
)
36
72
37
73
const getLobLabel = ( ) => (
38
- < div className = { styles . lobLabel } >
39
- < LobLogo className = { styles . logoLarge } />
40
- < span className = { styles . lobGrayText } > Deliverable addresses</ span >
41
- < a href = { LOB_URL } > Learn more</ a >
74
+ < div style = { lobLabel } >
75
+ < LobLogo style = { logoLarge } />
76
+ < span style = { { ...lobGrayText , ...lobLabelText } } >
77
+ Deliverable addresses
78
+ </ span >
79
+ < a style = { lobLabelLink } href = { LOB_URL } >
80
+ Learn more
81
+ </ a >
42
82
</ div >
43
83
)
44
84
@@ -76,7 +116,7 @@ const getOptionElement = (suggestion, inputValue) => {
76
116
return (
77
117
< span >
78
118
{ primaryLineElement }
79
- < span className = { styles . lobGrayText } >
119
+ < span style = { lobGrayText } >
80
120
{ city } , { state . toUpperCase ( ) } , { zip_code }
81
121
</ span >
82
122
</ span >
0 commit comments