Feat/use searchparams as state (#2554)

Co-authored-by: crazywoola <427733928@qq.com>
This commit is contained in:
Rozstone 2024-02-26 12:52:59 +08:00 • committed by GitHub
commit d93288f711
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 58 additions and 9 deletions

View file

@ -11,6 +11,7 @@ import { fetchAppList } from '@/service/apps'
import { useAppContext } from '@/context/app-context'
import { NEED_REFRESH_APP_LIST_KEY } from '@/config'
import { CheckModal } from '@/hooks/use-pay'
import { useTabSearchParams } from '@/hooks/use-tab-searchparams'
import TabSlider from '@/app/components/base/tab-slider'
import { SearchLg } from '@/app/components/base/icons/src/vender/line/general'
import { XCircle } from '@/app/components/base/icons/src/vender/solid/general'
@ -35,7 +36,9 @@ const getKey = (
const Apps = () => {
const { t } = useTranslation()
const { isCurrentWorkspaceManager } = useAppContext()
const [activeTab, setActiveTab] = useState('all')
const [activeTab, setActiveTab] = useTabSearchParams({
defaultTab: 'all',
})
const [keywords, setKeywords] = useState('')
const [searchKeywords, setSearchKeywords] = useState('')