This repository was archived by the owner on Mar 17, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathSearch.tsx
More file actions
66 lines (60 loc) · 1.31 KB
/
Search.tsx
File metadata and controls
66 lines (60 loc) · 1.31 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import styled from '@emotion/styled'
import React from 'react'
import searchIcon from '../assets/icons/search-logo.png'
function Search({ searchQuery, setSearchQuery, handleDogSearch }) {
const handleSearch = (e) => {
setSearchQuery(e.target.value)
}
return (
<SearchContainer>
<Input
type="text"
placeholder="Search for a dog"
value={searchQuery}
onChange={handleSearch}
/>
<Button onClick={handleDogSearch}>
<Img src={searchIcon} alt="searchlogo" />
Search
</Button>
</SearchContainer>
)
}
const SearchContainer = styled.div({
width: '780px',
display: 'flex',
justifyContent: 'space-between',
marginTop: '20px',
})
const Input = styled.input({
width: '100%',
background: '#F7F7F7',
height: '36px',
fontSize: '18px',
padding: '25px',
borderRadius: '4px',
border: 'none',
outline: 'none',
})
const Button = styled.button({
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
width: '200px',
background: '#0794E3',
fontSize: '18px',
color: '#fff',
height: '36px',
padding: '25px',
borderRadius: '4px',
border: 'none',
outline: 'none',
cursor: 'pointer',
})
const Img = styled.img({
width: '25px',
height: '25px',
color: '#fff',
marginRight: '20px',
})
export default Search