Skip to content

Commit ed3a6b0

Browse files
authored
Feat/49 - Design sign-up form (#15)
* feat(sign-up-design): fixed styles, added dynamic header button label rendering
1 parent d957687 commit ed3a6b0

File tree

8 files changed

+31
-12
lines changed

8 files changed

+31
-12
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<a routerLink="/sign-up" class="p-button"> Sign Up </a>
1+
<a [routerLink]="authButtonLink()" class="p-button">{{ authButtonText() }}</a>
22

33
<p-button label="Donate" severity="contrast" />

src/app/core/components/header/header.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
:host {
44
position: absolute;
55
height: 4.5rem;
6-
padding-right: 1rem;
6+
padding-right: 1.5rem;
77
width: 100%;
88
@include mix.flex-center-right;
99
gap: 1rem;
Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
import { ChangeDetectionStrategy, Component } from '@angular/core';
1+
import {
2+
ChangeDetectionStrategy,
3+
Component,
4+
computed,
5+
inject,
6+
} from '@angular/core';
27
import { Button } from 'primeng/button';
3-
import { RouterLink } from '@angular/router';
8+
import { Router, RouterLink } from '@angular/router';
9+
import { toSignal } from '@angular/core/rxjs-interop';
10+
import { map } from 'rxjs';
411

512
@Component({
613
standalone: true,
@@ -10,4 +17,16 @@ import { RouterLink } from '@angular/router';
1017
styleUrl: './header.component.scss',
1118
changeDetection: ChangeDetectionStrategy.OnPush,
1219
})
13-
export class HeaderComponent {}
20+
export class HeaderComponent {
21+
#router = inject(Router);
22+
23+
#currentUrl = toSignal(this.#router.events.pipe(map(() => this.#router.url)));
24+
25+
protected readonly authButtonText = computed(() =>
26+
this.#currentUrl()?.includes('sign-up') ? 'Sign In' : 'Sign Up',
27+
);
28+
29+
protected readonly authButtonLink = computed(() =>
30+
this.#currentUrl()?.includes('sign-up') ? '/login' : '/sign-up',
31+
);
32+
}

src/app/core/components/root/root.component.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
.content {
1616
@include mix.flex-column;
1717
min-height: 100%;
18-
background: url("/assets/images/sign-up-background.png") center no-repeat;
19-
background-size: cover;
2018
position: relative;
2119
}
2220
}

src/app/features/auth/sign-up/sign-up.component.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
:host {
55
@include mix.flex-column-center;
66
flex: 1;
7+
background: url("/assets/images/sign-up-background.png") center no-repeat;
8+
background-size: cover;
79

810
.sign-up-container {
911
@include mix.flex-column;
1012
flex: 1;
1113
color: var.$dark-blue-1;
1214
width: 32rem;
13-
margin: 2rem 0;
15+
margin: 6.5rem 0 2rem 0;
1416
padding: 2rem;
1517
background: white;
1618
border-radius: 0.6rem;

src/app/features/home/home.component.scss

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138

139139
.latest-research-container {
140140
width: 100%;
141-
background: var.$gradient-2;
141+
background: var.$bg-blue-3;
142142
height: 11.14rem;
143143
padding: 3.43rem 3.43rem 3.43rem 1.71rem;
144144

@@ -178,9 +178,7 @@
178178
width: 100%;
179179
height: 11.14rem;
180180
padding: 3.43rem 3.43rem 3.43rem 1.71rem;
181-
background: url("/assets/images/hosting-background.svg") no-repeat center
182-
center;
183-
background-size: cover;
181+
background-color: var.$bg-blue-2;
184182

185183
.content {
186184
display: flex;

src/app/features/privacy-policy/privacy-policy.component.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@use "assets/styles/variables" as var;
22

33
.container {
4+
margin-top: 4.5rem;
45
padding: 1.7rem;
56
color: var.$dark-blue-1;
67

src/app/features/terms-of-use/terms-of-use.component.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@use "assets/styles/variables" as var;
22

33
.container {
4+
margin-top: 4.5rem;
45
padding: 1.7rem;
56
color: var.$dark-blue-1;
67

0 commit comments

Comments
 (0)