Skip to content

Commit

Permalink
Merge branch 'env/dev' into 580-make-birthday-validation-to-be-automa…
Browse files Browse the repository at this point in the history
…tic-instead-of-hard-coded
  • Loading branch information
kevinmonisit authored Oct 4, 2023
2 parents 83ce2d9 + a886edb commit 70608c1
Show file tree
Hide file tree
Showing 9 changed files with 100 additions and 41 deletions.
6 changes: 0 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"react-scroll-parallax": "^1.3.5",
"react-scrollable-anchor": "^0.6.1",
"react-select": "^2.1.2",
"react-select-country-list": "^2.2.3",
"react-spinners": "^0.9.0",
"react-toggle": "^4.1.1",
"react-window": "^1.8.5",
Expand Down
24 changes: 24 additions & 0 deletions public/tailwind-output-f23.css
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,10 @@ video {
bottom: 8rem;
}

.left-32 {
left: 8rem;
}

.left-4 {
left: 1rem;
}
Expand Down Expand Up @@ -799,6 +803,14 @@ video {
top: 95rem;
}

.right-24 {
right: 6rem;
}

.right-28 {
right: 7rem;
}

.z-0 {
z-index: 0;
}
Expand Down Expand Up @@ -920,6 +932,10 @@ video {
margin-top: 8rem;
}

.mr-24 {
margin-right: 6rem;
}

.block {
display: block;
}
Expand Down Expand Up @@ -1393,6 +1409,10 @@ video {
padding-right: 0.5rem;
}

.pr-20 {
padding-right: 5rem;
}

.pr-4 {
padding-right: 1rem;
}
Expand Down Expand Up @@ -1425,6 +1445,10 @@ video {
padding-top: 2rem;
}

.pr-24 {
padding-right: 6rem;
}

