diff --git a/src/components/SearchRevamp.js b/src/components/SearchRevamp.js index 929f293..960e488 100644 --- a/src/components/SearchRevamp.js +++ b/src/components/SearchRevamp.js @@ -3,7 +3,6 @@ import React, { useState } from 'react'; import type { Node } from 'react'; import styled from 'styled-components'; -import closeIcon from '../assets/close-icon-revamp.svg'; import searchIcon from '../assets/search-icon.svg'; const Form = styled.form` @@ -11,31 +10,30 @@ const Form = styled.form` position: relative; margin-right: 1px; `; -const SearchInput = styled.input` - height: 40px; - background-color: #fff; - display: block; - font-size: 14px; - line-height: 22px; - color: #2b2c32; - line-height: 1.3; - padding: 9px 16px 9px 38px; - width: 322px; - margin: 0; - border: 1px solid #a7afc0; - border-radius: 8px; - -moz-appearance: none; - -webkit-appearance: none; - appearance: none; - outline: none; - ::placeholder { - color: #6b7384; - } +const SearchInput = styled('input')(({ isDark }) => ({ + height: '40px', + backgroundColor:isDark ? 'transparent': '#fff', + display: 'block', + fontSize: '14px', + lineHeight: '1.3', // Adjusted to match the duplicate property + color:isDark ? '#E1E6F5' : '#2b2c32', + padding: '9px 16px 9px 38px', + width: '322px', + margin: 0, + border: '1px solid #a7afc0', + borderRadius: '8px', + MozAppearance: 'none', + WebkitAppearance: 'none', + appearance: 'none', + outline: 'none', + '::placeholder': { + color: '#6b7384', + }, + ':focus': { + outline: '1px solid #242838', + }, +})); - :focus { - outline: 1px solid #242838; - } -`; const SearchBtn = styled.button` position: absolute; top: 50%; @@ -51,26 +49,32 @@ const SearchBtn = styled.button` cursor: pointer; `; -const ClearBtn = styled.button` - position: absolute; - top: 50%; - right: 0px; - transform: translateY(-50%); - padding: 0px 8px; - background: transparent; - outline: none; - border: none; - display: flex; - align-items: center; - justify-content: center; - cursor: pointer; -`; +const ClearBtn = styled('div')(() => ({ + position: 'absolute', + top: '50%', + right: '0px', + transform: 'translateY(-50%)', + padding: '0px 8px', + background: 'transparent', + outline: 'none', + border: 'none', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + cursor: 'pointer', + '& svg': { + '& path': { + fill: '#7C85A3', + }, + }, +})); type Props = {| filter: Function, + isDark?: boolean, |}; -const SearchRevamp = ({ filter }: Props): Node => { +const SearchRevamp = ({ filter,isDark }: Props): Node => { const [prevSearch, setPrevSearch] = useState(''); const [searchValue, setSearchValue] = useState(''); @@ -98,6 +102,7 @@ const SearchRevamp = ({ filter }: Props): Node => { onChange={handleSearchInputChanges} placeholder="Search stake pool" type="text" + isDark={isDark} /> {searchValue.length > 0 && { callSearchFunction(e); }} > - Clear Input + + + } diff --git a/src/components/SortSelect.js b/src/components/SortSelect.js index 3133a1f..5251cb7 100644 --- a/src/components/SortSelect.js +++ b/src/components/SortSelect.js @@ -20,31 +20,31 @@ const WrapperSelectInput = styled.div` } `; -const SelectInput = styled.select` - height: 40px; - display: block; - font-size: 14px; - line-height: 22px; - color: #2b2c32; - line-height: 1.3; - padding: 0.6em 1.4em 0.5em 0.8em; - width: 322px; - margin: 0; - border: none; - border-radius: 8px; - -moz-appearance: none; - -webkit-appearance: none; - appearance: none; - background-color: #f0f3f5; - background-image: url(${arrowDownIcon}); - background-repeat: no-repeat, repeat; - background-position: right 0.7em top 50%, 0 0; - background-size: 24px auto, 100%; -`; +const SelectInput = styled('select')(({ isDark }) => ({ + height: '40px', + display: 'block', + fontSize: '14px', + lineHeight: '1.3', // Adjusted to match the duplicate property + color:isDark ? '#7C85A3' :'#2b2c32', + padding: '0.6em 1.4em 0.5em 0.8em', + width: '322px', + margin: 0, + border:isDark ? '1px solid #a7afc0' : 'none', + borderRadius: '8px', + MozAppearance: 'none', + WebkitAppearance: 'none', + appearance: 'none', + backgroundColor: isDark ? 'transparent' : '#f0f3f5', + backgroundImage: `url(${arrowDownIcon})`, + backgroundRepeat: 'no-repeat, repeat', + backgroundPosition: 'right 0.7em top 50%, 0 0', + backgroundSize: '24px auto, 100%', +})); type Props = {| filter: Function, isRevamp?: boolean, + isDark?: boolean, |}; export const sortingSelectData = [ @@ -63,7 +63,7 @@ export const sortingSelectDataRevamp = [ { label: 'Blocks', value: Sorting.BLOCKS }, ]; -function SortSelect({ filter, isRevamp = true }: Props): React$Node { +function SortSelect({ filter, isRevamp = true, isDark }: Props): React$Node { const [selectValue, setSelectValue] = React.useState('score'); const handleChange = (e) => { @@ -74,7 +74,7 @@ function SortSelect({ filter, isRevamp = true }: Props): React$Node { return ( - + {(isRevamp ? sortingSelectDataRevamp : sortingSelectData).map(({ value, label }) => (