Skip to content

Commit 381f2f7

Browse files
committed
format and minWidth on devices page
1 parent 0dfc212 commit 381f2f7

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

ui/src/common/TagChip.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as React from 'react';
33
// @ts-ignore
44
import bestContrast from 'get-best-contrast-color';
55

6-
export const TagChip = ({color, label, style={}}: {label: string; color: string, style?:React.CSSProperties}) => {
6+
export const TagChip = ({color, label, style = {}}: {label: string; color: string; style?: React.CSSProperties}) => {
77
const textColor = bestContrast(color, ['#fff', '#000']);
88
return (
99
<Chip
@@ -18,7 +18,7 @@ export const TagChip = ({color, label, style={}}: {label: string; color: string,
1818
height: 'fit-content',
1919
whiteSpace: 'normal',
2020
wordBreak: 'break-word',
21-
... style
21+
...style,
2222
}}
2323
label={label}
2424
/>

ui/src/devices/DevicesPage.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,14 @@ export const DevicesPage = () => {
8484
}
8585
}}
8686
onSubmit={onClickSubmit}
87+
style={{minWidth: 128}}
8788
/>
8889
) : (
8990
device.name + (isCurrent ? ' (current)' : '')
9091
)}
9192
</TableCell>
9293
<TableCell title={device.createdAt}>{moment(device.createdAt).fromNow()}</TableCell>
93-
<TableCell title={device.type}>
94+
<TableCell title={device.type} style={{minWidth: 128}}>
9495
{isEdited ? (
9596
<Select
9697
value={editDeviceType}

ui/src/tag/TagPage.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,20 +82,17 @@ export const TagPage = () => {
8282
}
8383
}}
8484
onSubmit={onClickSubmit}
85-
style={{ minWidth: 128 }}
85+
style={{minWidth: 128}}
8686
/>
8787
) : (
8888
tag.key
8989
)}
9090
</TableCell>
9191
<TableCell style={{minWidth: 128}}>
9292
{isEdited ? (
93-
<SliderPicker
94-
onChange={(c) => setEditing([editKey, editKeyNew, c.hex])}
95-
color={editColor}
96-
/>
93+
<SliderPicker onChange={(c) => setEditing([editKey, editKeyNew, c.hex])} color={editColor} />
9794
) : (
98-
<TagChip label={tag.color} color={tag.color} style={{wordBreak: "normal"}}/>
95+
<TagChip label={tag.color} color={tag.color} style={{wordBreak: 'normal'}} />
9996
)}
10097
</TableCell>
10198
<TableCell align="right">{tag.usages}</TableCell>

0 commit comments

Comments
 (0)