export type MenuLink = {
icon: GlobalIconName
+ iconClass?: string
label: string
// Used by the left menu for example
let links: MenuLink[] = []
if (userCanSeeVideosLink) {
+ links.push({
+ path: '/my-library/video-channels',
+ icon: 'channel' as GlobalIconName,
+ iconClass: 'channel-icon',
+ shortLabel: $localize`Channels`,
+ label: $localize`My channels`
+ })
+
links.push({
path: '/my-library/videos',
icon: 'videos' as GlobalIconName,
</a>
<a class="menu-link" routerLink="/my-library" routerLinkActive="active" #libraryLink (click)="onActiveLinkScrollToAnchor(libraryLink)">
- <my-global-icon iconName="channel" aria-hidden="true"></my-global-icon>
+ <my-global-icon class="channel-icon" iconName="channel" aria-hidden="true"></my-global-icon>
<ng-container i18n>My library</ng-container>
</a>
<div i18n class="block-title">{{ menuSection.title }}</div>
<a class="menu-link" *ngFor="let link of menuSection.links" [routerLink]="link.path" routerLinkActive="active">
- <my-global-icon *ngIf="link.icon" [iconName]="link.icon" aria-hidden="true"></my-global-icon>
+ <my-global-icon *ngIf="link.icon" [iconName]="link.icon" [ngClass]="link.iconClass" aria-hidden="true"></my-global-icon>
<ng-container>{{ link.shortLabel }}</ng-container>
</a>
</div>
}
my-global-icon {
- &[iconName=playlists] {
+ position: relative;
+ top: -1px;
+
+ .playlist-icon {
@include margin-right(16px);
height: 24px;
width: 24px;
}
- &[iconName=videos] {
- position: relative;
- right: -1px;
- }
-
- &[iconName=channel] {
- margin-top: -2px;
- }
-
- &[iconName='sign-out'] {
- position: relative;
- right: -2px;
- height: 20px;
- width: 20px;
+ &.channel-icon {
+ top: -2px;
}
}
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-log-out"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><polyline points="16 17 21 12 16 7"></polyline><line x1="21" y1="12" x2="9" y2="12"></line></svg>
\ No newline at end of file
+<svg xmlns="http://www.w3.org/2000/svg" width="22" height="24" viewBox="0 0 22 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-log-out"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><polyline points="16 17 21 12 16 7"></polyline><line x1="21" y1="12" x2="9" y2="12"></line></svg>