Skip to content

Commit 051a4ad

Browse files
authored
feat: support displaying beta tag in left nav item (#747)
* feat: support displaying beta tag in left nav item
1 parent 0293dca commit 051a4ad

File tree

6 files changed

+17
-3
lines changed

6 files changed

+17
-3
lines changed

projects/components/src/beta-tag/beta-tag.component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ import { Color } from '@hypertrace/common';
55
selector: 'ht-beta-tag',
66
changeDetection: ChangeDetectionStrategy.OnPush,
77
template: `
8-
<ht-label-tag label="Beta" backgroundColor="${Color.Purple2}" labelColor="${Color.Purple5}"></ht-label-tag>
8+
<ht-label-tag
9+
htTooltip="Beta Feature"
10+
class="beta-tag"
11+
label="Beta"
12+
backgroundColor="${Color.Purple2}"
13+
labelColor="${Color.Purple5}"
14+
></ht-label-tag>
915
`
1016
})
1117
export class BetaTagComponent {}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { NgModule } from '@angular/core';
22
import { LabelTagModule } from '../label-tag/label-tag.module';
3+
import { TooltipModule } from '../tooltip/tooltip.module';
34
import { BetaTagComponent } from './beta-tag.component';
45

56
@NgModule({
67
declarations: [BetaTagComponent],
7-
imports: [LabelTagModule],
8+
imports: [LabelTagModule, TooltipModule],
89
exports: [BetaTagComponent]
910
})
1011
export class BetaTagModule {}

projects/components/src/navigation/nav-item/nav-item.component.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
margin-left: 14px;
2020
display: flex;
2121
flex-direction: row;
22+
align-items: center;
23+
24+
.beta {
25+
margin-left: 8px;
26+
}
2227
}
2328

2429
.icon {

projects/components/src/navigation/nav-item/nav-item.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { NavItemLinkConfig } from '../navigation-list.component';
2727
<span *ngIf="featureState === '${FeatureState.Preview}'" class="soon-container">
2828
<span class="soon">SOON</span>
2929
</span>
30+
<ht-beta-tag *ngIf="config.isBeta" class="beta"></ht-beta-tag>
3031
</div>
3132
</div>
3233
`

projects/components/src/navigation/navigation-list.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,5 @@
8484
}
8585

8686
.expanded {
87-
width: 220px;
87+
width: 228px;
8888
}

projects/components/src/navigation/navigation-list.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ export interface NavItemLinkConfig {
122122
matchPaths: string[]; // For now, default path is index 0
123123
features?: string[];
124124
replaceCurrentHistory?: boolean;
125+
isBeta?: boolean;
125126
}
126127

127128
export type FooterItemConfig = FooterItemLinkConfig;

0 commit comments

Comments
 (0)