diff --git a/client/src/app/core/auth/auth.component.html b/client/src/app/core/auth/auth.component.html index ba795ca..ea5fa01 100644 --- a/client/src/app/core/auth/auth.component.html +++ b/client/src/app/core/auth/auth.component.html @@ -1,4 +1,4 @@ -
+
- + + diff --git a/client/src/app/core/layout/header.component.ts b/client/src/app/core/layout/header.component.ts index b33cca1..47ed807 100644 --- a/client/src/app/core/layout/header.component.ts +++ b/client/src/app/core/layout/header.component.ts @@ -1,12 +1,28 @@ -import { NgIf } from '@angular/common'; -import { Component } from '@angular/core'; +import { DatePipe, NgIf } from '@angular/common'; +import { Component, Input, OnInit } from '@angular/core'; +import { User } from '../models/user.model'; +import { GoogleButtonComponent } from 'src/app/shared/googleButton/googleButton.component'; +import { UserService } from '../services/user.service'; @Component({ selector: 'app-layout-header', templateUrl: './header.component.html', - imports: [NgIf], + imports: [NgIf, GoogleButtonComponent, DatePipe], standalone: true, }) -export class HeaderComponent { - constructor() {} +export class HeaderComponent implements OnInit { + user: User | null = null; + date: Date = new Date(); + isMenuOpen = false; + label = 'Menu'; + + constructor(private userService: UserService) {} + + ngOnInit(): void { + this.userService.currentUser.subscribe((user) => (this.user = user)); + } + + closeMenu(): void { + this.isMenuOpen = false; + } } diff --git a/client/src/app/core/layout/layout.component.html b/client/src/app/core/layout/layout.component.html index 51d2dd0..e81da18 100644 --- a/client/src/app/core/layout/layout.component.html +++ b/client/src/app/core/layout/layout.component.html @@ -2,4 +2,4 @@ - + diff --git a/client/src/app/shared/googleButton/googleButton.component.ts b/client/src/app/shared/googleButton/googleButton.component.ts new file mode 100644 index 0000000..b1ea983 --- /dev/null +++ b/client/src/app/shared/googleButton/googleButton.component.ts @@ -0,0 +1,27 @@ +import { Component } from '@angular/core'; +import { environment } from 'src/environments/environment'; + +@Component({ + selector: 'app-google-button', + template: ` + + `, + standalone: true, +}) +export class GoogleButtonComponent { + loginWithGoogle(): void { + // redirect to google login in server + window.location.href = environment.api + '/auth/google'; + } +} diff --git a/client/src/index.html b/client/src/index.html index 76fb30c..952d256 100644 --- a/client/src/index.html +++ b/client/src/index.html @@ -7,6 +7,10 @@ + diff --git a/client/src/styles.css b/client/src/styles.css index 5dbc40a..7aede27 100644 --- a/client/src/styles.css +++ b/client/src/styles.css @@ -1,4 +1,5 @@ /* You can add global styles to this file, and also import other style files */ @tailwind base; @tailwind components; -@tailwind utilities; \ No newline at end of file +@tailwind utilities; +@import url('https://fonts.googleapis.com/css?family=Kanit'); \ No newline at end of file diff --git a/client/tailwind.config.js b/client/tailwind.config.js index 5397866..5a571e2 100644 --- a/client/tailwind.config.js +++ b/client/tailwind.config.js @@ -2,7 +2,14 @@ module.exports = { content: ["./src/**/*.{html,ts}"], theme: { - extend: {}, + extend: { + "backgroundColor": { + "primary": "#EAE6E1", + }, + "textColor": { + "primary": "#513C2F", + } + }, }, plugins: [], }