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