Skip to content

Commit

Permalink
Fixes for version-switcher from #2838
Browse files Browse the repository at this point in the history
  • Loading branch information
imagoiq committed Mar 21, 2024
1 parent 226ab66 commit 36c65e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/demo/src/app/common/version.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class PackageVersion {
})
export class VersionService {
public get currentVersion(): Observable<PackageVersion> {
return this.versions.pipe(map(versions => versions.find(v => v.isCurrent)));
return this.versions.pipe(map(versions => versions[0]));
}

public get versions(): Observable<PackageVersion[]> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,8 @@
<button class="btn btn-link dropdown-button" id="versionDropdownButton" ngbDropdownToggle>
{{ (currentVersion$ | async)?.title }}
</button>
<div ngbDropdownMenu aria-labelledby="versionDropdown">
<a
*ngFor="let version of versions$ | async"
[href]="isLatest ? 'https://design-system.post.ch' : version.url"
[class.active]="version.isCurrent"
ngbDropdownItem
>
<div ngbDropdownMenu aria-labelledby="versionDropdown" class="dropdown-menu-end">
<a *ngFor="let version of versions$ | async" [href]="version.url" ngbDropdownItem>
<span class="bold">{{ version.title }}</span>
<div class="small mt-2 icons" *ngIf="version.dependencies">
<span
Expand Down

0 comments on commit 36c65e8

Please sign in to comment.