Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DerCed committed Feb 15, 2024
1 parent 2cf7926 commit 7e08ad0
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 10 deletions.
1 change: 1 addition & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default function RootLayout({children,}: { children: React.ReactNode }) {
<title>
HackHPI 2024 | tomorrow's reality, today's vision. smart cities edition.
</title>
<meta name="theme-color" content="#13101B"/>
<meta name={"description"}
content={"Explore the future of urban living at HPI in Potsdam. Join motivated students for two days of innovation, workshops, and collaboration with top-notch sponsors offering support and expertise. Tackle a challenge and dive into the world of smart cities."}/>
</head>
Expand Down
9 changes: 9 additions & 0 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "HackHPI 24",
"short_name": "HackHPI 2024",
"description": "Explore the future of urban living at HPI in Potsdam. Join motivated students for two days of innovation, workshops, and collaboration with top-notch sponsors offering support and expertise. Tackle a challenge and dive into the world of smart cities.",
"start_url": "/",
"display": "standalone",
"background_color": "#13101B",
"theme_color": "#13101B"
}
2 changes: 1 addition & 1 deletion src/components/Footer/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function Footer() {
<Typography>
<Link sx={{textDecoration: "none", color: "inherit"}}
href={"https://hackhpi.org/privacy"}>
Data Privacy
Privacy Policy
</Link>
</Typography>
</Grid>
Expand Down
39 changes: 32 additions & 7 deletions src/components/Registration/Registration.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
import {
Box,
Button,
Checkbox,
Container,
FormControl,
FormControlLabel,
FormHelperText,
FormLabel,
Grid,
Link,
MenuItem,
Radio,
RadioGroup,
Expand Down Expand Up @@ -135,7 +137,7 @@ const motivation = [
formLabel: 'Your motivation',
type: 1,
input: ['My motivation is ...'],
helperText: 'Please write a short text (max. 150 words) or 3 key phrases describing your motivation to be part of HackHPI. If you can\'t think of anything, take the following questions as guidance: Can you share a project, creation, or task that holds a special place as one of your favorites? What motivated you to undertake it, and what aspects make you proud of the outcome?',
helperText: 'Please write a short text (max. 1200 characters) or 3 key phrases describing your motivation to be part of HackHPI. If you can\'t think of anything, take the following questions as guidance: Can you share a project, creation, or task that holds a special place as one of your favorites? What motivated you to undertake it, and what aspects make you proud of the outcome?',
rows: 5,
name: "motivation",
max: 1200,
Expand Down Expand Up @@ -177,7 +179,7 @@ const skills = [
{
formLabel: 'LinkedIn account',
type: 1,
input: ['e. g. Max Mustermann'],
input: ['e. g. /in/max-mustermann'],
name: "linkedin",
max: 50,
required: false,
Expand Down Expand Up @@ -224,6 +226,13 @@ const teamMembers = [
formLabel: '',
type: 0,
},
{
formLabel: "Privacy Policy",
input: ["I have read and accept the Privacy Policy."],
name: "privacyPolicy",
type: 5,
required: true
}
]

const steps = [
Expand Down Expand Up @@ -256,7 +265,7 @@ const steps = [
}}>
<Stack spacing={3} justifyContent={"center"}>
<Mail color={"inherit"} sx={{fontSize: "2rem"}}/>
<Typography>To complete the Registration, please click on the link in the Mail we sent
<Typography>To complete the registration, please click on the link in the email we sent
you!</Typography>
</Stack>
</Box>
Expand All @@ -281,12 +290,16 @@ function Registration() {
if (!inputList) {
return;
}
console.log("######## ", name, "#################")
const result = inputList.content.reduce((previous, current) => {
console.log(current.name, values[current.name], previous)
if (!current.required && (values[current.name] === undefined || values[current.name] === "")) {
return true
console.log("Optional Field is empty -- skipping")
return previous && true
}
if (current.required && ((!values[current.name] && values[current.name] !== 0) || values[current.name] === "")) {
return false
console.log("Required field is empty")
return previous && false
}
const meetsMax = current.max ? values[current.name]?.length <= current.max : true;
const meetsMin = current.min ? values[current.name]?.length >= current.min : true;
Expand All @@ -295,6 +308,7 @@ function Registration() {
return previous && meetsAll

}, true)
console.log("Result", result)
return result
}

Expand Down Expand Up @@ -346,6 +360,12 @@ function Registration() {
<FormControlLabel value={i} control={<Radio/>} label={item}/>
))}
</RadioGroup>
case 5:
return <FormControlLabel
control={<Checkbox name={name} checked={values[name] ?? false}
onChange={(event, value) => handleChange(name, value)}/>}
label={input.join("")}/>

default:
return null
}
Expand Down Expand Up @@ -387,7 +407,9 @@ function Registration() {
return (
<LoadingButton variant={"contained"} startIcon={<Send/>}
loading={isSending}
onClick={submitForm}>
onClick={submitForm}
disabled={!enableNext(steps[index], step.label)}
>
Send
</LoadingButton>
)
Expand Down Expand Up @@ -433,7 +455,7 @@ function Registration() {
{step.children ? step.children : step.content.map((item, i) => (
<Grid item md={gridItemSize({name: item.name})} xs={12}>
<FormControl fullWidth>
<FormLabel>
<FormLabel focused={false}>
{item.formLabel}{item.required ? "*" : ""}
</FormLabel>
{contentForm({
Expand Down Expand Up @@ -465,6 +487,9 @@ function Registration() {
</Step>
))}
</Stepper>
<Typography color={"text.disabled"} sx={{marginTop: 3}}>Read our <Link href={"/privacy"}
color={"inherit"}>privacy
policy</Link> for information on how we handle your data and what you rights are.</Typography>
</Container>
</HackHPIWrapper>
)
Expand Down
4 changes: 2 additions & 2 deletions src/rest/RegistrationRest.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import axios from "axios";

export class RegistrationRest{
baseUrl = "https://api.hackhpi.org/v1";
//baseUrl = "http://localhost:8080/v1";
//baseUrl = "https://api.hackhpi.org/v1";
baseUrl = "http://localhost:8080/v1";

addRegistration(data){
return axios.post(this.baseUrl+"/registration", data)
Expand Down

0 comments on commit 7e08ad0

Please sign in to comment.