Skip to content

Commit

Permalink
Nicer UI for allowed command pills (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubens authored Dec 2, 2024
1 parent adc438f commit ccb973e
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions webview-ui/src/components/settings/SettingsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,17 +237,36 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
</VSCodeButton>
</div>

<div style={{ marginTop: '10px' }}>
<div style={{
marginTop: '10px',
display: 'flex',
flexWrap: 'wrap',
gap: '5px'
}}>
{(allowedCommands ?? []).map((cmd, index) => (
<div key={index} style={{
display: 'flex',
alignItems: 'center',
gap: '5px',
marginBottom: '5px'
backgroundColor: 'var(--vscode-button-secondaryBackground)',
padding: '2px 6px',
borderRadius: '4px',
border: '1px solid var(--vscode-button-secondaryBorder)',
height: '24px'
}}>
<span>{cmd}</span>
<VSCodeButton
appearance="icon"
style={{
padding: 0,
margin: 0,
height: '20px',
width: '20px',
minWidth: '20px',
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
}}
onClick={() => {
const newCommands = (allowedCommands ?? []).filter((_, i) => i !== index)
setAllowedCommands(newCommands)
Expand Down

0 comments on commit ccb973e

Please sign in to comment.