mirror of
https://github.com/langgenius/dify.git
synced 2026-06-07 16:32:01 +08:00
chore: unified plugin status icon position (#36816)
This commit is contained in:
parent
c530a5d272
commit
24715a9570
@ -121,7 +121,7 @@ describe('PluginItem', () => {
|
||||
plugin={createPlugin({ icon: '' })}
|
||||
getIconUrl={mockGetIconUrl}
|
||||
language="en_US"
|
||||
statusIcon={<span />}
|
||||
statusIcon={<span data-testid="status-icon" />}
|
||||
statusText="status"
|
||||
/>,
|
||||
)
|
||||
@ -129,6 +129,7 @@ describe('PluginItem', () => {
|
||||
expect(mockGetIconUrl).not.toHaveBeenCalled()
|
||||
expect(screen.queryByTestId('card-icon')).not.toBeInTheDocument()
|
||||
expect(container.querySelector('[data-testid="magic-box-icon"]')).toHaveClass('size-8', 'text-text-tertiary')
|
||||
expect(screen.getByTestId('status-icon').parentElement).toHaveClass('absolute', '-bottom-0.5', '-right-0.5', 'z-10')
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import type { FC, ReactNode } from 'react'
|
||||
import type { PluginStatus } from '@/app/components/plugins/types'
|
||||
import type { Locale } from '@/i18n-config'
|
||||
import { cn } from '@langgenius/dify-ui/cn'
|
||||
import { MagicBox } from '@/app/components/base/icons/src/vender/solid/mediaAndDevices'
|
||||
import CardIcon from '@/app/components/plugins/card/base/card-icon'
|
||||
|
||||
@ -40,11 +39,7 @@ const PluginItem: FC<PluginItemProps> = ({
|
||||
)
|
||||
// eslint-disable-next-line hyoban/prefer-tailwind-icons -- Reuse the same MagicBox component as the marketplace install button.
|
||||
: <MagicBox className="size-8 text-text-tertiary" />}
|
||||
<div className={cn(
|
||||
'absolute z-10',
|
||||
hasPluginIcon ? '-right-0.5 -bottom-0.5' : '-right-1 -bottom-1',
|
||||
)}
|
||||
>
|
||||
<div className="absolute -right-0.5 -bottom-0.5 z-10">
|
||||
{statusIcon}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user