docs: update demo and premium links (#5794)

This commit is contained in:
SFilinsky 2020-10-30 14:42:59 +03:00 committed by GitHub
parent 5e7e444454
commit 64dbfa008f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 128 additions and 72 deletions

View file

@ -15,6 +15,10 @@ export class HeaderMenuService {
title: 'Docs', title: 'Docs',
link: '/docs', link: '/docs',
}, },
{
title: 'Demo',
url: 'https://www.akveo.com/ngx-admin?utm_campaign=ngx_admin%20-%20demo%20-%20ngx_admin%20docs&utm_source=ngx_admin&utm_medium=referral&utm_content=landing_main_section',
},
]; ];
getHeaderMenu(): Observable<NbMenuItem[]> { getHeaderMenu(): Observable<NbMenuItem[]> {

View file

@ -16,6 +16,8 @@
$menu-item-fg-active: nb-theme(header-menu-fg-active); $menu-item-fg-active: nb-theme(header-menu-fg-active);
$contacts-fg: nb-theme(color-fg-heading-light); $contacts-fg: nb-theme(color-fg-heading-light);
$contacts-active-fg: nb-theme(header-menu-fg-active); $contacts-active-fg: nb-theme(header-menu-fg-active);
$menu-sm-padding: 0.675rem 0.375rem;
$menu-md-padding: 0.675rem 1.375rem;
display: flex; display: flex;
flex: 1 0 auto; flex: 1 0 auto;
@ -39,6 +41,7 @@
&.middle { &.middle {
flex: 1; flex: 1;
justify-content: flex-end;
} }
} }
@ -65,6 +68,7 @@
display: none; display: none;
align-items: center; align-items: center;
padding-right: 2rem; padding-right: 2rem;
margin-left: auto;
i { i {
margin-right: 0.5rem; margin-right: 0.5rem;
@ -75,14 +79,12 @@
.menu-items { .menu-items {
display: flex; display: flex;
justify-content: flex-start;
.menu-item { .menu-item {
border: none; border: none;
width: 5.375rem;
a { a {
padding: 0.675rem 1.375rem; padding: $menu-sm-padding;
color: $menu-item-fg; color: $menu-item-fg;
display: block; display: block;
@ -110,10 +112,19 @@
} }
} }
::ng-deep ngx-material-theme-link a.material-theme-link {
padding: $menu-sm-padding;
}
@include media-breakpoint-up(is) { @include media-breakpoint-up(is) {
.section { .section.left,
.section.right {
padding: 0.875rem 0; padding: 0.875rem 0;
} }
.section.middle {
justify-content: flex-start;
}
} }
@include media-breakpoint-up(sm) { @include media-breakpoint-up(sm) {
@ -130,8 +141,12 @@
display: inline; display: inline;
} }
} }
.backend-bundles {
display: flex; ::ng-deep {
nb-menu .menu-items .menu-item a,
ngx-material-theme-link a.material-theme-link {
padding: $menu-md-padding;
}
} }
} }
@ -149,6 +164,10 @@
::ng-deep nb-menu .menu-items li:nth-child(2) { ::ng-deep nb-menu .menu-items li:nth-child(2) {
display: list-item; display: list-item;
} }
.backend-bundles {
display: flex;
}
} }
@include media-breakpoint-up(lg) { @include media-breakpoint-up(lg) {
@ -248,13 +267,21 @@
flex-basis: auto; flex-basis: auto;
} }
::ng-deep ngx-material-theme-link {
display: none;
}
@include media-breakpoint-up(is) { @include media-breakpoint-up(is) {
::ng-deep nb-menu .menu-items li:first-child { ::ng-deep ngx-material-theme-link {
display: list-item; display: flex;
} }
} }
@include media-breakpoint-up(sm) { @include media-breakpoint-up(sm) {
::ng-deep nb-menu .menu-items li:first-child {
display: list-item;
}
.section.middle { .section.middle {
justify-content: space-between; justify-content: space-between;
} }
@ -264,9 +291,6 @@
height: 1.25rem; height: 1.25rem;
margin-left: auto; margin-left: auto;
} }
.backend-bundles {
display: flex;
}
} }
@include media-breakpoint-up(lg) { @include media-breakpoint-up(lg) {

View file

@ -4,11 +4,11 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*/ */
import { Component, HostBinding, Input, OnDestroy } from '@angular/core'; import { OnInit, Component, HostBinding, Input, OnDestroy } from '@angular/core';
import { takeWhile } from 'rxjs/operators'; import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { NbSidebarService } from '@nebular/theme'; import { NbSidebarService } from '@nebular/theme';
/*import { NgxAnalytics } from '../../services/analytics.service';*/
import { NgxVersionService } from '../../services/version.service'; import { NgxVersionService } from '../../services/version.service';
import { HeaderMenuService } from '../../../@core/data/service/header-menu.service'; import { HeaderMenuService } from '../../../@core/data/service/header-menu.service';
@ -17,9 +17,9 @@ import { HeaderMenuService } from '../../../@core/data/service/header-menu.servi
styleUrls: ['./header.component.scss'], styleUrls: ['./header.component.scss'],
templateUrl: './header.component.html', templateUrl: './header.component.html',
}) })
export class NgxLandingHeaderComponent implements OnDestroy { export class NgxLandingHeaderComponent implements OnInit, OnDestroy {
private alive = true; private destroy$ = new Subject<void>();
@HostBinding('class.docs-page') @Input() isDocs = false; @HostBinding('class.docs-page') @Input() isDocs = false;
@ -28,25 +28,25 @@ export class NgxLandingHeaderComponent implements OnDestroy {
currentVersion: string; currentVersion: string;
headerMenu = []; headerMenu = [];
constructor(/*private analytics: NgxAnalytics,*/ constructor(private sidebarService: NbSidebarService,
private sidebarService: NbSidebarService,
private versionService: NgxVersionService, private versionService: NgxVersionService,
private headerMenuService: HeaderMenuService) { private headerMenuService: HeaderMenuService) {
}
ngOnInit() {
this.currentVersion = this.versionService.getNgxVersion(); this.currentVersion = this.versionService.getNgxVersion();
this.headerMenuService.getHeaderMenu() this.headerMenuService.getHeaderMenu()
.pipe(takeWhile(() => this.alive )) .pipe(takeUntil(this.destroy$))
.subscribe((headerMenu) => this.headerMenu = headerMenu); .subscribe((headerMenu) => this.headerMenu = headerMenu);
} }
trackEmailClick() {
}
toggleSidebar() { toggleSidebar() {
this.sidebarService.toggle(false, this.sidebarTag); this.sidebarService.toggle(false, this.sidebarTag);
} }
ngOnDestroy() { ngOnDestroy() {
this.alive = false; this.destroy$.next();
this.destroy$.complete();
} }
} }

View file

@ -30,22 +30,21 @@
</div> </div>
<div class="buttons"> <div class="buttons">
<div class="buttons-links"> <div class="buttons-links">
<a class="btn btn-installation-guidelines"
[routerLink]="'/docs/getting-started/installation-guidelines'">
Installation Docs
</a>
<a class="btn btn-demo" <a class="btn btn-demo"
href="https://www.akveo.com/ngx-admin/pages/dashboard?utm_campaign=ngx_admin%20-%20demo%20-%20ngx_admin%20docs&utm_source=ngx_admin&utm_medium=referral&utm_content=landing_main_section" href="https://www.akveo.com/ngx-admin/pages/dashboard?utm_campaign=ngx_admin%20-%20demo%20-%20ngx_admin%20docs&utm_source=ngx_admin&utm_medium=referral&utm_content=landing_main_section"
target="_blank"> target="_blank">
Demo Demo
</a> </a>
<button (click)="openDownloadDialog()" class="btn btn-download">
Download
</button>
</div> </div>
<button (click)="openDownloadDialog()" class="btn btn-download"> <a href="https://store.akveo.com/pages/ngx-admin-premium?utm_source=ngx_admin&utm_medium=referral&utm_campaign=ngx-admin_premium"
Download target="_blank"
</button> class="btn btn-premium btn-green"
<button (click)="openDownloadPremiumDialog()" class="btn btn-download-premium"> >
Get ngx-admin PREMIUM for 89$ ngx-admin Premium
</button> </a>
</div> </div>
</div> </div>

View file

@ -110,6 +110,8 @@
} }
.buttons { .buttons {
display: flex;
flex-direction: column;
margin-top: 1.875rem; margin-top: 1.875rem;
} }
@ -133,9 +135,7 @@
cursor: pointer; cursor: pointer;
text-transform: uppercase; text-transform: uppercase;
&.btn-demo, &.btn-green {
&.btn-download,
&.btn-download-premium {
color: #ffffff; color: #ffffff;
background-color: nb-theme(color-active-fg); background-color: nb-theme(color-active-fg);
box-shadow: nb-theme(shadow-btn); box-shadow: nb-theme(shadow-btn);
@ -157,13 +157,12 @@
box-shadow: nb-theme(shadow-active-btn); box-shadow: nb-theme(shadow-active-btn);
} }
&.btn-demo { &.btn-download {
margin-left: 1em; margin-left: 1em;
} }
} }
.btn-download, .btn-premium {
.btn-download-premium {
margin-top: 1rem; margin-top: 1rem;
width: 100%; width: 100%;
} }
@ -284,19 +283,6 @@
.buttons { .buttons {
padding-right: 1rem; padding-right: 1rem;
padding-left: 1rem; padding-left: 1rem;
a {
display: block;
margin: 0;
&.btn-demo {
margin-top: 1rem;
}
}
}
.buttons-links {
display: block;
} }
} }
} }

