diff --git a/src/app/player/components/video-player/sidebar/sidebar.component.html b/src/app/player/components/video-player/sidebar/sidebar.component.html new file mode 100644 index 000000000..bcbf20963 --- /dev/null +++ b/src/app/player/components/video-player/sidebar/sidebar.component.html @@ -0,0 +1,50 @@ +
+
+ +
+
+ + {{ playlistTitle$ | async }} + + + {{ 'HOME.PLAYLISTS.MY_PLAYLISTS' | translate }} + +
+
+ {{ + sidebarView === 'CHANNELS' + ? channels.length + ' channels' + : 'all available playlists' + }} +
+
+ + +
+
+ + + + + + diff --git a/src/app/player/components/video-player/sidebar/sidebar.component.scss b/src/app/player/components/video-player/sidebar/sidebar.component.scss new file mode 100644 index 000000000..429fa55c6 --- /dev/null +++ b/src/app/player/components/video-player/sidebar/sidebar.component.scss @@ -0,0 +1,47 @@ + +#playlists-navigation { + background-color: #000; + color: #fff; + + .current-playlist { + display: flex; + align-items: center; + padding: 8px; + } + + .playlist-info { + flex: 1; + max-width: 300px; + + .name { + font-size: 1.1em; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .channels-count { + font-size: 0.8em; + color: #ccc; + } + } +} + +.recent-playlists { + height: calc(100vh - 60px); + overflow: auto; + width: 100%; + display: block; +} + +.electron { + height: calc(100vh - 85px) !important; +} + +@media only screen and (max-width: 480px) { + .playlist-info { + .name { + max-width: 105px; + } + } +} diff --git a/src/app/player/components/video-player/sidebar/sidebar.component.ts b/src/app/player/components/video-player/sidebar/sidebar.component.ts new file mode 100644 index 000000000..3b8801d28 --- /dev/null +++ b/src/app/player/components/video-player/sidebar/sidebar.component.ts @@ -0,0 +1,40 @@ +import { Component, Input } from '@angular/core'; +import { Router } from '@angular/router'; +import { Store } from '@ngrx/store'; +import { Channel } from '../../../../../../shared/channel.interface'; +import { DataService } from '../../../../services/data.service'; +import { selectPlaylistTitle } from '../../../../state/selectors'; +import { SidebarView } from '../video-player.component'; + +@Component({ + selector: 'app-sidebar', + templateUrl: './sidebar.component.html', + styleUrls: ['./sidebar.component.scss'], +}) +export class SidebarComponent { + @Input() channels: Channel[] = []; + + isElectron = this.dataService.isElectron; + + playlistTitle$ = this.store.select(selectPlaylistTitle); + + sidebarView: SidebarView = 'CHANNELS'; + + constructor( + private dataService: DataService, + private router: Router, + private store: Store + ) {} + + goBack(): void { + if (this.sidebarView === 'PLAYLISTS') { + this.router.navigate(['/']); + } else { + this.sidebarView = 'PLAYLISTS'; + } + } + + selectPlaylist() { + this.sidebarView = 'CHANNELS'; + } +}