Skip to content

Commit e006afc

Browse files
committed
feat(board): display in chip format
1 parent 40dbb81 commit e006afc

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
.promoted-attributes {
2+
display: flex;
3+
flex-wrap: wrap;
4+
gap: 8px;
5+
align-items: center;
6+
margin-top: 8px;
7+
}
8+
9+
.promoted-attributes .promoted-attribute {
10+
padding: 2px 10px;
11+
border-radius: 9999px;
12+
white-space: nowrap;
13+
background-color: var(--chip-bg, rgba(0, 0, 0, 0.08));
14+
color: var(--chip-fg, inherit);
15+
border: 1px solid var(--chip-border, rgba(0, 0, 0, 0.15));
16+
font-size: 12px;
17+
line-height: 1.2;
18+
}
19+
20+
.promoted-attributes .promoted-attribute:hover {
21+
background-color: var(--chip-bg-hover, rgba(0, 0, 0, 0.12));
22+
border-color: var(--chip-border-hover, rgba(0, 0, 0, 0.22));
23+
}
24+
25+
.promoted-attributes .promoted-attribute .name {
26+
font-weight: 600;
27+
}
28+
29+
.promoted-attributes .promoted-attribute .value {
30+
opacity: 0.9;
31+
}

apps/client/src/widgets/attribute_widgets/PromotedAttributesDisplay.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import FNote from "../../entities/fnote";
2+
import "./PromotedAttributesDisplay.css";
23

34
interface PromotedAttributesDisplayProps {
45
note: FNote;
@@ -8,7 +9,7 @@ interface PromotedAttributesDisplayProps {
89
export default function PromotedAttributesDisplay({ note, ignoredAttributes }: PromotedAttributesDisplayProps) {
910
const promotedDefinitionAttributes = note.getPromotedDefinitionAttributes();
1011

11-
return (
12+
return promotedDefinitionAttributes.length > 0 && (
1213
<div className="promoted-attributes">
1314
{promotedDefinitionAttributes.map((attr) => {
1415
const def = attr.getDefinition();
@@ -19,9 +20,9 @@ export default function PromotedAttributesDisplay({ note, ignoredAttributes }: P
1920
if (ignoredAttributes && ignoredAttributes.includes(name)) return null;
2021

2122
return (
22-
<div key={attr.name} className="promoted-attribute">
23+
<span key={attr.name} className="promoted-attribute">
2324
<strong>{friendlyName}:</strong> {value}
24-
</div>
25+
</span>
2526
);
2627
}
2728
)}

0 commit comments

Comments
 (0)