Skip to content

Commit

Permalink
Implement working with sercvice page
Browse files Browse the repository at this point in the history
  • Loading branch information
farengeyt451 committed Sep 2, 2023
1 parent 41583fa commit e738ef8
Show file tree
Hide file tree
Showing 13 changed files with 539 additions and 3 deletions.
5 changes: 5 additions & 0 deletions projects/ngx-tippy-demo/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
import { ServiceComponent } from '@pages/service';
import { AppContentComponent } from 'projects/ngx-tippy-demo/src/app/pages/app-content';
import { GettingStartedComponent } from 'projects/ngx-tippy-demo/src/app/pages/getting-started';
import { PropsComponent } from 'projects/ngx-tippy-demo/src/app/pages/props';
Expand Down Expand Up @@ -27,6 +28,10 @@ export const routes: Routes = [
path: 'applying-content',
component: AppContentComponent,
},
{
path: 'working-with-service',
component: ServiceComponent,
},
];

@NgModule({
Expand Down
5 changes: 4 additions & 1 deletion projects/ngx-tippy-demo/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { ContentComponent } from '@pages/content';
import { GettingStartedComponent } from '@pages/getting-started';
import { NotSupportedComponent } from '@pages/not-supported';
import { PropsComponent } from '@pages/props';
import { ServiceComponent } from '@pages/service';
import { UsageComponent } from '@pages/usage';
import { SchemeService } from '@services';
import { TuiLetModule } from '@taiga-ui/cdk';
Expand All @@ -30,7 +31,7 @@ import {
TuiSvgModule,
TuiThemeNightModule,
} from '@taiga-ui/core';
import { TuiAccordionModule, TuiBadgeModule, TuiInputModule } from '@taiga-ui/kit';
import { TuiAccordionModule, TuiBadgeModule, TuiInputModule, TuiIslandModule } from '@taiga-ui/kit';
import { NgDompurifySanitizer } from '@tinkoff/ng-dompurify';
import { HIGHLIGHT_OPTIONS, HighlightModule } from 'ngx-highlightjs';
import { NgxTippyModule } from 'ngx-tippy-wrapper';
Expand All @@ -57,6 +58,7 @@ function initialize(SchemeService: SchemeService) {
NotSupportedComponent,
PropsComponent,
AppContentComponent,
ServiceComponent,
],
imports: [
AppRoutingModule,
Expand All @@ -72,6 +74,7 @@ function initialize(SchemeService: SchemeService) {
TuiButtonModule,
TuiDialogModule,
TuiExpandModule,
TuiIslandModule,
TuiInputModule,
TuiLetModule,
TuiLinkModule,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div
class="demo"
class="demo {{customClass}}"
#content
>
<ng-content></ng-content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,9 @@
border-radius: 0.75rem;
@include transition-color-bgc;
}

.demo.service {
display: flex;
justify-content: space-between;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core';
import { Schemes } from '@interfaces';
import { DestroyService, SchemeService } from '@services';
import { NgxTippyInstance, NgxTippyService } from 'ngx-tippy-wrapper';
Expand All @@ -12,6 +12,7 @@ import { takeUntil } from 'rxjs';
providers: [DestroyService],
})
export class DemoComponent implements OnInit, AfterViewInit {
@Input() customClass!: string;
@ViewChild('content', { read: ElementRef }) projectedContent!: ElementRef;

constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ $animation-time: 3s;
}

.header__support-icon--coffee {
background: var(--tui-base-03);
padding: 0.75rem;
border-radius: 50%;
display: none;
color: var(--tui-text-02);
opacity: 0.8;
Expand Down
56 changes: 56 additions & 0 deletions projects/ngx-tippy-demo/src/app/components/nav/nav.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,61 @@
</ul>
</tui-expand>
</li>

<li class="nav__item">
<a
class="nav__link"
tuiLink
routerLink="/working-with-service"
routerLinkActive="nav__link--active"
>
Working with service
</a>

<tui-expand [expanded]="isSubListExpanded">
<ul class="nav__sub-list">
<li class="nav__sub-item">
<a
class="nav__link"
tuiLink
routerLink="/working-with-service"
fragment="additional_methods"
routerLinkActive="nav__link--active"
[routerLinkActiveOptions]="linkActiveOptions"
(click)="onFragmentNav('additional_methods')"
>
Additional methods
</a>
</li>
<li class="nav__sub-item">
<a
class="nav__link"
tuiLink
routerLink="/working-with-service"
fragment="static_methods"
routerLinkActive="nav__link--active"
[routerLinkActiveOptions]="linkActiveOptions"
(click)="onFragmentNav('static_methods')"
>
Static methods
</a>
</li>
<li class="nav__sub-item">
<a
class="nav__link"
tuiLink
routerLink="/working-with-service"
fragment="subscription_instances_changes"
routerLinkActive="nav__link--active"
[routerLinkActiveOptions]="linkActiveOptions"
(click)="onFragmentNav('subscription_instances_changes')"
>
Subscription to instances changes
</a>
</li>
</ul>
</tui-expand>

</li>
</ul>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { ServiceComponent } from '../service.component';

describe('ServiceComponent', () => {
let component: ServiceComponent;
let fixture: ComponentFixture<ServiceComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ServiceComponent],
}).compileComponents();

fixture = TestBed.createComponent(ServiceComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
1 change: 1 addition & 0 deletions projects/ngx-tippy-demo/src/app/pages/service/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { ServiceComponent } from './service.component';
Loading

0 comments on commit e738ef8

Please sign in to comment.