View file

@ -1,15 +1,16 @@
<div style="position: relative;"> <div style="position: relative;">
<nb-badge text="New!" status="danger" position="top right"></nb-badge> <nb-badge text="New!" status="danger" position="top right"></nb-badge>
<a <a
routerLink="/material" routerLink="/material"
class="eva-parent-hover" class="material-theme-link eva-parent-hover"
[nbPopover]="popoverContent" [nbPopover]="popoverContent"
nbPopoverPlacement="bottom" nbPopoverPlacement="bottom"
nbPopoverTrigger="noop" nbPopoverAdjustment="noop"
nbPopoverOffset="0" nbPopoverTrigger="noop"
> nbPopoverOffset="0"
Material Theme >
</a> Material Theme
</a>
</div> </div>
<ng-template #popoverContent> <ng-template #popoverContent>

View file

@ -4,29 +4,71 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*/ */
import { Component, ViewChild, AfterViewInit, Input } from '@angular/core'; import { Component, ViewChild, AfterViewInit, Input, OnDestroy } from '@angular/core';
import { coerceBooleanProperty } from '@angular/cdk/coercion'; import { coerceBooleanProperty } from '@angular/cdk/coercion';
import { NbPopoverDirective } from '@nebular/theme'; import { Subject, merge } from 'rxjs';
import { map, take, takeUntil } from 'rxjs/operators';
import { NbMediaBreakpointsService, NbMediaBreakpoint, NbPopoverDirective, NbThemeService } from '@nebular/theme';
@Component({ @Component({
selector: 'ngx-material-theme-link', selector: 'ngx-material-theme-link',
templateUrl: './material-theme-link.component.html', templateUrl: './material-theme-link.component.html',
styleUrls: ['./material-theme-link.component.scss'], styleUrls: ['./material-theme-link.component.scss'],
}) })
export class MaterialThemeLinkComponent implements AfterViewInit { export class MaterialThemeLinkComponent implements AfterViewInit, OnDestroy {
public showPopover: boolean = false;
@Input() public set withPopover(value: any) { private destroy$ = new Subject<void>();
private hidePopover$ = new Subject<void>();
showPopover: boolean = false;
@Input()
set withPopover(value: any) {
this.showPopover = coerceBooleanProperty(value); this.showPopover = coerceBooleanProperty(value);
} }
@ViewChild(NbPopoverDirective, { static: true }) public popover: NbPopoverDirective; @ViewChild(NbPopoverDirective) popover: NbPopoverDirective;
public ngAfterViewInit(): void { constructor(
this.showPopover && this.popover && this.popover.show(); private breakpointService: NbMediaBreakpointsService,
private themeService: NbThemeService,
) {}
ngAfterViewInit(): void {
if (!this.showPopover) {
return;
}
this.themeService.onMediaQueryChange()
.pipe(
map(([, currentBreakpoint]: NbMediaBreakpoint[]) => this.shouldShowPopover(currentBreakpoint)),
takeUntil(merge(this.destroy$, this.hidePopover$)),
)
.subscribe((showPopover: boolean) => {
if (showPopover) {
this.popover.show();
} else {
this.popover.hide();
}
});
this.hidePopover$
.pipe(
take(1),
takeUntil(this.destroy$),
)
.subscribe(() => this.popover.hide());
} }
public hidePopover(): void { ngOnDestroy() {
this.popover && this.popover.hide(); this.destroy$.next();
}
hidePopover(): void {
this.hidePopover$.next();
}
private shouldShowPopover(breakpoint: NbMediaBreakpoint): boolean {
return breakpoint.width >= this.breakpointService.getByName('is').width;
} }
} }