Feat(Menu): Support multi-platform
Support add multi-platform tool to menu
This commit is contained in:
@@ -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 }}
|
||||
|
||||
@@ -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'}
|
||||
|
||||
Reference in New Issue
Block a user