mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 05:00:30 +08:00
fix: resolve invalid button nesting in component hierarchy
This commit is contained in:
parent
4b7ab042f3
commit
31190e169f
@ -24,6 +24,7 @@ const ConnectionItem: React.FC<Props> = (props) => {
|
||||
|
||||
return (
|
||||
<div className={`px-2 pb-2 ${index === 0 ? 'pt-2' : ''}`}>
|
||||
<div className="relative">
|
||||
<Card
|
||||
isPressable
|
||||
className="w-full"
|
||||
@ -32,8 +33,8 @@ const ConnectionItem: React.FC<Props> = (props) => {
|
||||
setIsDetailModalOpen(true)
|
||||
}}
|
||||
>
|
||||
<div className="w-full flex justify-between">
|
||||
<div className="w-[calc(100%-48px)]">
|
||||
<div className="w-full">
|
||||
<div className="w-full pr-12">
|
||||
<CardHeader className="pb-0 gap-1">
|
||||
<Chip
|
||||
color={`${info.isActive ? 'primary' : 'danger'}`}
|
||||
@ -80,11 +81,13 @@ const ConnectionItem: React.FC<Props> = (props) => {
|
||||
) : null}
|
||||
</CardFooter>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
<Button
|
||||
color={`${info.isActive ? 'warning' : 'danger'}`}
|
||||
variant="light"
|
||||
isIconOnly
|
||||
className="mr-2 my-auto"
|
||||
className="absolute right-2 top-1/2 -translate-y-1/2"
|
||||
onPress={() => {
|
||||
close(info.id)
|
||||
}}
|
||||
@ -92,7 +95,6 @@ const ConnectionItem: React.FC<Props> = (props) => {
|
||||
{info.isActive ? <CgClose className="text-lg" /> : <CgTrash className="text-lg" />}
|
||||
</Button>
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user