diff --git a/src/assets/images/arrowDown.svg b/src/assets/images/arrowDown.svg new file mode 100644 index 0000000..e14c152 --- /dev/null +++ b/src/assets/images/arrowDown.svg @@ -0,0 +1,3 @@ + diff --git a/src/assets/images/filter.svg b/src/assets/images/filter.svg new file mode 100644 index 0000000..36eb771 --- /dev/null +++ b/src/assets/images/filter.svg @@ -0,0 +1,5 @@ + diff --git a/src/assets/images/search.svg b/src/assets/images/search.svg new file mode 100644 index 0000000..a3ad346 --- /dev/null +++ b/src/assets/images/search.svg @@ -0,0 +1,3 @@ + diff --git a/src/components/Filter.tsx b/src/components/Filter.tsx new file mode 100644 index 0000000..dbc1f3b --- /dev/null +++ b/src/components/Filter.tsx @@ -0,0 +1,22 @@ +import styled from 'styled-components' +import { Colors } from '../constants/styles' +import filterIcon from '../assets/images/filter.svg' +import arrowDownIcon from '../assets/images/arrowDown.svg' + +export const Filter = styled.select` + width: 175px; + padding: 2px 10px 2px 30px; + font-weight: 500; + font-size: 15px; + line-height: 22px; + color: ${Colors.VioletDark}; + border: 1px solid #e6ecf0; + border-radius: 14px; + appearance: none; + background: url(${filterIcon}) no-repeat 5px center, url(${arrowDownIcon}) no-repeat right 10px center; + outline: none; + + &:focus { + border: 1px solid ${Colors.Violet}; + } +` diff --git a/src/components/Input.tsx b/src/components/Input.tsx new file mode 100644 index 0000000..a8a4deb --- /dev/null +++ b/src/components/Input.tsx @@ -0,0 +1,33 @@ +import styled from 'styled-components' +import { Colors } from '../constants/styles' +import searchIcon from '../assets/images/search.svg' + +export const Input = styled.input` + max-width: 420px; + padding: 11px 20px; + background: ${Colors.GrayBorder}; + color: ${Colors.Black}; + border-radius: 8px; + border: 1px solid ${Colors.GrayBorder}; + outline: none; + + &:active, + &:focus { + border: 1px solid ${Colors.Violet}; + caret-color: ${Colors.Violet}; + } +` + +export const Search = styled(Input)` + width: 270px; + padding: 7px 36px; + background-image: url(${searchIcon}); + background-size: 24px 24px; + background-repeat: no-repeat; + background-position: center left 10px; + + &::placeholder { + font-size: 15px; + line-height: 22px; + } +` diff --git a/src/components/PageBar.tsx b/src/components/PageBar.tsx new file mode 100644 index 0000000..a746a52 --- /dev/null +++ b/src/components/PageBar.tsx @@ -0,0 +1,7 @@ +import styled from 'styled-components' + +export const PageBar = styled.div` + display: flex; + justify-content: space-between; + margin: 0 20px; +` diff --git a/src/components/votes/VotingCards.tsx b/src/components/votes/VotingCards.tsx index b9bc114..351da43 100644 --- a/src/components/votes/VotingCards.tsx +++ b/src/components/votes/VotingCards.tsx @@ -3,6 +3,9 @@ import { Card, CardCommunity, CardVote } from '../Card' import { getCommunitiesUnderVote } from '../../helpers/apiMock' import { CommunityDetail, VotingSortingEnum } from '../../models/community' import styled from 'styled-components' +import { Filter } from '../Filter' +import { Search } from '../Input' +import { PageBar } from '../PageBar' export function VotingCards() { const [searchField, setSearchField] = useState('') @@ -49,16 +52,24 @@ export function VotingCards() { return (