Skip to content

Commit

Permalink
Merge pull request #14 from sefatanam/3-user-should-be-able-to-make-p…
Browse files Browse the repository at this point in the history
…rivate-playlist

chore(UI): user interactive issue fixed
  • Loading branch information
sefatanam authored Feb 4, 2024
2 parents 58b56e2 + 5a7617b commit c5c62b9
Show file tree
Hide file tree
Showing 10 changed files with 201 additions and 111 deletions.
116 changes: 58 additions & 58 deletions src/app/components/header/header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,114 +19,114 @@
<!--TODO: will be remove in future-->
<ng-container *ngTemplateOutlet="personal_playlist_route"></ng-container>
@for (routeMenu of routeMenus;track $index) {
@if (routeMenu.isAvailable) {
<li class="header__options--item" title="{{routeMenu.name}}">
<app-button>
<a [routerLink]="routeMenu.route" [queryParams]="routeMenu?.queryParams">{{ routeMenu.name }}</a>
</app-button>
</li>
}
@if (routeMenu.isAvailable) {
<li class="header__options--item" title="{{routeMenu.name}}">
<app-button>
<a [routerLink]="routeMenu.route" [queryParams]="routeMenu?.queryParams">{{ routeMenu.name }}</a>
</app-button>
</li>
}
} @empty {
<li class="header__options--item">
<a routerLink="#">{{ emptyMessage }}</a>
</li>
<li class="header__options--item">
<a routerLink="#">{{ emptyMessage }}</a>
</li>
}
</ul>
</ng-template>

<ng-template #header_buttons>
<ul class="header__options header__options--web">
@if (!user()) {
<ng-container *ngTemplateOutlet="route_buttons_container"></ng-container>
<ng-container *ngTemplateOutlet="route_buttons_container"></ng-container>
} @else if (user()) {
<ng-container *ngTemplateOutlet="auth_Buttons"></ng-container>
<ng-container *ngTemplateOutlet="auth_Buttons"></ng-container>
}
</ul>
</ng-template>

<ng-template #header_buttons_phone>
<ul class="header__options header__options--phone">
@if (!user()) {
<ng-container *ngTemplateOutlet="route_buttons_container"></ng-container>
<ng-container *ngTemplateOutlet="route_buttons_container"></ng-container>
} @else if (user()) {
<ng-container *ngTemplateOutlet="auth_Buttons"></ng-container>
<ng-container *ngTemplateOutlet="auth_Buttons"></ng-container>
}
</ul>
</ng-template>

<ng-template #route_buttons_container>
@for (routeButton of routeButtons;track $index) {
@if (routeButton.isAvailable) {
<li title="{{routeButton.name}}">
<a mat-raised-button color="accent" [routerLink]="routeButton.route"
[queryParams]="routeButton?.queryParams">{{ routeButton.name }}</a>
</li>
}
@if (routeButton.isAvailable) {
<li title="{{routeButton.name}}">
<a mat-raised-button color="accent" [routerLink]="routeButton.route" [queryParams]="routeButton?.queryParams">{{
routeButton.name }}</a>
</li>
}
} @empty {
<li>
<a mat-raised-button color="accent" routerLink="#">{{ emptyMessage }}</a>
</li>
<li>
<a mat-raised-button color="accent" routerLink="#">{{ emptyMessage }}</a>
</li>
}
<li title="Toggle Theme">
<a mat-raised-button color="accent" (click)="toggleTheme()">
@if (isDarkThemeEnable) {
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z" />
</svg>
} @else {
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z" />
</svg>
}
</a>
</li>
</ng-template>

<ng-template #menu_icon>
<svg title="Open Side Menu" (click)="onMenuClick.emit()" xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" data-slot="icon" class="w-6 h-6 dark:text-white">
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"/>
viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" data-slot="icon" class="w-6 h-6 dark:text-white">
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" />
</svg>
</ng-template>

