Added ability to set config from settings

theme slide toggle is now in top right menu
This commit is contained in:
Isaac Grynsztein
2020-03-05 22:38:23 -05:00
parent e57839e8de
commit ae605d5f70
10 changed files with 273 additions and 8 deletions

View File

@@ -4,7 +4,7 @@ import {FileCardComponent} from './file-card/file-card.component';
import { Observable } from 'rxjs/Observable';
import {FormControl, Validators} from '@angular/forms';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {MatSnackBar} from '@angular/material';
import {MatSnackBar, MatDialog} from '@angular/material';
import { saveAs } from 'file-saver';
import 'rxjs/add/observable/of';
import 'rxjs/add/operator/mapTo';
@@ -18,6 +18,7 @@ import { YoutubeSearchService, Result } from './youtube-search.service';
import { Router } from '@angular/router';
import { OverlayContainer } from '@angular/cdk/overlay';
import { THEMES_CONFIG } from '../themes';
import { SettingsComponent } from './settings/settings.component';
@Component({
selector: 'app-root',
@@ -36,7 +37,7 @@ export class AppComponent implements OnInit {
@ViewChild('urlinput', { read: ElementRef, static: false }) urlInput: ElementRef;
constructor(public postsService: PostsService, public snackBar: MatSnackBar,
constructor(public postsService: PostsService, public snackBar: MatSnackBar, private dialog: MatDialog,
public router: Router, public overlayContainer: OverlayContainer, private elementRef: ElementRef) {
// loading config
@@ -117,5 +118,9 @@ onSetTheme(theme, old_theme) {
goBack() {
this.router.navigate(['/home']);
}
openSettingsDialog() {
const dialogRef = this.dialog.open(SettingsComponent);
}
}