-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tab): add routerLink only for url
- Loading branch information
1 parent
e2fc2b1
commit 2af58f5
Showing
2 changed files
with
24 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,25 @@ | ||
<a class="h-full w-full flex flex-col items-center justify-center hover:text-blue" [class.hover:text-color]="tab.logo" | ||
[routerLink]="tab.url" [routerLinkActive]="tab.routeActive ? 'active-tab' : ''"> | ||
<ng-container *ngIf="tab.url; else withoutUrl"> | ||
<a class="h-full w-full flex flex-col items-center justify-center hover:text-blue" [class.hover:text-color]="tab.logo" | ||
[routerLink]="tab.url" [routerLinkActive]="tab.routeActive ? 'active-tab' : ''"> | ||
<ng-container *ngTemplateOutlet="tabContent"></ng-container> | ||
</a> | ||
<ng-container *ngTemplateOutlet="tooltip"></ng-container> | ||
</ng-container> | ||
|
||
<ng-template #withoutUrl> | ||
<a class="h-full w-full flex flex-col items-center justify-center hover:text-blue" | ||
[class.hover:text-color]="tab.logo"> | ||
<ng-container *ngTemplateOutlet="tabContent"></ng-container> | ||
</a> | ||
<ng-container *ngTemplateOutlet="tooltip"></ng-container> | ||
</ng-template> | ||
|
||
<ng-template #tabContent> | ||
<niz-inline-svg class="h-8 w-8" [svgSource]="tab.image"></niz-inline-svg> | ||
<span *ngIf="tab.text && !tab.tooltip" class="mt-1 text-lg font-semibold tracking-tight">{{tab.text}}</span> | ||
</a> | ||
<span *ngIf="tab.text && tab.tooltip" | ||
class="tooltip text-color bg-tabs rounded-full py-1 px-4 hidden md:block">{{tab.text}}</span> | ||
</ng-template> | ||
|
||
<ng-template #tooltip> | ||
<span *ngIf="tab.text && tab.tooltip" | ||
class="tooltip text-color bg-tabs rounded-full py-1 px-4 hidden md:block">{{tab.text}}</span> | ||
</ng-template> |