Skip to content

Commit 95f2e49

Browse files
authored
update firewall filter type/value visual treatment (#2108)
* update firewall filter type/value visual treatment * use normal-case on values badges * keep various filters on one line, with wrapping when needed
1 parent 8e3a200 commit 95f2e49

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

app/table/cells/FirewallFilterCell.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@ import { TypeValueCell } from './TypeValueCell'
1515
export const FirewallFilterCell = ({
1616
value: { hosts, ports, protocols },
1717
}: Cell<VpcFirewallRuleFilter>) => (
18-
<div className="space-x-1">
19-
{hosts && hosts.map((tv, i) => <TypeValueCell key={`${tv}-${i}`} value={tv} />)}
20-
{protocols &&
21-
protocols.map((p, i) => (
22-
<Badge key={`${p}-${i}`} variant="default">
18+
<div className="flex flex-col gap-1">
19+
<div className="flex flex-wrap gap-1">
20+
{hosts?.map((tv, i) => <TypeValueCell key={`${tv}-${i}`} value={tv} />)}
21+
</div>
22+
<div className="flex gap-1">
23+
{protocols?.map((p, i) => <Badge key={`${p}-${i}`}>{p}</Badge>)}
24+
{ports?.map((p, i) => (
25+
<Badge key={`${p}-${i}`} variant="solid">
2326
{p}
2427
</Badge>
2528
))}
26-
{ports && ports.map((p, i) => <Badge key={`${p}-${i}`}>{p}</Badge>)}
29+
</div>
2730
</div>
2831
)

app/table/cells/TypeValueCell.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export type TypeValue = {
1818
export const TypeValueCell = ({ value: { type, value } }: Cell<TypeValue>) => (
1919
<div className="space-x-1">
2020
<Badge>{type}</Badge>
21-
<Badge>{value}</Badge>
21+
<Badge variant="solid" className="!normal-case">
22+
{value}
23+
</Badge>
2224
</div>
2325
)

0 commit comments

Comments
 (0)