Skip to content

Commit

Permalink
Merge pull request #1613 from decentdao/reskin/searchbox-icon-styling
Browse files Browse the repository at this point in the history
`Reskin` search box icon styling
  • Loading branch information
adamgall authored Apr 30, 2024
2 parents 7a3719f + 1733986 commit 913c286
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/ui/menus/DAOSearch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
PopoverTrigger,
useDisclosure,
useOutsideClick,
Icon,
} from '@chakra-ui/react';
import { MagnifyingGlass } from '@phosphor-icons/react';
import React, { useEffect, useRef, useState } from 'react';
Expand All @@ -17,6 +18,7 @@ import { SearchDisplay } from './SearchDisplay';
export function DAOSearch({ closeDrawer }: { closeDrawer?: () => void }) {
const { t } = useTranslation(['dashboard']);
const [localInput, setLocalInput] = useState('');
const [hasFocus, setHasFocus] = useState(false);
const { errorMessage, isLoading, address, isSafe, setSearchString } = useSearchDao();
const { onClose } = useDisclosure(); // popover close function
const ref = useRef() as React.MutableRefObject<HTMLInputElement>;
Expand Down Expand Up @@ -55,15 +57,18 @@ export function DAOSearch({ closeDrawer }: { closeDrawer?: () => void }) {
justifyContent="center"
>
<InputLeftElement>
<MagnifyingGlass
<Icon
as={MagnifyingGlass}
size="1.5rem"
color="var(--chakra-colors-neutral-5)"
color={localInput || hasFocus ? 'white-0' : 'neutral-5'}
/>
</InputLeftElement>
<Input
size="baseAddonLeft"
placeholder={t('searchDAOPlaceholder')}
onChange={e => setLocalInput(e.target.value.trim())}
onFocus={() => setHasFocus(true)}
onBlur={() => setHasFocus(false)}
value={localInput}
data-testid="search-input"
/>
Expand Down

0 comments on commit 913c286

Please sign in to comment.