Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/components/common/wrap-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,11 @@ export const WrapCard: React.FC<WrapCardProps> = ({
borderWidth={isSelected ? borderWidth : 0}
p={isSelected ? selectedPadding : basePadding}
{...cardProps}
onClick={onSelect}
>
{variant === "radio" && (
<Box position="absolute" top={2} left={2}>
<Radio
value={radioValue}
onClick={onSelect}
colorScheme={primaryColor}
/>
<Radio value={radioValue} colorScheme={primaryColor} />
</Box>
)}
{renderContent()}
Expand Down
11 changes: 9 additions & 2 deletions src/components/instance-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export const InstanceMenu: React.FC<InstanceMenuProps> = ({
variant="ghost"
aria-label="operations"
icon={<LuEllipsis />}
onClick={(e) => e.stopPropagation()}
/>
<Portal>
<MenuList>
Expand All @@ -78,7 +79,10 @@ export const InstanceMenu: React.FC<InstanceMenuProps> = ({
key={item.label}
fontSize="xs"
color={item.danger ? "red.500" : "inherit"}
onClick={item.onClick}
onClick={(e) => {
e.stopPropagation();
item.onClick();
}}
>
<HStack>
<item.icon />
Expand All @@ -97,7 +101,10 @@ export const InstanceMenu: React.FC<InstanceMenuProps> = ({
icon={item.icon}
label={item.label}
colorScheme={item.danger ? "red" : "gray"}
onClick={item.onClick}
onClick={(e) => {
e.stopPropagation();
item.onClick();
}}
/>
))}
</HStack>
Expand Down
9 changes: 3 additions & 6 deletions src/components/instances-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,14 @@ const InstancesView: React.FC<InstancesViewProps> = ({
/>
</HStack>
),
...(withMenu
? {}
: {
isFullClickZone: true,
onClick: () => handleUpdateSelectedInstance(instance),
}),
isFullClickZone: true,
onClick: () => handleUpdateSelectedInstance(instance),
children: withMenu ? (
<InstanceMenu instance={instance} variant="buttonGroup" />
) : (
<></>
),
isChildrenIndependent: withMenu,
}));

const gridItems = instances.map((instance) => ({
Expand Down
11 changes: 9 additions & 2 deletions src/components/player-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export const PlayerMenu: React.FC<PlayerMenuProps> = ({
variant="ghost"
aria-label="operations"
icon={<LuEllipsis />}
onClick={(e) => e.stopPropagation()}
/>
<Portal>
<MenuList>
Expand All @@ -172,7 +173,10 @@ export const PlayerMenu: React.FC<PlayerMenuProps> = ({
key={item.label}
fontSize="xs"
color={item.danger ? "red.500" : "inherit"}
onClick={item.onClick}
onClick={(e) => {
e.stopPropagation();
item.onClick();
}}
>
<HStack>
<item.icon />
Expand All @@ -191,7 +195,10 @@ export const PlayerMenu: React.FC<PlayerMenuProps> = ({
icon={item.icon}
label={item.label}
colorScheme={item.danger ? "red" : "gray"}
onClick={item.onClick}
onClick={(e) => {
e.stopPropagation();
item.onClick();
}}
isLoading={item.isLoading}
/>
))}
Expand Down
9 changes: 3 additions & 6 deletions src/components/players-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,14 @@ const PlayersView: React.FC<PlayersViewProps> = ({
/>
</HStack>
),
...(withMenu
? {}
: {
isFullClickZone: true,
onClick: () => handleUpdateSelectedPlayer(player.id),
}),
isFullClickZone: true,
onClick: () => handleUpdateSelectedPlayer(player.id),
children: withMenu ? (
<PlayerMenu player={player} variant="buttonGroup" />
) : (
<></>
),
isChildrenIndependent: withMenu,
}));

const gridItems = players.map((player) => ({
Expand Down
Loading