feat: displaying the tool description when clicking on a custom tool (#2642)

This commit is contained in:
Joel
2024-03-01 17:58:38 +08:00
committed by GitHub
parent 1a677da792
commit fa8ab2134f
4 changed files with 53 additions and 22 deletions

View File

@@ -69,9 +69,22 @@ const Tools: FC<Props> = ({
})()
const [query, setQuery] = useState('')
const [collectionType, setCollectionType] = useTabSearchParams({
const [toolPageCollectionType, setToolPageCollectionType] = useTabSearchParams({
defaultTab: collectionTypeOptions[0].value,
})
const [appPageCollectionType, setAppPageCollectionType] = useState(collectionTypeOptions[0].value)
const { collectionType, setCollectionType } = (() => {
if (isInToolsPage) {
return {
collectionType: toolPageCollectionType,
setCollectionType: setToolPageCollectionType,
}
}
return {
collectionType: appPageCollectionType,
setCollectionType: setAppPageCollectionType,
}
})()
const showCollectionList = (() => {
let typeFilteredList: Collection[] = []

View File

@@ -63,7 +63,7 @@ const Item: FC<Props> = ({
)}
</div>
</div>
{showDetail && isBuiltIn && (
{showDetail && (
<SettingBuiltInTool
collection={collection}
toolName={payload.name}
@@ -71,6 +71,7 @@ const Item: FC<Props> = ({
onHide={() => {
setShowDetail(false)
}}
isBuiltIn={isBuiltIn}
/>
)}
</>