.text-left {
text-align: left;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { ProfileType } from "../../../../Profile";
import PropTypes from "prop-types";
import { PulseLoader } from "react-spinners";

import countryList from "react-select-country-list";


class About extends Component {
// constructor(props) {
Expand Down Expand Up @@ -50,7 +52,7 @@ class About extends Component {
update_user.gender = this.state.user.gender;
update_user.ethnicity = this.state.user.ethnicity;
update_user.hackathon_count = this.state.user.hackathon_count;

update_user.country_of_residence = this.state.user.country_of_residence;
this.props.profile.Set(update_user)
.then(res => {
this.setState({
Expand Down Expand Up @@ -92,7 +94,8 @@ class About extends Component {
required: { value: true, errorMessage: "Invalid first name" },
pattern: { value: "^[A-Za-z0-9]+$", errorMessage: "Invalid character" },
minLength: { value: 1, errorMessage: "Invalid length" },
maxLength: { value: 100, errorMessage: "Invalid length" } }} />
maxLength: { value: 100, errorMessage: "Invalid length" }
}} />
</Col>
<Col xs={(mobile) ? 12 : 6}>
<AvField name="last"
Expand All @@ -105,7 +108,8 @@ class About extends Component {
required: { value: true, errorMessage: "Invalid last name" },
pattern: { value: "^[A-Za-z0-9]+$", errorMessage: "Invalid character" },
minLength: { value: 1, errorMessage: "Invalid length" },
maxLength: { value: 100, errorMessage: "Invalid length" } }} />
maxLength: { value: 100, errorMessage: "Invalid length" }
}} />
</Col>
</FormGroup>
<FormGroup row>
Expand All @@ -117,8 +121,9 @@ class About extends Component {
value={user.phone_number}
onChange={(e) => { user.phone_number = e.target.value; this.updateUser(user); }}
validate={{
required: { value: true, errorMessage: "Invalid number"},
pattern: { value: "^[\\+]?[0-9]{0,3}?[-\\s\\.]?[(]?[0-9]{3}[)]?[-\\s\\.]?[0-9]{3}[-\\s\\.]?[0-9]{4,6}$", errorMessage: "Invalid number" } }} />
required: { value: true, errorMessage: "Invalid number" },
pattern: { value: "^[\\+]?[0-9]{0,3}?[-\\s\\.]?[(]?[0-9]{3}[)]?[-\\s\\.]?[0-9]{3}[-\\s\\.]?[0-9]{4,6}$", errorMessage: "Invalid number" }
}} />
</Col>
<Col xs={(mobile) ? 12 : 4}>
<AvField name="dob"
Expand All @@ -137,7 +142,6 @@ class About extends Component {
end: {
value: tempDate.toLocaleDateString()
}

} }} />
</Col>
<Col xs={(mobile) ? 12 : 4}>
Expand All @@ -160,7 +164,7 @@ class About extends Component {
<CustomAVInput name="gender"
label="Gender *"
value={user.gender}
validate={{ required: { value: true, errorMessage: "Invalid input"} }}>
validate={{ required: { value: true, errorMessage: "Invalid input" } }}>
<div className="forcestyle">
<Creatable id="gender"
value={{ value: user.gender, label: user.gender }}
Expand All @@ -183,6 +187,19 @@ class About extends Component {
</CustomAVInput>
</Col>
</FormGroup>
<FormGroup >
<CustomAVInput name="country_of_residence"
label="Country of Residence*"
value={user.country_of_residence}
validate={{ required: { value: true, errorMessage: "Invalid input" } }}>
<div className="forcestyle">
<Creatable id="country_of_residence"
value={{ value: user.country_of_residence, label: user.country_of_residence }}
onChange={(e) => { user.country_of_residence = e.value; this.updateUser(user); }}
options={countryList().getData()} />
</div>
</CustomAVInput>
</FormGroup>
<FormGroup>
<AvField name="hackathon_count"
label="How many hackathons have you attended? *"
Expand All @@ -192,14 +209,15 @@ class About extends Component {
onChange={(e) => { user.hackathon_count = e.target.value; this.updateUser(user); }}
validate={{
required: { value: true, errorMessage: "Invalid hackathon count" },
min: { value: 0, errorMessage: "Hackathon count must be non-negative" } }} />
min: { value: 0, errorMessage: "Hackathon count must be non-negative" }
}} />
</FormGroup>
{message}
<div style={{ width: "100%" }}
align="right">
<Button color="info"
className="pill-btn"
type="submit"> { this.state.loading ? <PulseLoader color={theme.accent[0]} /> : "Update" } </Button>
type="submit"> {this.state.loading ? <PulseLoader color={theme.accent[0]} /> : "Update"} </Button>
</div>
</AvForm>
);
Expand All @@ -208,7 +226,7 @@ class About extends Component {
color: theme.disabled[0], padding: 5, minHeight: 35
};
let field = (text) => {
return <p style={pStyle}>{(text) ? text : <i>unanswered</i> }</p>;
return <p style={pStyle}>{(text) ? text : <i>unanswered</i>}</p>;
};
return (
<div>
Expand Down Expand Up @@ -253,6 +271,10 @@ class About extends Component {
{field(user.ethnicity)}
</Col>
</FormGroup>
<FormGroup>
<Label>Country of Residence</Label>
{field(user.country_of_residence)}
</FormGroup>
<FormGroup>
<Label>How many hackathons have you attended?</Label>
{field(user.hackathon_count)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,7 @@ class Questions extends Component {
value={user.short_answer}
onChange={(e) => { user.short_answer = e.target.value; this.updateUser(user); }} />
</FormGroup>
<FormGroup>
<Label for="sa">What are your initial thoughts on a virtual hackathon?</Label>
<Input id="sa"
type="textarea"
placeholder=""
value={user.virtual_short_answer}
onChange={(e) => { user.virtual_short_answer = e.target.value; this.updateUser(user); }} />
</FormGroup>

<FormGroup>
<Label for="sn">Anything we should account for?</Label>
<Input id="sn"
Expand Down Expand Up @@ -196,10 +189,6 @@ class Questions extends Component {
<Label>What are you hoping to experience at HackRU?</Label>
{field(user.short_answer)}
</FormGroup>
<FormGroup>
<Label>What are your initial thoughts on a virtual hackathon?</Label>
{field(user.virtual_short_answer)}
</FormGroup>
<FormGroup>
<Label>Anything we should account for?</Label>
{field(user.special_needs)}
Expand Down
22 changes: 16 additions & 6 deletions src/components/_Landing/Landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,26 @@ function LandingPage(props: any) {
/>

<Hero profile={props.profile} />
<SectionTitle title="ABOUT" />
<div id="About"
className="pt-3">
<SectionTitle title="ABOUT" />
</div>
<About />

<SectionTitle title="SCHEDULE" />
<div id="Schedule"
className="pt-3">
<SectionTitle title="SCHEDULE" />
</div>
<Schedule />

<SectionTitle title="SPONSORS" />
<div id="Sponsors"
className="pt-3">
<SectionTitle title="SPONSORS" />
</div>
<Sponsors />

<SectionTitle title="FAQ" />
<div id="FAQ"
className="pt-3">
<SectionTitle title="FAQ" />
</div>
<FAQ />

<Footer />
Expand Down
17 changes: 14 additions & 3 deletions src/components/_Landing/sections/hero/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ function MenuItem(props: { sectionName: string }) {
function OtherPageMenuItem(props: { sectionName: string }) {
const { sectionName } = props;
const history = useHistory();

return (
<Menu.Item>
{({ active }) => (
Expand All @@ -48,7 +47,7 @@ function OtherPageMenuItem(props: { sectionName: string }) {

function CollapsedMenu() {
return (
<div className="text-right bg-f23-mediumGreen rounded-md z-40 md:hidden absolute right-4 top-4">
<div className="text-right bg-f23-mediumGreen rounded-md z-40 md:hidden absolute right-28 top-4 ">
<Menu as="div"
className="relative inline-block text-left">
<div>
Expand Down Expand Up @@ -97,10 +96,22 @@ function Navbar() {
<img src={yellowHackRULogo}
alt="yellow hackru logo"
className="w-24 absolute top-0 left-4 z-50" />

<a
href="https://mlh.io/na?utm_source=na-hackathon&utm_medium=TrustBadge&utm_campaign=2024-season&utm_content=white"
target="_blank"
rel="noopener noreferrer"
>

<img className="w-24 absolute top-0 right-0 z-50"
src="https://s3.amazonaws.com/logged-assets/trust-badge/2024/mlh-trust-badge-2024-yellow.svg"
alt="Major League Hacking 2024 Hackathon Season" />
</a>

<CollapsedMenu />
<div
className="absolute top-0 font-light text-text hidden md:flex
text-lg pt-8 z-40 bg-gradient-to-b from-f23-lightGreen w-[100%] justify-end">
text-lg pt-8 pr-20 z-40 bg-gradient-to-b from-f23-lightGreen w-[100%] justify-end">

{!isContactPage && (<>
{
Expand Down
4 changes: 3 additions & 1 deletion src/components/_Landing/sections/hero/hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ function Hero(props: { profile: Profile }) {


return (
<div className="w-[100%] h-[100vh] px-5
<div
id="Home"
className="w-[100%] h-[100vh] px-5
flex text-white
flex-col items-center text-center justify-start md:justify-start relative
md:min-h-[1060px] min-h-[940px]
Expand Down
12 changes: 9 additions & 3 deletions src/components/_Landing/sections/sponsors/Sponsors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,15 @@ function Sponsors() {
<img src={echo_3d}
alt="Echo 3D"
className="w-[20rem] h-[4rem] sm:w-[24rem] sm:h-[5rem] md:w-[35rem] md:h-auto m-10" />
<img src={nj_transit}
alt="NJ Transit"
className="w-44 h-auto m-10" />

<a href="https://www.njtransit.com/hackathons"
target="_blank"
rel="noopener noreferrer">
<img src={nj_transit}
alt="NJ Transit"
className="w-44 h-auto m-10" />
</a>

<img src={merck}
alt="Merck"
className="m-10 -mt-5" />
Expand Down

0 comments on commit 70608c1

Please sign in to comment.