update routing client
This commit is contained in:
parent
d7b7bc7be0
commit
218b2de59a
18 changed files with 377 additions and 148 deletions
|
|
@ -0,0 +1,4 @@
|
|||
<p>dashboard works!</p>
|
||||
<button (click)="logout()" class="bg-blue-300 rounded-lg min-w-fit p-10">
|
||||
Logout
|
||||
</button>
|
||||
21
client/src/app/features/dashboard/dashboard.component.ts
Normal file
21
client/src/app/features/dashboard/dashboard.component.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { Component } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { UserService } from 'src/app/core/services/user.service';
|
||||
import { SocialAuthService } from '@abacritt/angularx-social-login';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dashboard',
|
||||
standalone: true,
|
||||
templateUrl: './dashboard.component.html',
|
||||
styleUrls: ['./dashboard.component.css'],
|
||||
})
|
||||
export class DashboardComponent {
|
||||
constructor(private _userService: UserService) {}
|
||||
|
||||
logout() {
|
||||
console.log('logout');
|
||||
this._userService.logout();
|
||||
// this._authService.signOut();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
<main class="flex flex-col justify-around">
|
||||
<div class="flex min-h-full flex-col justify-center px-6 py-12 lg:px-8">
|
||||
<div class="sm:mx-auto sm:w-full sm:max-w-sm">
|
||||
<img
|
||||
class="mx-auto h-10 w-auto"
|
||||
src="https://tailwindui.com/img/logos/mark.svg?color=indigo&shade=600"
|
||||
alt="Your Company"
|
||||
/>
|
||||
<h2
|
||||
class="mt-10 text-center text-2xl font-bold leading-9 tracking-tight text-gray-900"
|
||||
>
|
||||
Sign in to your account
|
||||
</h2>
|
||||
<div class="mt-10 sm:mx-auto sm:w-full sm:max-w-sm">
|
||||
<asl-google-signin-button
|
||||
type="standard"
|
||||
shape="pill"
|
||||
text="signin_with"
|
||||
size="large"
|
||||
logo_alignment="center"
|
||||
theme="outline"
|
||||
width="400"
|
||||
></asl-google-signin-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-10 sm:mx-auto sm:w-full sm:max-w-sm">
|
||||
<form class="space-y-6" action="#" method="POST">
|
||||
<div>
|
||||
<label
|
||||
for="email"
|
||||
class="block text-sm font-medium leading-6 text-gray-900"
|
||||
>Email address</label
|
||||
>
|
||||
<div class="mt-2">
|
||||
<input
|
||||
id="email"
|
||||
name="email"
|
||||
type="email"
|
||||
autocomplete="email"
|
||||
required
|
||||
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="flex items-center justify-between">
|
||||
<label
|
||||
for="password"
|
||||
class="block text-sm font-medium leading-6 text-gray-900"
|
||||
>Password</label
|
||||
>
|
||||
<div class="text-sm">
|
||||
<a
|
||||
href="#"
|
||||
class="font-semibold text-indigo-600 hover:text-indigo-500"
|
||||
>Forgot password?</a
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<input
|
||||
id="password"
|
||||
name="password"
|
||||
type="password"
|
||||
autocomplete="current-password"
|
||||
required
|
||||
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button
|
||||
type="submit"
|
||||
class="flex w-full justify-center rounded-md bg-indigo-600 px-3 py-1.5 text-sm font-semibold leading-6 text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
|
||||
>
|
||||
Sign in
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { HomeComponent } from './home.component';
|
||||
|
||||
describe('HomeComponent', () => {
|
||||
let component: HomeComponent;
|
||||
let fixture: ComponentFixture<HomeComponent>;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [HomeComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(HomeComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
import {
|
||||
GoogleSigninButtonModule,
|
||||
SocialAuthService,
|
||||
} from '@abacritt/angularx-social-login';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { AppModule } from 'src/app/app.module';
|
||||
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
templateUrl: './home.component.html',
|
||||
styleUrls: ['./home.component.css'],
|
||||
imports: [GoogleSigninButtonModule],
|
||||
standalone: true,
|
||||
})
|
||||
export class HomeComponent implements OnInit {
|
||||
constructor(private _authService: SocialAuthService) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
this._authService.authState.subscribe((user) => {
|
||||
console.log(user);
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue