Skip to content

Commit c18db6e

Browse files
fix: leave time range refresh button blue in primary mode
1 parent 9e6502a commit c18db6e

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

projects/components/src/time-range/time-range.component.scss

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@
4040
}
4141
}
4242

43-
:host {
44-
.refresh {
43+
.refresh {
44+
margin-left: 8px;
45+
&:not(.emphasized) {
4546
::ng-deep {
4647
button.button.solid {
4748
@include top-bar-dark-button-background;
@@ -50,11 +51,5 @@
5051
}
5152
}
5253
}
53-
54-
margin-left: 8px;
55-
cursor: pointer;
56-
height: 32px;
57-
display: flex;
58-
align-items: center;
5954
}
6055
}

projects/components/src/time-range/time-range.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ import { PopoverRef } from '../popover/popover-ref';
5656
<ht-button
5757
*ngIf="this.getRefreshButtonData | htMemoize: timeRange | async as refreshButton"
5858
class="refresh"
59+
[ngClass]="refreshButton.isEmphasized ? 'emphasized' : ''"
5960
[label]="refreshButton.text$ | async"
6061
icon="${IconType.Refresh}"
6162
size="${ButtonSize.Small}"
@@ -106,6 +107,7 @@ export class TimeRangeComponent {
106107
of({
107108
text$: of('Refresh'),
108109
role: ButtonRole.Secondary,
110+
isEmphasized: false,
109111
onClick: () => this.onRefresh(timeRange)
110112
}),
111113
this.ngZone.runOutsideAngular(() =>
@@ -123,6 +125,7 @@ export class TimeRangeComponent {
123125
map(duration => `Refresh - updated ${duration.toString()} ago`)
124126
),
125127
role: ButtonRole.Primary,
128+
isEmphasized: true,
126129
onClick: () => this.onRefresh(timeRange)
127130
}))
128131
)
@@ -141,5 +144,6 @@ export class TimeRangeComponent {
141144
interface RefreshButtonData {
142145
text$: Observable<string>;
143146
role: ButtonRole;
147+
isEmphasized: boolean;
144148
onClick(): void;
145149
}

0 commit comments

Comments
 (0)