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
commit fa8ab2134f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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}
/>
)}
</>