fix: fix misc. bugs

This commit is contained in:
jinhojang6 2024-10-16 02:39:51 +09:00
parent e6936593a6
commit be664bedaf
No known key found for this signature in database
GPG Key ID: 1762F21FE8B543F8
3 changed files with 11 additions and 4 deletions

View File

@ -30,11 +30,14 @@ const Dropdown: React.FC<DropdownProps> = ({
const dropdownRef = useRef<HTMLDivElement>(null)
const state = useHookstate(globalState)
const defualtState = state.get()
useEffect(() => {
if (defualtState[filterType]?.length === selectedOptions?.length) {
setUpdated(false)
} else {
setUpdated(true)
}
}, [defualtState, selectedOptions])

View File

@ -12,6 +12,10 @@ const Button = styled.button`
border: 1px solid rgb(var(--lsd-border-primary));
background: transparent;
cursor: pointer;
@media (min-width: ${breakpoints.sm}px) {
display: none;
}
`
const HamburguerMenuContainer = styled.div`

View File

@ -3,7 +3,7 @@ import { OperatorGrid } from '@/components/Explore/OperatorGrid'
import { defaultFilterState } from '@/states/filterState'
import styled from '@emotion/styled'
import { hookstate, useHookstate } from '@hookstate/core'
import React, { useMemo } from 'react'
import React, { useCallback, useMemo } from 'react'
import useGetOperators from '../../../apis/operators/useGetOperators'
import {
ARCHETYPE,
@ -53,9 +53,9 @@ const ExploreSection: React.FC<ExploreSectionProps> = () => {
state[filterType].set(selectedOptions)
}
const handleResetAll = () => {
state.set(defaultFilterState)
}
const handleResetAll = useCallback(() => {
state.set(JSON.parse(JSON.stringify(defaultFilterState)))
}, [filter])
return (
<Container>