Skip to content

Commit

Permalink
Merge pull request #2 from PaidlancerDev/develop
Browse files Browse the repository at this point in the history
part of setting up
  • Loading branch information
monacodelisa committed Jun 29, 2024
2 parents ec41f93 + d58dd23 commit 98cd2c5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/app/components/pages/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ <h3>Clients:</h3>
<h3>Embark on your journey with Paidlancer today and discover a realm where paidlancers flourish and clients
prosper!</h3>
<div class="actions">
<button mat-raised-button class="join" routerLink="/sign-in">Join Now</button>
@if (user) {
<button mat-raised-button class="join">Profile</button>
} @else {
<button mat-raised-button class="join" routerLink="/sign-in">Join Now</button>
}
</div>
</mat-card>
</div>
Expand Down
9 changes: 5 additions & 4 deletions src/app/components/pages/home/home.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -147,22 +147,23 @@
display: flex;
align-items: center;
justify-content: center;
min-height: 75vh;
padding: 2rem;

mat-card {
background-color: #f1fcf4;
align-items: center;
padding: 3rem 0 2rem;
padding: 3rem 2rem 2rem;
margin: 3rem;
width: 50vw;
width: 30vw;

h3 {
color: #2f7a51;
font-size: 1.3rem;
font-size: 1.4rem;
font-weight: bold;
line-height: 2rem;
text-align: center;
width: 35vw;
width: 100%;
}

.actions {
Expand Down
12 changes: 12 additions & 0 deletions src/app/components/pages/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { MatButtonModule } from '@angular/material/button';
import {MatCardModule} from '@angular/material/card';
import { RouterLink } from '@angular/router';
import { TestService } from '../../../services/test.service';
import { User } from '@supabase/supabase-js';
import { AuthService } from '../../../services/auth.service';

@Component({
selector: 'app-home',
Expand All @@ -13,9 +15,19 @@ import { TestService } from '../../../services/test.service';
styleUrl: './home.component.scss'
})
export class HomeComponent implements OnInit {
user: User | null = null;
private authService = inject(AuthService);
testService = inject(TestService);

ngOnInit(): void {
this.authService.currentUser.subscribe((user) => {
if (user) {
this.user = user;
console.log("User:", this.user);
} else {
this.user = null;
}
});
this.testService.getAllTestData();
}
}

0 comments on commit 98cd2c5

Please sign in to comment.