Repository navigation
feat: Themes feature redesign #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Project Rules | ||
|
|
||
| - **Git Operations**: Always ask the user for explicit confirmation/permission before executing any `git push` command (including pushes to remote branches or pull requests). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| allowBuilds: | ||
| '@firebase/util': set this to true or false | ||
| '@parcel/watcher': set this to true or false | ||
| core-js: set this to true or false | ||
| esbuild: set this to true or false | ||
| lmdb: set this to true or false | ||
| msgpackr-extract: set this to true or false | ||
| protobufjs: set this to true or false |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,9 +3,11 @@ import {Observable} from 'rxjs'; | |
| import {CourseListResponse, Lecture, ManService} from '../man.service'; | ||
| import {Router, RouterLink} from '@angular/router'; | ||
| import {AuthService} from '../auth.service'; | ||
| import {colorByFolderName} from '../../helpers'; | ||
| import {ThemeService} from '../theme.service'; | ||
| import {colorByFolderName, colorByFolderNamePink} from '../../helpers'; | ||
| import {addIcons} from "ionicons"; | ||
| import {logOutOutline} from "ionicons/icons"; | ||
| import {ThemeDropdownComponent} from '../shared/theme-dropdown.component'; | ||
| import { | ||
| IonButton, | ||
| IonButtons, | ||
|
|
@@ -32,12 +34,13 @@ import {AsyncPipe, NgStyle} from '@angular/common'; | |
| selector: 'app-home', | ||
| templateUrl: 'home.page.html', | ||
| styleUrls: ['home.page.scss'], | ||
| imports: [IonHeader, IonToolbar, IonTitle, IonButtons, IonButton, IonIcon, IonContent, IonGrid, IonRow, IonCol, IonCard, RouterLink, NgStyle, IonCardHeader, IonCardTitle, AsyncPipe, IonCardContent, IonItem, IonLabel, IonText, IonSpinner] | ||
| imports: [IonHeader, IonToolbar, IonTitle, IonButtons, IonButton, IonIcon, IonContent, IonGrid, IonRow, IonCol, IonCard, RouterLink, NgStyle, IonCardHeader, IonCardTitle, AsyncPipe, IonCardContent, IonItem, IonLabel, IonText, IonSpinner, ThemeDropdownComponent] | ||
| }) | ||
| export class HomePage implements OnInit { | ||
| private manService = inject(ManService); | ||
| private router = inject(Router); | ||
| private authService = inject(AuthService); | ||
| themeService = inject(ThemeService); | ||
|
|
||
| response$: Observable<CourseListResponse>; | ||
|
|
||
|
|
@@ -56,6 +59,13 @@ export class HomePage implements OnInit { | |
| } | ||
|
|
||
| protected readonly colorByFolderName = colorByFolderName; | ||
| protected readonly colorByFolderNamePink = colorByFolderNamePink; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should not use "Pink" as a variable name. |
||
|
|
||
| getCardColor(folder: string): string { | ||
| return this.themeService.isPinkMode ? colorByFolderNamePink(folder) : colorByFolderName(folder); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should not use "Pink" as a variable name. |
||
| } | ||
|
|
||
|
|
||
|
|
||
| goToLastVideo(lastVideo: Lecture) { | ||
| return this.router.navigate(['home', 'course', lastVideo.course.id]); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,8 +2,11 @@ | |
| <ion-toolbar> | ||
| <ion-back-button slot="start" defaultHref="/home"></ion-back-button> | ||
| <ion-title> | ||
| <span [ngStyle]="{'background-color': colorByFolderName(year)}">{{ year || 'Loading'}}</span> | ||
| <span [ngStyle]="{'background-color': getYearColor()}">{{ year || 'Loading'}}</span> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any reason for the name changes? |
||
| </ion-title> | ||
| <ion-buttons slot="end"> | ||
| <app-theme-dropdown></app-theme-dropdown> | ||
| </ion-buttons> | ||
| </ion-toolbar> | ||
| </ion-header> | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,24 +3,30 @@ import {ActivatedRoute, Router, RouterLink} from '@angular/router'; | |
| import {EMPTY, Observable} from 'rxjs'; | ||
| import {map, switchMap} from 'rxjs/operators'; | ||
| import {ManService} from '../../man.service'; | ||
| import {colorByFolderName} from '../../../helpers'; | ||
| import {IonBackButton, IonContent, IonHeader, IonItem, IonLabel, IonList, IonTitle, IonToolbar} from '@ionic/angular/standalone'; | ||
| import {colorByFolderName, colorByFolderNamePink} from '../../../helpers'; | ||
| import {ThemeService} from '../../theme.service'; | ||
| import {ThemeDropdownComponent} from '../../shared/theme-dropdown.component'; | ||
| import {IonBackButton, IonButton, IonButtons, IonContent, IonHeader, IonIcon, IonItem, IonLabel, IonList, IonTitle, IonToolbar} from '@ionic/angular/standalone'; | ||
| import {AsyncPipe, NgStyle} from '@angular/common'; | ||
|
|
||
| @Component({ | ||
| selector: 'app-list', | ||
| templateUrl: './list.page.html', | ||
| styleUrls: ['./list.page.scss'], | ||
| imports: [IonHeader, IonToolbar, RouterLink, IonBackButton, IonTitle, NgStyle, IonContent, IonList, IonItem, IonLabel, AsyncPipe] | ||
| imports: [IonHeader, IonToolbar, RouterLink, IonBackButton, IonTitle, NgStyle, IonContent, IonList, IonItem, IonLabel, AsyncPipe, IonButtons, ThemeDropdownComponent] | ||
| }) | ||
| export class ListPage implements OnInit { | ||
| private route = inject(ActivatedRoute); | ||
| private router = inject(Router); | ||
| private manService = inject(ManService); | ||
| themeService = inject(ThemeService); | ||
|
|
||
| year: string; | ||
| list$: Observable<{ name: string, is_remote: boolean, id: number, link: string[] }[]>; | ||
|
|
||
| constructor() { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure what this line do. |
||
| } | ||
|
|
||
| ngOnInit() { | ||
| this.list$ = this.route.paramMap.pipe( | ||
| switchMap(s => { | ||
|
|
@@ -40,5 +46,11 @@ export class ListPage implements OnInit { | |
| ); | ||
| } | ||
|
|
||
| getYearColor(): string { | ||
| return this.themeService.isPinkMode ? colorByFolderNamePink(this.year) : colorByFolderName(this.year); | ||
| } | ||
|
|
||
|
|
||
|
|
||
| protected readonly colorByFolderName = colorByFolderName; | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't recommend adding AI-related files yet.