<ng-template #auth_Buttons>
<li title="Go to Public Playlist">
<a mat-raised-button color="accent" routerLink="public" class="flex items-center gap-2">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />
<path stroke-linecap="round" stroke-linejoin="round"
d="M15.91 11.672a.375.375 0 0 1 0 .656l-5.603 3.113a.375.375 0 0 1-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112Z"/>
d="M15.91 11.672a.375.375 0 0 1 0 .656l-5.603 3.113a.375.375 0 0 1-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112Z" />
</svg>
<p class="hidden md:block">{{ authService.authUser()?.displayName }}</p>
</a>
</li>
<li title="Toggle Theme">
<app-button>
@if (isDarkThemeEnable) {
<svg (click)="toggleTheme()" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"/>
</svg>
<svg (click)="toggleTheme()" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z" />
</svg>
} @else {
<svg (click)="toggleTheme()" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"/>
</svg>
<svg (click)="toggleTheme()" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z" />
</svg>
}
</app-button>
</li>
<li title="Log Out" class="logout-button">
<app-button>
<svg (click)="kickOut()" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M5.636 5.636a9 9 0 1 0 12.728 0M12 3v9"/>
<svg (click)="kickOut()" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M5.636 5.636a9 9 0 1 0 12.728 0M12 3v9" />
</svg>
</app-button>
</li>
Expand All @@ -135,10 +135,10 @@

<ng-template #personal_playlist_route>
@if(authService.authUser(); as authUser){
<li class="header__options--item" title="Personal Playlist">
<app-button>
<a routerLink="/personal" [queryParams]="{uid: authUser?.uid}">Personal</a>
</app-button>
</li>
<li class="header__options--item" title="Personal Playlist">
<app-button>
<a routerLink="/personal" [queryParams]="{uid: authUser?.uid}">Personal Playlist</a>
</app-button>
</li>
}
</ng-template>
</ng-template>
8 changes: 4 additions & 4 deletions src/app/components/header/header.component.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import "../../../styles/media.scss";

