Skip to content
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

part of setting up #2

Merged
merged 1 commit into from
Jun 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
part of setting up
  • Loading branch information
monacodelisa committed Jun 29, 2024
commit d58dd234fe23d1e9a1ae98d742c53018cbc30545
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();
}
}