Feat(Menu): Support multi-platform

Support add multi-platform tool to menu
This commit is contained in:
2024-05-01 18:09:37 +08:00
parent 2f70ae8ced
commit de9d1b4b74
5 changed files with 41 additions and 20 deletions

View File

@@ -12,6 +12,7 @@ interface RepositoryCardProps
toolName: string
toolId: string
ver: string
platform: Platform
options?: TiltOptions
onOpen?: () => void
onEdit?: () => void
@@ -29,6 +30,7 @@ const RepositoryCard = ({
toolName,
toolId,
ver,
platform,
options = {
reverse: true,
max: 8,
@@ -52,7 +54,10 @@ const RepositoryCard = ({
}, [options])
return (
<Draggable id={toolId} data={{ icon, toolName, toolId, authorUsername: '!', ver }}>
<Draggable
id={`!:${toolId}:${ver}:${platform}`}
data={{ icon, toolName, toolId, authorUsername: '!', ver, platform }}
>
<Card
data-component={'component-repository-card'}
style={{ overflow: 'visible', ...style }}

View File

@@ -179,19 +179,26 @@ const StoreCard = ({
)
return
}
navigateToView(navigate, author.username, toolId, platform)
navigateToView(navigate, author.username, toolId, 'DESKTOP')
}
const handleOnWebBtnClick = (e: MouseEvent<HTMLDivElement>) => {
e.stopPropagation()
navigateToView(navigate, author.username, toolId, platform)
navigateToView(navigate, author.username, toolId, 'WEB')
}
return (
<>
<Draggable
id={`${author.username}:${toolId}:${ver}`}
data={{ icon, toolName, toolId, authorUsername: author.username, ver: '' }}
id={`${author.username}:${toolId}:${ver}:${platform}`}
data={{
icon,
toolName,
toolId,
authorUsername: author.username,
ver: '',
platform: platform
}}
>
<Card
data-component={'component-store-card'}