@mixin header-common {
@apply border-b border-b-gray p-4;
@apply p-4;
.header {
&__options {
&--icon {
Expand Down Expand Up @@ -66,11 +66,11 @@
}
}

.logout-button{
@include for-phone{
.logout-button {
@include for-phone {
@apply hidden;
}
@include for-web{
@include for-web {
@apply block;
}
}
90 changes: 60 additions & 30 deletions src/app/components/mobile-menus/mobile-menus.component.html
Original file line number Diff line number Diff line change
@@ -1,44 +1,74 @@
<div tabindex="0" class="menus-wrapper">
<ul class="mobile__menus" (click)="onMenuItemClick.emit()">
<li class="mobile__menus--item">
<app-button>
<h1 class="title animated-text ">Re.Tube</h1>
</app-button>
</li>
<div class="pb-4"></div>
@if (authService.authUser();as authUser) {
<li class="mobile__menus--item">
<app-button>
<a routerLink="/personal" [queryParams]="{uid: authUser?.uid}">Personal</a>
</app-button>
</li>
<li class="mobile__menus--item">
<app-button>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6">
<path fill-rule="evenodd"
d="M17.834 6.166a8.25 8.25 0 1 0 0 11.668.75.75 0 0 1 1.06 1.06c-3.807 3.808-9.98 3.808-13.788 0-3.808-3.807-3.808-9.98 0-13.788 3.807-3.808 9.98-3.808 13.788 0A9.722 9.722 0 0 1 21.75 12c0 .975-.296 1.887-.809 2.571-.514.685-1.28 1.179-2.191 1.179-.904 0-1.666-.487-2.18-1.164a5.25 5.25 0 1 1-.82-6.26V8.25a.75.75 0 0 1 1.5 0V12c0 .682.208 1.27.509 1.671.3.401.659.579.991.579.332 0 .69-.178.991-.579.3-.4.509-.99.509-1.671a8.222 8.222 0 0 0-2.416-5.834ZM15.75 12a3.75 3.75 0 1 0-7.5 0 3.75 3.75 0 0 0 7.5 0Z"
clip-rule="evenodd" />
</svg>

<a routerLink="/personal" [queryParams]="{uid: authUser?.uid}">Personal Playlist</a>
</app-button>
</li>
}
@for (item of menus.routeMenus;track $index) {
@if(item.isAvailable){
<li class="mobile__menus--item">
<app-button>
<a [routerLink]="item.route">{{ item.name }}</a>
</app-button>
</li>
}
@if(item.isAvailable){
<li class="mobile__menus--item">
<app-button>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M12.75 19.5v-.75a7.5 7.5 0 0 0-7.5-7.5H4.5m0-6.75h.75c7.87 0 14.25 6.38 14.25 14.25v.75M6 18.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z" />
</svg>


<a [routerLink]="item.route">{{ item.name }}</a>
</app-button>
</li>
}
} @empty {
<li class="mobile__menus--item">
<app-button>
<a routerLink="#">No Permission's Menu 😕</a>
</app-button>
</li>
<li class="mobile__menus--item">
<app-button>
<a routerLink="#">No Permission's Menu 😕</a>
</app-button>
</li>
}
</ul>

<ul class="mobile__menus">
@if (!authService.authUser()) {
@for (item of menus.routeButtons;track $index) {
<li class="mobile__menus--item">
<app-button>
<a [routerLink]="item.route">{{ item.name }}</a>
</app-button>
</li>
}
@for (item of menus.routeButtons;track $index) {
<li class="mobile__menus--item">
<app-button>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M18 7.5v3m0 0v3m0-3h3m-3 0h-3m-2.25-4.125a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0ZM3 19.235v-.11a6.375 6.375 0 0 1 12.75 0v.109A12.318 12.318 0 0 1 9.374 21c-2.331 0-4.512-.645-6.374-1.766Z" />
</svg>
<a [routerLink]="item.route">{{ item.name }}</a>
</app-button>
</li>
}
} @else if (authService.authUser()) {
<li class="mobile__menus--item">
<app-button>
<a (click)="kickOut()">Log Out {{ authService.authUser()?.displayName }} </a>
</app-button>
</li>
<li class="mobile__menus--item">
<app-button>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M8.25 9V5.25A2.25 2.25 0 0 1 10.5 3h6a2.25 2.25 0 0 1 2.25 2.25v13.5A2.25 2.25 0 0 1 16.5 21h-6a2.25 2.25 0 0 1-2.25-2.25V15m-3 0-3-3m0 0 3-3m-3 3H15" />
</svg>

<a (click)="kickOut()">Log Out</a>
</app-button>
</li>
}
</ul>
</div>
</div>
22 changes: 15 additions & 7 deletions src/app/components/mobile-menus/mobile-menus.component.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
.menus-wrapper{
@apply h-dvh flex flex-col justify-between;
.menus-wrapper {
@apply h-dvh flex flex-col justify-between py-8;
}
.mobile__menus{
@apply flex flex-col;
&--item{
@apply flex items-center p-2;
}
.mobile__menus {
@apply flex flex-col;
&--item {
@apply flex items-center p-2;
}
}

.title {
overflow-wrap: break-word;
font-size: 1.875rem;
line-height: 2.25rem;
font-weight: 700;
--tw-text-opacity: 1;
}
2 changes: 1 addition & 1 deletion src/app/pages/personal/personal.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</app-player>
<ng-template #form_accordion>
<mat-accordion>
<mat-expansion-panel>
<mat-expansion-panel #panel (click)="$event.stopPropagation()">
<mat-expansion-panel-header>
<p class="accordion-title">
@if (!authUser()) {
Expand Down
27 changes: 27 additions & 0 deletions src/app/pages/personal/personal.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@import "../../../styles/media.scss";

// Temporary

.player-limited {
@apply grid gap-4 row-start-2 mt-10;
&-text {
@apply text-xs italic;
}
&-title {
@apply font-semibold;
}
form {
@apply grid gap-2;
}
}

@include for-web {
.player-limited {
@apply bg-greenish dark:bg-black rounded-xl p-4 w-2/3;
form {
button {
@apply w-1/5;
}
}
}
}
Loading

0 comments on commit c5c62b9

Please sign in to comment.