fix: broken Checkmark image for Mobile NFT Sort dropdown (#7401)

fix broken image
This commit is contained in:
Charles Bachmeier 2023-10-10 10:02:21 -07:00 committed by GitHub
parent 27ec2e018c
commit 04bf075826
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,8 +1,15 @@
import { Box } from 'nft/components/Box'
import { FilterDropdown, FilterItem } from 'nft/components/collection/MarketplaceSelect'
import { useCollectionFilters } from 'nft/hooks'
import { DropDownOption } from 'nft/types'
import { useState } from 'react'
import { Check } from 'react-feather'
import styled from 'styled-components'
const CheckIcon = styled(Check)`
height: 20px;
width: 20px;
color: ${({ theme }) => theme.accent1};
`
export const FilterSortDropdown = ({ sortDropDownOptions }: { sortDropDownOptions: DropDownOption[] }) => {
const [isOpen, setOpen] = useState(false)
@ -24,19 +31,7 @@ const SortByItem = ({
parentOnClick: React.MouseEventHandler<HTMLElement>
}) => {
const sortBy = useCollectionFilters((state) => state.sortBy)
const checkMark =
dropDownOption.sortBy !== undefined && sortBy === dropDownOption.sortBy ? (
<Box
as="img"
alt={dropDownOption.displayText}
width="20"
height="20"
objectFit="cover"
src="/nft/svgs/checkmark.svg"
/>
) : (
<></>
)
const checkMark = dropDownOption.sortBy !== undefined && sortBy === dropDownOption.sortBy ? <CheckIcon /> : <></>
const onClick: React.MouseEventHandler<HTMLElement> = (e) => {
e.preventDefault()
parentOnClick(e)