Skip to content

Commit 0eb9436

Browse files
authored
Merge pull request #230 from mantis1262/feature/register
2 parents 308efc8 + 668c13f commit 0eb9436

File tree

5 files changed

+247
-133
lines changed

5 files changed

+247
-133
lines changed

src/Zustand/api.ts

+9-12
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ export interface raceParticipantUserData {
1717
phone: string;
1818
email: string;
1919
language: string;
20-
shirt: string;
20+
team?: string;
2121
km: string;
22-
shirtGender: ShirtGender;
22+
adult: Age;
2323
agreementStatements: boolean;
24-
raceID?: string;
24+
raceID?: Race[];
2525
userId?: string;
2626
}
2727

28-
export type ShirtGender = 'Damska' | 'Męska' | 'Dziecięca';
28+
export type Age = 'Pełnoletni' | 'Niepełnoletni';
29+
export type Race = 'Kapcie' | 'MatkaIDziecko' | 'Bieg1KM' | 'Bieg5KM' | 'Spacer'
2930

3031
export interface UserUpdateData {
3132
name?: string;
@@ -74,8 +75,7 @@ const getConfig = () => {
7475

7576
export const register = async (userData: UserData) => {
7677
try {
77-
const response = await axios.post(`${apiUrl}/users/signup`, userData);
78-
return response;
78+
return await axios.post(`${apiUrl}/users/signup`, userData);
7979
} catch (error) {
8080
const err = error as AxiosError;
8181
console.error('Error registering user:', err);
@@ -139,15 +139,14 @@ export const userParticipation = async (
139139
participantData: raceParticipantUserData
140140
) => {
141141
try {
142-
const response = await axios.post(
142+
return await axios.post(
143143
`${apiUrl}/payment/participate`,
144144
{
145145
amount,
146146
participant: participantData,
147147
},
148148
getConfig()
149149
);
150-
return response;
151150
} catch (error) {
152151
console.error('Error with user participation:', error);
153152
throw error;
@@ -156,11 +155,10 @@ export const userParticipation = async (
156155

157156
export const getUserParticipation = async () => {
158157
try {
159-
const response = await axios.get(
158+
return await axios.get(
160159
`${apiUrl}/users/participant`,
161160
getConfig()
162161
);
163-
return response;
164162
} catch (error) {
165163
console.error('Error getting participant:', error);
166164
throw error;
@@ -198,11 +196,10 @@ export const resetPassword = async (email: string) => {
198196

199197
export const registerForDonation = async (amount: number, email: string) => {
200198
try {
201-
const response = await axios.post(`${apiUrl}/payment/donation`, {
199+
return await axios.post(`${apiUrl}/payment/donation`, {
202200
amount,
203201
email,
204202
});
205-
return response;
206203
} catch (error) {
207204
console.error('Error with user participation:', error);
208205
throw error;

src/components/RegistrationForRunAll/RegistrationForRun/RegistrationForRun.module.scss

+31-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
@import '../../../stylesheets/mixins.scss';
2+
.form {
3+
display: contents;
4+
}
25

36
.registration {
47
width: 100%;
@@ -96,15 +99,25 @@
9699
}
97100

98101
&__radioList {
99-
display: inline-flex;
100-
align-items: flex-start;
101-
text-align: center;
102-
gap: 48px;
102+
display: flex;
103+
flex-direction: column;
104+
text-align: left;
105+
width: 100%;
106+
gap: 10px;
103107
line-height: 24px;
104108
letter-spacing: 0.019px;
105109
padding: 24px 0 8px 0;
106110
}
107111

112+
&__checkboxList {
113+
display: flex;
114+
flex-direction: column;
115+
text-align: left;
116+
width: 100%;
117+
gap: 10px;
118+
119+
}
120+
108121
&__label {
109122
display: flex;
110123
flex-direction: column;
@@ -223,8 +236,17 @@
223236
}
224237
}
225238

239+
.formikMessage2 {
240+
color: red;
241+
font-size: 14px;
242+
font-weight: 400;
243+
244+
@include desktop-screen {
245+
font-size: 16px;
246+
}
247+
}
248+
226249
.formikMessageStatement {
227-
top: 85px;
228250
color: red;
229251
font-size: 12px;
230252
font-weight: 400;
@@ -242,6 +264,10 @@ input[type='radio'] {
242264
margin-right: 12px;
243265
}
244266

267+
input[type='checkbox'] {
268+
margin-right: 12px;
269+
}
270+
245271
.buttonContainer {
246272
display: flex;
247273
justify-content: center;

0 commit comments

Comments
 (0)