From 131fdea0c5bd8dd7e783f9708ec45cc144efe5bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Kiss?= Date: Sat, 15 Jul 2017 14:41:06 +0200 Subject: [PATCH] refactor: Create uhk-header component (#354) Create a header wrapper component that will contains the undo notification component. --- electron/src/app.module.ts | 6 +- .../header/keymap-header.component.html | 79 ++++++++++--------- .../macro/header/macro-header.component.html | 50 ++++++------ .../not-found/macro-not-found.component.html | 3 +- .../src/components/uhk-header/uhk-header.html | 3 + .../src/components/uhk-header/uhk-header.ts | 9 +++ web/src/app.module.ts | 6 +- 7 files changed, 89 insertions(+), 67 deletions(-) create mode 100644 shared/src/components/uhk-header/uhk-header.html create mode 100644 shared/src/components/uhk-header/uhk-header.ts diff --git a/electron/src/app.module.ts b/electron/src/app.module.ts index 9a4057a7..f4fa9cb1 100644 --- a/electron/src/app.module.ts +++ b/electron/src/app.module.ts @@ -105,7 +105,8 @@ import { ElectronErrorHandlerService } from './services/electron-error-handler.s import { AppUpdateRendererService } from './services/app-update-renderer.service'; import { reducer } from './store'; import { AutoUpdateSettings } from './shared/components/auto-update-settings/auto-update-settings'; -import { angularNotifierConfig } from '../../shared/src/models/angular-notifier-config'; +import { angularNotifierConfig } from './shared/models/angular-notifier-config'; +import { UhkHeader } from './shared/components/uhk-header/uhk-header'; @NgModule({ declarations: [ @@ -163,7 +164,8 @@ import { angularNotifierConfig } from '../../shared/src/models/angular-notifier- TooltipDirective, SafeStylePipe, UpdateAvailableComponent, - AutoUpdateSettings + AutoUpdateSettings, + UhkHeader ], imports: [ BrowserModule, diff --git a/shared/src/components/keymap/header/keymap-header.component.html b/shared/src/components/keymap/header/keymap-header.component.html index aa24f28b..9423fe03 100644 --- a/shared/src/components/keymap/header/keymap-header.component.html +++ b/shared/src/components/keymap/header/keymap-header.component.html @@ -1,39 +1,42 @@ -
-

- - keymap - ( +
+

+ + keymap + () - - - - -

-
+ + + + +

+
+ diff --git a/shared/src/components/macro/header/macro-header.component.html b/shared/src/components/macro/header/macro-header.component.html index aec88669..975807dc 100644 --- a/shared/src/components/macro/header/macro-header.component.html +++ b/shared/src/components/macro/header/macro-header.component.html @@ -1,24 +1,26 @@ -
-

- - - - -

-
\ No newline at end of file + +
+

+ + + + +

+
+
diff --git a/shared/src/components/macro/not-found/macro-not-found.component.html b/shared/src/components/macro/not-found/macro-not-found.component.html index 3137c345..6cc47565 100644 --- a/shared/src/components/macro/not-found/macro-not-found.component.html +++ b/shared/src/components/macro/not-found/macro-not-found.component.html @@ -1,3 +1,4 @@ +
You don't have any macros. Try to add one! -
\ No newline at end of file + diff --git a/shared/src/components/uhk-header/uhk-header.html b/shared/src/components/uhk-header/uhk-header.html new file mode 100644 index 00000000..93af3044 --- /dev/null +++ b/shared/src/components/uhk-header/uhk-header.html @@ -0,0 +1,3 @@ +
+ +
diff --git a/shared/src/components/uhk-header/uhk-header.ts b/shared/src/components/uhk-header/uhk-header.ts new file mode 100644 index 00000000..7e466b1d --- /dev/null +++ b/shared/src/components/uhk-header/uhk-header.ts @@ -0,0 +1,9 @@ +import { ChangeDetectionStrategy, Component } from '@angular/core'; + +@Component({ + selector: 'uhk-header', + templateUrl: './uhk-header.html', + changeDetection: ChangeDetectionStrategy.OnPush +}) +export class UhkHeader { +} diff --git a/web/src/app.module.ts b/web/src/app.module.ts index 693f80ad..8ff4a14c 100644 --- a/web/src/app.module.ts +++ b/web/src/app.module.ts @@ -86,7 +86,8 @@ import { DefaultUserConfigurationService } from './shared/services/default-user- import { reducer } from './shared/store/reducers/index'; import { LogService } from './shared/services/logger.service'; import { AutoUpdateSettings } from './shared/components/auto-update-settings/auto-update-settings'; -import { angularNotifierConfig } from '../../shared/src/models/angular-notifier-config'; +import { angularNotifierConfig } from './shared/models/angular-notifier-config'; +import { UhkHeader } from './shared/components/uhk-header/uhk-header'; @NgModule({ declarations: [ @@ -139,7 +140,8 @@ import { angularNotifierConfig } from '../../shared/src/models/angular-notifier- CancelableDirective, TooltipDirective, SafeStylePipe, - AutoUpdateSettings + AutoUpdateSettings, + UhkHeader ], imports: [ BrowserModule,