优化编辑资源标签样式
This commit is contained in:
@@ -151,7 +151,7 @@ export default function ResourceEdit({ children, id, onRefresh }: ResourceEditPr
|
|||||||
<Label htmlFor="admin-web-resource-add-tags" className="text-right">
|
<Label htmlFor="admin-web-resource-add-tags" className="text-right">
|
||||||
标签
|
标签
|
||||||
</Label>
|
</Label>
|
||||||
<div className="flex items-center gap-2">
|
<div className="col-span-3 w-full flex flex-wrap items-center gap-2 gap-y-1">
|
||||||
{
|
{
|
||||||
resource.tags.map((tag, index) => (
|
resource.tags.map((tag, index) => (
|
||||||
<ResourceBadge tag={tag} key={index} editMode={true} onClose={name => mutate({ ...resource, tags: resource.tags.filter(tag => tag.name !== name) }, false)} />
|
<ResourceBadge tag={tag} key={index} editMode={true} onClose={name => mutate({ ...resource, tags: resource.tags.filter(tag => tag.name !== name) }, false)} />
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export function ResourceBadge({ tag, editMode, onClose, ...props }: ResourceBadg
|
|||||||
}}
|
}}
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
<span>{tag.name}</span>
|
<span className="text-nowrap">{tag.name}</span>
|
||||||
{
|
{
|
||||||
editMode && (
|
editMode && (
|
||||||
<span onClick={() => onClose?.(tag.name)}><X className="w-3 h-3 text-zinc-800 cursor-pointer" /></span>
|
<span onClick={() => onClose?.(tag.name)}><X className="w-3 h-3 text-zinc-800 cursor-pointer" /></span>
|
||||||
|
|||||||
Reference in New Issue
Block a user