Skip to content

Commit b8ca957

Browse files
committed
Created abstract Rest
1 parent ecc7062 commit b8ca957

File tree

4 files changed

+48
-63
lines changed

4 files changed

+48
-63
lines changed
Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1-
import {Box, Button, Divider, Grid, TextField, Typography} from "@mui/material";
1+
import {
2+
Box,
3+
Button,
4+
Divider,
5+
Grid,
6+
TextField,
7+
Typography,
8+
} from "@mui/material";
9+
import { LoadingButton } from "@mui/lab";
210

311
export function GroupManager(props) {
412
return (
5-
<Grid
6-
item
7-
md={12}
8-
xs={12}
9-
>
10-
<TextField fullWidth label={"Enter group name here"}>
11-
12-
</TextField>
13-
14-
<Divider> or </Divider>
15-
16-
<Button variant={"outlined"} color={"secondary"}>Create new Group</Button>
17-
18-
<Typography variant="body2" color="textSecondary" gutterBottom>
19-
Enter your group code here or generate a new one.
20-
</Typography>
21-
</Grid>
13+
<Grid item md={12} xs={12}>
14+
<Box sx={{ pt: 5, pb: 5 }}>
15+
<TextField
16+
fullWidth
17+
label={"Enter team name (e.g. chalk-increase-vague)"}
18+
/>
19+
<Divider sx={{ pt: 2, pb: 2 }}> or </Divider>
20+
<LoadingButton variant={"outlined"} color={"primary"} onClick={props.onReset}>
21+
Create new Team
22+
</LoadingButton>
23+
</Box>
24+
</Grid>
2225
);
2326
}

src/components/Registration/Registration.jsx

Lines changed: 5 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -199,51 +199,7 @@ const skills = [
199199
},
200200
];
201201

202-
const teamMembers = [
203-
{
204-
formLabel: "Team member 1",
205-
type: 1,
206-
input: ["Name 1"],
207-
max: 100,
208-
required: false,
209-
name: "team1",
210-
},
211-
{
212-
formLabel: "Team member 2",
213-
type: 1,
214-
input: ["Name 2"],
215-
max: 100,
216-
required: false,
217-
name: "team2",
218-
},
219-
{
220-
formLabel: "Team member 3",
221-
type: 1,
222-
input: ["Name 3"],
223-
max: 100,
224-
required: false,
225-
name: "team3",
226-
},
227-
{
228-
formLabel: "Team member 4",
229-
type: 1,
230-
input: ["Name 4"],
231-
max: 100,
232-
required: false,
233-
name: "team4",
234-
},
235-
{
236-
formLabel: "Team member 5",
237-
type: 1,
238-
input: ["Name 5"],
239-
max: 100,
240-
required: false,
241-
name: "team5",
242-
},
243-
{
244-
formLabel: "",
245-
type: 0,
246-
},
202+
const legal = [
247203
{
248204
formLabel: "Privacy Policy",
249205
input: ["I have read and accept the Privacy Policy."],
@@ -270,6 +226,10 @@ const steps = [
270226
label: "Team members",
271227
children: <GroupManager />,
272228
},
229+
{
230+
label: "Confirmation",
231+
content: legal,
232+
},
273233
{
274234
label: "E-Mail Verification",
275235
children: (

src/rest/AbstractRest.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import axios from "axios";
2+
import {Component} from "react";
3+
4+
export class AbstractRest {
5+
baseUrl = "https://pems-api.hackhpi.org/v1";
6+
//baseUrl = "http://localhost:8080/v1";
7+
8+
}

src/rest/GroupRest.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import axios from "axios";
2+
import { AbstractRest } from "./AbstractRest";
3+
4+
export class GroupRest extends AbstractRest {
5+
createGroup(signUpFormId) {
6+
return axios.post(this.baseUrl + "/group", signUpFormId);
7+
}
8+
9+
getGroup(eventId, groupName) {
10+
return axios.post(
11+
this.baseUrl + "/group/event/" + eventId + "/phrase/" + groupName,
12+
);
13+
}
14+
}

0 commit comments

Comments
 (0)