Skip to content

Commit b6a607a

Browse files
committed
add modal to register error
1 parent 855f155 commit b6a607a

3 files changed

Lines changed: 89 additions & 0 deletions

File tree

projects/social_platform/src/app/auth/register/register.component.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,5 +211,39 @@ <h3 class="auth__title auth__title--register">
211211
</app-button>
212212
}
213213
<p class="auth__toggle">Есть аккаунт? <a routerLink="/auth/login">Войдите</a></p>
214+
215+
<app-modal
216+
[open]="isUserCreationModalError"
217+
(openChange)="isUserCreationModalError = !isUserCreationModalError"
218+
>
219+
<div class="cancel">
220+
<i
221+
(click)="isUserCreationModalError = !isUserCreationModalError"
222+
appIcon
223+
icon="cross"
224+
class="register__cross"
225+
></i>
226+
227+
<p class="register__title">Привет!</p>
228+
229+
<p class="text-body-14 register__text">
230+
Подтверждение аккаунтов на платформе временно выполняется вручную, процесс может занять до
231+
6 часов.
232+
</p>
233+
234+
<p class="text-body-14 register__text">
235+
Как только твой аккаунт будет подтвержден, ты получишь уведомление на почту.
236+
</p>
237+
238+
<p class="text-body-14 register__text">
239+
Мы уже решаем эту проблему, чтобы сделать использование платформы максимально комфортным
240+
для тебя ❤️
241+
<br />
242+
<br />
243+
По любым вопросам пиши в
244+
<a href="https://t.me/procollab_support">аккаунт поддержки в Telegram</a>
245+
</p>
246+
</div>
247+
</app-modal>
214248
</form>
215249
</div>

projects/social_platform/src/app/auth/register/register.component.scss

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,53 @@
3535
&__repeated-password {
3636
margin-top: 6px;
3737
}
38+
39+
&__text {
40+
margin-bottom: 30px;
41+
42+
@include responsive.apply-desktop {
43+
margin-bottom: 20px;
44+
}
45+
}
46+
47+
&__cross {
48+
position: absolute;
49+
top: 0;
50+
right: 0;
51+
width: 32px;
52+
height: 32px;
53+
cursor: pointer;
54+
55+
@include responsive.apply-desktop {
56+
top: 8px;
57+
right: 8px;
58+
}
59+
}
60+
61+
&__title {
62+
margin-bottom: 20px;
63+
color: var(--black);
64+
inline-size: 280px;
65+
66+
@include typography.heading-3;
67+
68+
@include responsive.apply-desktop {
69+
inline-size: 500px;
70+
}
71+
}
72+
}
73+
74+
.cancel {
75+
display: flex;
76+
flex-direction: column;
77+
align-items: flex-start;
78+
justify-content: center;
79+
width: 100%;
80+
max-width: 600px;
81+
max-height: calc(100vh - 40px);
82+
padding: 20px 0;
83+
84+
@include responsive.apply-desktop {
85+
padding: 20px 0;
86+
}
3887
}

projects/social_platform/src/app/auth/register/register.component.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import * as dayjs from "dayjs";
99
import * as cpf from "dayjs/plugin/customParseFormat";
1010
import { ButtonComponent, CheckboxComponent, InputComponent } from "@ui/components";
1111
import { AuthService } from "@auth/services";
12+
import { ModalComponent } from "@ui/components/modal/modal.component";
1213

1314
dayjs.extend(cpf);
1415

@@ -22,6 +23,7 @@ dayjs.extend(cpf);
2223
InputComponent,
2324
CheckboxComponent,
2425
ButtonComponent,
26+
ModalComponent,
2527
RouterLink,
2628
ControlErrorPipe,
2729
],
@@ -66,6 +68,8 @@ export class RegisterComponent implements OnInit {
6668
credsSubmitInitiated = false;
6769
infoSubmitInitiated = false;
6870

71+
isUserCreationModalError = false;
72+
6973
serverErrors: string[] = [];
7074

7175
step: "credentials" | "info" = "credentials";
@@ -122,6 +126,8 @@ export class RegisterComponent implements OnInit {
122126
// console.log(error);
123127
this.serverErrors = Object.values(error.error).flat() as string[];
124128
console.log(this.serverErrors);
129+
} else if (error.status === 500) {
130+
this.isUserCreationModalError = true;
125131
}
126132

127133
this.registerIsSubmitting = false;

0 commit comments

Comments
 (0)