Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit ee882b7

Browse files
juliosgarbibmartel
andauthored
fix: LOPS-170: Labeling ui annotation tab improvements (#1376)
* fix: LOPS-170: Labeling ui annotation tab improvements * fix styles and add new hovers * Update src/common/TimeAgo/TimeAgo.tsx --------- Co-authored-by: bmartel <[email protected]> Co-authored-by: juliosgarbi <[email protected]>
1 parent f9fd1d0 commit ee882b7

File tree

4 files changed

+47
-6
lines changed

4 files changed

+47
-6
lines changed

src/common/TimeAgo/TimeAgo.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,18 @@ export const TimeAgo = ({ date, ...rest }: TimeAgoProps) => {
5151
};
5252
}, [date, timestamp]);
5353

54+
// Replace the longer english text when less than a minute in time. This is done this way due to a limiting API
55+
// with the date-fns function. If we require an entire overhaul to the messaging for the en-US locale, revisit this and replace with an entire locale override option.
56+
const text = formatDistanceToNow(fromTS, { addSuffix: true }) === 'less than a minute ago' ? 'seconds ago' : formatDistanceToNow(fromTS, { addSuffix: true });
57+
58+
5459
return (
5560
<time
5661
dateTime={format(fromTS, 'yyyy-MM-dd\'T\'HH:mm:ss.SSSxxx')}
5762
title={format(fromTS, 'PPpp')}
5863
{...rest}
5964
>
60-
{formatDistanceToNow(fromTS, { addSuffix: true })}
65+
{text}
6166
</time>
6267
);
6368
};

src/components/AnnotationsCarousel/AnnotationButton.styl

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,22 @@
44
border-radius 4px 4px 0 0
55
border-width 1px 1px 0px 1px
66
border-style solid
7-
border-color rgba(137, 128, 152, 0.16)
87
background-color rgba(137, 128, 152, 0.08)
8+
border-color transparent
99
margin-top 2px
1010
align-items center
1111
gap 8px
1212
cursor pointer
13-
height calc(100% - 4px)
13+
height calc(100% - 3px)
14+
min-width 186px
15+
16+
&__main
17+
flex: 1 0 auto;
1418
&__mainSection
1519
display flex
1620
align-items center
1721
gap 8px
22+
flex: 1 0 auto;
1823
.annotation-button__userpic_prediction
1924
background-color #EFDBFF
2025
color #7735D6
@@ -24,6 +29,7 @@
2429
line-height 16px
2530
letter-spacing 0.4px
2631
text-align left
32+
color: #898098;
2733
&__entity-id
2834
font-size 10px
2935
font-weight 400
@@ -38,12 +44,31 @@
3844
line-height 16px
3945
letter-spacing 0.4px
4046
text-align left
41-
color #413C4A
47+
color #898098
48+
49+
&:hover
50+
background-color rgba(9, 109, 217, 0.12)
51+
border 1px solid rgba(9, 109, 217, 0.16)
52+
border-bottom-color transparent
53+
.annotation-button__ellipsisIcon
54+
visibility visible
4255

4356
&_selected
4457
background-color #FFFFFF
45-
&:hover
46-
background-color rgba(9, 109, 217, 0.08)
58+
border-color rgba(137, 128, 152, 0.16)
59+
60+
&:hover
61+
background-color #FFFFFF
62+
border-color rgba(137, 128, 152, 0.16)
63+
border-bottom-color transparent
64+
65+
.annotation-button__ellipsisIcon
66+
visibility visible
67+
.annotation-button__created
68+
color #413C4A
69+
.annotation-button__name
70+
color #413C4A
71+
4772
&__icons
4873
display inline-flex
4974
align-items center
@@ -60,6 +85,11 @@
6085
transform rotate(90deg)
6186
display flex
6287
border-radius 4px
88+
color #898098
89+
visibility hidden
90+
&:hover
91+
color #096DD9
92+
background rgba(9, 109, 217, 0.12)
6393
&__picSection
6494
position relative
6595
&__status

src/components/TopBar/TopBar.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export const TopBar = observer(({ store }) => {
2727
{store.hasInterface('annotations:view-all') && (
2828
<Tooltip title="View all annotations">
2929
<Button
30+
className={'topbar__button'}
3031
icon={<IconViewAll />}
3132
type="text"
3233
aria-label="View All"
@@ -45,6 +46,7 @@ export const TopBar = observer(({ store }) => {
4546
<Tooltip placement="topLeft" title="Create a new annotation">
4647
<Button
4748
icon={<LsPlus />}
49+
className={'topbar__button'}
4850
type="text"
4951
aria-label="View All"
5052
onClick={event => {

src/components/TopBar/TopBar.styl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
position sticky
1313
top 0
1414

15+
&__button
16+
&:hover
17+
background-color rgba(9, 109, 217, 0.12)
18+
1519
&__group
1620
display flex
1721
align-items stretch

0 commit comments

Comments
 (0)