Skip to content

Commit 0bb5ec1

Browse files
authored
UI: Auto-approve toggle styling tweak. (#2769)
1 parent 5abea50 commit 0bb5ec1

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

webview-ui/src/components/settings/AutoApproveToggle.tsx

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -95,27 +95,23 @@ export const AutoApproveToggle = ({ onToggle, ...props }: AutoApproveToggleProps
9595
return (
9696
<div
9797
className={cn(
98-
"grid grid-cols-2",
99-
"[@media(min-width:260px)]:grid-cols-3",
100-
"[@media(min-width:320px)]:grid-cols-4",
101-
"[@media(min-width:480px)]:grid-cols-6",
102-
"[@media(min-width:640px)]:grid-cols-8",
103-
"gap-2",
98+
"flex flex-row flex-wrap justify-center gap-2 max-w-[400px] mx-auto my-2 ",
99+
"[@media(min-width:600px)]:gap-4",
100+
"[@media(min-width:800px)]:max-w-[800px]",
104101
)}>
105102
{Object.values(autoApproveSettingsConfig).map(({ key, descriptionKey, labelKey, icon, testId }) => (
106-
<div key={key} className="aspect-square">
107-
<Button
108-
variant="secondary"
109-
onClick={() => onToggle(key, !props[key])}
110-
title={t(descriptionKey || "")}
111-
data-testid={testId}
112-
className={cn("w-full h-full", { "opacity-50": !props[key] })}>
113-
<span className="flex flex-col items-center gap-1">
114-
<span className={`codicon codicon-${icon}`} />
115-
<span className="text-sm text-center">{t(labelKey)}</span>
116-
</span>
117-
</Button>
118-
</div>
103+
<Button
104+
key={key}
105+
variant={props[key] ? "default" : "outline"}
106+
onClick={() => onToggle(key, !props[key])}
107+
title={t(descriptionKey || "")}
108+
data-testid={testId}
109+
className={cn(" aspect-square h-[80px]")}>
110+
<span className={cn("flex flex-col items-center gap-1")}>
111+
<span className={`codicon codicon-${icon}`} />
112+
<span className="text-sm text-center">{t(labelKey)}</span>
113+
</span>
114+
</Button>
119115
))}
120116
</div>
121117
)

0 commit comments

Comments
 (0)