From c53520ea00e9bfc466a4495af6cd9e255d80d256 Mon Sep 17 00:00:00 2001 From: 4gray Date: Sun, 30 Jan 2022 12:35:23 +0100 Subject: [PATCH] style: improve settings layout --- src/app/settings/settings.component.html | 349 +++++++++++--------- src/app/settings/settings.component.scss | 21 ++ src/app/settings/settings.component.spec.ts | 40 +-- 3 files changed, 227 insertions(+), 183 deletions(-) diff --git a/src/app/settings/settings.component.html b/src/app/settings/settings.component.html index 019c843ef..267541b89 100644 --- a/src/app/settings/settings.component.html +++ b/src/app/settings/settings.component.html @@ -1,166 +1,187 @@ - -
- - -
- {{ 'SETTINGS.DESCRIPTION' | translate }} -
-
- - - -
-

{{ 'SETTINGS.EPG_URL_LABEL' | translate }}

-

- - + + +

+ + + + + +
+

+ {{ 'SETTINGS.EPG_URL_LABEL' | translate }} +

+

+ + + + +

+
+

+
+ +
+

+ {{ + 'SETTINGS.VIDEO_PLAYER_LABEL' | translate - " - matInput - type="url" - formControlName="epgUrl" - /> - - -

-
-

-
- -
-

- {{ 'SETTINGS.VIDEO_PLAYER_LABEL' | translate }} -

-

- - {{ - 'SETTINGS.VIDEO_PLAYER_PLACEHOLDER' - | translate - }} - - {{ player.label }} - - - -

-
-
- -
-

- {{ 'SETTINGS.LANGUAGE' | translate }} -

-

- - {{ - 'SETTINGS.VIDEO_PLAYER_PLACEHOLDER' - | translate - }} - - {{ - 'LANGUAGES.' + language.key + }} +

+

+ + {{ + 'SETTINGS.VIDEO_PLAYER_PLACEHOLDER' | translate - }} - - -

-
-
- -
-

{{ 'SETTINGS.THEME' | translate }}

-

- - {{ - 'SETTINGS.VIDEO_PLAYER_PLACEHOLDER' - | translate - }} - - {{ - 'THEMES.' + theme.value | translate - }} - - -

-
-
- -
-

{{ 'SETTINGS.SHOW_CAPTIONS' | translate }}

-

- -

-
-
- -
-

{{ 'SETTINGS.VERSION' | translate }}

-

- {{ version }}
- {{ updateMessage }} -

-
-
- EPG is available in electron-based version of IPTVnator. Check it here -
-
- - -
- -
-
- + }} + + {{ player.label }} + + + +

+
+ + +
+

+ {{ 'SETTINGS.LANGUAGE' | translate }} +

+

+ + {{ + 'SETTINGS.VIDEO_PLAYER_PLACEHOLDER' + | translate + }} + + {{ + 'LANGUAGES.' + language.key + | translate + }} + + +

+
+
+ +
+

{{ 'SETTINGS.THEME' | translate }}

+

+ + {{ + 'SETTINGS.VIDEO_PLAYER_PLACEHOLDER' + | translate + }} + + {{ + 'THEMES.' + theme.value + | translate + }} + + +

+
+
+ +
+

+ {{ 'SETTINGS.SHOW_CAPTIONS' | translate }} +

+

+ +

+
+
+ +
+

+ {{ 'SETTINGS.VERSION' | translate }} +

+

+ {{ version }}
+ {{ updateMessage }} +

+
+
+ EPG is available in electron-based version of + IPTVnator. Check it here + + + + + + + + + +
+ diff --git a/src/app/settings/settings.component.scss b/src/app/settings/settings.component.scss index d6effb1c2..2f8190d91 100644 --- a/src/app/settings/settings.component.scss +++ b/src/app/settings/settings.component.scss @@ -1,4 +1,5 @@ .card-header { + margin-top: 15px; margin-bottom: 15px; } @@ -14,3 +15,23 @@ button { .mat-list-item { height: 70px !important; } + +.main-container { + display: grid; + grid-template-rows: 105px auto; + height: calc(100vh - 105px); +} + +.settings-container { + overflow: auto; + height: calc(100vh - 140px); + + .mat-card { + box-shadow: none; + background: none; + } +} + +.mat-form-field { + width: 100%; +} diff --git a/src/app/settings/settings.component.spec.ts b/src/app/settings/settings.component.spec.ts index f23f30ba0..798578996 100644 --- a/src/app/settings/settings.component.spec.ts +++ b/src/app/settings/settings.component.spec.ts @@ -1,29 +1,30 @@ +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatCardModule } from '@angular/material/card'; import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatSelectModule } from '@angular/material/select'; +import { MatSnackBar } from '@angular/material/snack-bar'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { Router } from '@angular/router'; +import { RouterTestingModule } from '@angular/router/testing'; import { StorageMap } from '@ngx-pwa/local-storage'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; +import { MockComponent, MockModule, MockPipe } from 'ng-mocks'; +import { of } from 'rxjs'; +import { EPG_FETCH } from '../../../shared/ipc-commands'; /* eslint-disable @typescript-eslint/unbound-method */ import { DataService } from '../services/data.service'; import { ElectronServiceStub } from '../services/electron.service.stub'; -import { MatSelectModule } from '@angular/material/select'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatListModule } from '@angular/material/list'; -import { MatCardModule } from '@angular/material/card'; -import { HeaderComponent } from './../shared/components/header/header.component'; import { TranslateServiceStub } from './../../testing/translate.stub'; -import { RouterTestingModule } from '@angular/router/testing'; -import { SettingsComponent } from './settings.component'; -import { MatTooltipModule } from '@angular/material/tooltip'; -import { TranslatePipe, TranslateService } from '@ngx-translate/core'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { MockModule, MockPipe, MockComponent } from 'ng-mocks'; -import { MatIconModule } from '@angular/material/icon'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import { FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { EPG_FETCH } from '../../../shared/ipc-commands'; -import { Router } from '@angular/router'; -import { of } from 'rxjs'; -import { VideoPlayer } from './settings.interface'; +import { HeaderComponent } from './../shared/components/header/header.component'; import { Language } from './language.enum'; +import { SettingsComponent } from './settings.component'; +import { VideoPlayer } from './settings.interface'; import { Theme } from './theme.enum'; class MatSnackBarStub { @@ -86,6 +87,7 @@ describe('SettingsComponent', () => { MockModule(MatListModule), MockModule(MatFormFieldModule), MockModule(MatCheckboxModule), + MockModule(MatDividerModule), ], }).compileComponents(); })