Skip to content

Commit 718909d

Browse files
refactor: rearrange styles for sharing in app header
also updated select to actually take the size argument into account
1 parent fdf2030 commit 718909d

File tree

6 files changed

+70
-27
lines changed

6 files changed

+70
-27
lines changed

projects/assets-library/assets/styles/_interaction.scss

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,27 @@
5555

5656
@include list-hover;
5757
}
58+
59+
@mixin top-bar-light-button-background {
60+
background-color: white;
61+
62+
&:hover {
63+
background-color: $gray-1;
64+
}
65+
}
66+
67+
@mixin top-bar-light-button-foreground {
68+
@include body-1-medium($gray-8);
69+
}
70+
71+
@mixin top-bar-dark-button-background {
72+
background-color: $gray-6;
73+
74+
&:hover {
75+
background-color: $gray-5;
76+
}
77+
}
78+
79+
@mixin top-bar-dark-button-foreground {
80+
@include body-1-medium(white);
81+
}

projects/components/src/header/application/application-header.component.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,17 @@
4545
padding-left: 46px;
4646
}
4747

48-
.right-side {
48+
.right-side-content {
4949
display: flex;
5050
margin-left: auto;
5151
align-items: center;
5252
}
5353

54+
.left-side-content {
55+
display: flex;
56+
align-items: center;
57+
}
58+
5459
.header-action {
5560
cursor: pointer;
5661
padding: 0 12px;

projects/components/src/header/application/application-header.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@ import { GLOBAL_HEADER_HEIGHT, NavigationService } from '@hypertrace/common';
1212
<ng-content select="[logo]"></ng-content>
1313
</div>
1414
<div class="divider"></div>
15+
<div class="left-side-content">
16+
<ng-content select="[left]"></ng-content>
17+
</div>
1518
<div class="time-range">
1619
<ht-time-range></ht-time-range>
1720
</div>
1821
</div>
19-
<div class="right-side">
22+
<div class="right-side-content">
2023
<ng-content></ng-content>
24+
<ng-content select="[right]"></ng-content>
2125
</div>
2226
</div>
2327
`

projects/components/src/select/select.component.scss

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,16 @@
1616
align-items: center;
1717
border: 1px solid $color-border;
1818
border-radius: 6px;
19-
height: 100%;
2019
width: 100%;
20+
height: 34px;
21+
22+
&.small {
23+
height: 32px;
24+
}
2125

2226
.select-container {
2327
width: 100%;
28+
height: 100%;
2429
}
2530

2631
&.disabled {
@@ -52,7 +57,7 @@
5257
align-items: center;
5358
padding: 0 8px;
5459
cursor: pointer;
55-
height: 34px;
60+
height: 100%;
5661

5762
&.justify-left {
5863
justify-content: flex-start;
@@ -108,5 +113,9 @@
108113
&:hover {
109114
background: $gray-1;
110115
}
116+
117+
&.small {
118+
height: 32px;
119+
}
111120
}
112121
}

projects/components/src/select/select.component.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ import { SelectSize } from './select-size';
4949
</ht-popover-trigger>
5050
<ht-popover-content>
5151
<div class="select-content">
52-
<div *ngFor="let item of items" (click)="this.onSelectionChange(item)" class="select-option">
52+
<div
53+
*ngFor="let item of items"
54+
(click)="this.onSelectionChange(item)"
55+
class="select-option"
56+
[ngClass]="this.size"
57+
>
5358
<span class="label">{{ item.label }}</span>
5459
<ht-icon
5560
class="status-icon"

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

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
11
@import 'mixins';
22

3-
@mixin top-bar-button() {
4-
// Custom styling for top bar different shades than normal buttons
5-
background-color: $gray-6;
6-
border-radius: 6px;
7-
8-
&:hover {
9-
background-color: $gray-5;
10-
}
11-
}
12-
133
.time-range {
144
display: flex;
155
align-items: center;
166
}
177

188
.time-range-selector {
19-
@include top-bar-button();
9+
@include top-bar-dark-button-background;
10+
@include top-bar-dark-button-foreground;
2011
min-width: 200px;
21-
color: white;
12+
border-radius: 6px;
2213
}
2314

2415
.trigger {
@@ -49,16 +40,21 @@
4940
}
5041
}
5142

52-
.refresh {
53-
::ng-deep {
54-
button.button.secondary {
55-
@include top-bar-button();
43+
:host {
44+
.refresh {
45+
::ng-deep {
46+
button.button.solid {
47+
@include top-bar-dark-button-background;
48+
.label {
49+
@include top-bar-dark-button-foreground;
50+
}
51+
}
5652
}
53+
54+
margin-left: 8px;
55+
cursor: pointer;
56+
height: 32px;
57+
display: flex;
58+
align-items: center;
5759
}
58-
margin-left: 8px;
59-
cursor: pointer;
60-
height: 32px;
61-
display: flex;
62-
align-items: center;
63-
color: $gray-3;
6460
}

0 commit comments

Comments
 (0)