Skip to content

Commit c0f47de

Browse files
authored
Add border to label (#104)
* Added border to label * Updated snapshots
1 parent 485ddcb commit c0f47de

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/ui/widgets/Label/__snapshots__/label.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ exports[`<Label /> > it handles transparent prop`] = `
1313
exports[`<Label /> > it handles transparent prop 1`] = `
1414
<DocumentFragment>
1515
<p
16-
class="MuiTypography-root MuiTypography-body1 css-1fe740m-MuiTypography-root"
16+
class="MuiTypography-root MuiTypography-body1 css-4hgpfw-MuiTypography-root"
1717
>
1818
hello
1919
</p>
@@ -23,7 +23,7 @@ exports[`<Label /> > it handles transparent prop 1`] = `
2323
exports[`<Label /> > it matches the snapshot 1`] = `
2424
<DocumentFragment>
2525
<p
26-
class="MuiTypography-root MuiTypography-body1 css-1fe740m-MuiTypography-root"
26+
class="MuiTypography-root MuiTypography-body1 css-4hgpfw-MuiTypography-root"
2727
>
2828
hello
2929
</p>

src/ui/widgets/Label/label.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export const LabelComponent = (
6363
? "transparent"
6464
: (props.backgroundColor?.toString() ?? diamondTheme.palette.primary.main);
6565
const font = props.font?.css() ?? diamondTheme.typography;
66+
const border = props.border?.css() ?? "0px solid #000000";
6667

6768
// Since display is "flex", use "flex-start" and "flex-end" to align
6869
// the content.
@@ -93,7 +94,8 @@ export const LabelComponent = (
9394
color: foregroundColor.toString(),
9495
backgroundColor: backgroundColor,
9596
fontFamily: font,
96-
transform: `rotate(${rotationStep * -90}deg)`.toString()
97+
transform: `rotate(${rotationStep * -90}deg)`.toString(),
98+
border: border
9799
}}
98100
>
99101
{text}

src/ui/widgets/Symbol/__snapshots__/symbol.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ exports[`<Symbol /> from .opi file > matches snapshot 1`] = `
8383
style="padding: 5%;"
8484
>
8585
<p
86-
class="MuiTypography-root MuiTypography-body1 css-1fe740m-MuiTypography-root"
86+
class="MuiTypography-root MuiTypography-body1 css-4hgpfw-MuiTypography-root"
8787
>
8888
Fake value
8989
</p>

0 commit comments

Comments
 (0)