From f74a6e60024a2e3749e3f687af57204979d76364 Mon Sep 17 00:00:00 2001 From: Senyoret1 <34079003+Senyoret1@users.noreply.github.com> Date: Thu, 13 Jul 2023 16:42:54 -0400 Subject: [PATCH] UI improvements --- .../skywire-manager-src/src/app/app.module.ts | 2 + .../tab-selector/tab-selector.component.html | 9 ++++ .../tab-selector/tab-selector.component.scss | 17 ++++++++ .../tab-selector/tab-selector.component.ts | 43 +++++++++++++++++++ .../node-logs/node-logs.component.html | 6 +-- .../node-logs/node-logs.component.scss | 22 ++-------- .../node-apps-list/log/log.component.html | 13 ++++-- .../node-apps-list/log/log.component.scss | 20 +++------ .../skysocks-client-settings.component.html | 15 ++++--- .../skysocks-client-settings.component.scss | 18 +++++++- .../skysocks-client-settings.component.ts | 33 ++++++++++++++ .../src/assets/scss/_dialogs.scss | 24 +++++++++++ 12 files changed, 175 insertions(+), 47 deletions(-) create mode 100644 static/skywire-manager-src/src/app/components/layout/tab-selector/tab-selector.component.html create mode 100644 static/skywire-manager-src/src/app/components/layout/tab-selector/tab-selector.component.scss create mode 100644 static/skywire-manager-src/src/app/components/layout/tab-selector/tab-selector.component.ts diff --git a/static/skywire-manager-src/src/app/app.module.ts b/static/skywire-manager-src/src/app/app.module.ts index 36fc082746..f03105cd29 100644 --- a/static/skywire-manager-src/src/app/app.module.ts +++ b/static/skywire-manager-src/src/app/app.module.ts @@ -101,6 +101,7 @@ import { RewardsAddressComponent } from './components/pages/node/node-info/node- import { BulkRewardAddressChangerComponent } from './components/layout/bulk-reward-address-changer/bulk-reward-address-changer.component'; import { UserAppSettingsComponent } from './components/pages/node/apps/node-apps/user-app-settings/user-app-settings.component'; import { NodeLogsComponent } from './components/pages/node/actions/node-logs/node-logs.component'; +import { TabSelectorComponent } from './components/layout/tab-selector/tab-selector.component'; const globalRippleConfig: RippleGlobalOptions = { disabled: true, @@ -178,6 +179,7 @@ const globalRippleConfig: RippleGlobalOptions = { BulkRewardAddressChangerComponent, UserAppSettingsComponent, NodeLogsComponent, + TabSelectorComponent, ], imports: [ BrowserModule, diff --git a/static/skywire-manager-src/src/app/components/layout/tab-selector/tab-selector.component.html b/static/skywire-manager-src/src/app/components/layout/tab-selector/tab-selector.component.html new file mode 100644 index 0000000000..a1a4b1348f --- /dev/null +++ b/static/skywire-manager-src/src/app/components/layout/tab-selector/tab-selector.component.html @@ -0,0 +1,9 @@ +
diff --git a/static/skywire-manager-src/src/app/components/layout/tab-selector/tab-selector.component.scss b/static/skywire-manager-src/src/app/components/layout/tab-selector/tab-selector.component.scss new file mode 100644 index 0000000000..93db0b5af2 --- /dev/null +++ b/static/skywire-manager-src/src/app/components/layout/tab-selector/tab-selector.component.scss @@ -0,0 +1,17 @@ +.top-dialog-button{ + .top-dialog-button-content { + display: flex; + + .tab-name { + flex-grow: 1; + margin-right: 10px; + align-self: center; + } + + .icon { + font-size: 20px; + flex-shrink: 0; + align-self: center; + } + } +} diff --git a/static/skywire-manager-src/src/app/components/layout/tab-selector/tab-selector.component.ts b/static/skywire-manager-src/src/app/components/layout/tab-selector/tab-selector.component.ts new file mode 100644 index 0000000000..b029719a9a --- /dev/null +++ b/static/skywire-manager-src/src/app/components/layout/tab-selector/tab-selector.component.ts @@ -0,0 +1,43 @@ +import { Component, EventEmitter, Input, OnDestroy, Output } from '@angular/core'; +import { SelectOptionComponent, SelectableOption } from '../select-option/select-option.component'; +import { MatDialog } from '@angular/material/dialog'; + +/** + * Button for changing the selected tab of an app-tab-selector component in small screens. + */ +@Component({ + selector: 'app-tab-selector', + templateUrl: './tab-selector.component.html', + styleUrls: ['./tab-selector.component.scss'] +}) +export class TabSelectorComponent implements OnDestroy { + // Name of the available tabs, for the translation pipe. + @Input() tabNames: string[] = ['']; + // Index of the currently selected tab. + @Input() selectedTab = 0; + // Event emited if the user selects a different tab. The selectedTab var is not + // updated automatically when this event is sent. + @Output() tabChanged = new EventEmitter