Skip to content

Commit

Permalink
Merge pull request #63 from heyyakash/new
Browse files Browse the repository at this point in the history
Added banner
  • Loading branch information
heyyakash authored Nov 23, 2023
2 parents 0f12a6d + af944c4 commit 85e1294
Show file tree
Hide file tree
Showing 8 changed files with 209 additions and 1 deletion.
22 changes: 22 additions & 0 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 @@ -12,6 +12,7 @@
"react-awesome-slider": "^4.1.0",
"react-dom": "^16.14.0",
"react-ga": "^2.7.0",
"react-hook-form": "^7.48.2",
"react-router-dom": "^5.3.4",
"react-scripts": "^3.4.4",
"react-typical": "^0.1.3",
Expand Down
2 changes: 2 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import Coc from './views/Coc';
import Events from './components/Events/Events';
import Members from "./components/Members/Members";
import Achievements from './components/Achievements/Achievements'
import Form from './components/Form/Form';

// Initialize Google Analytics
ReactGA.initialize(process.env.REACT_APP_GA_CODE);
Expand Down Expand Up @@ -47,6 +48,7 @@ const App = () => {
<AppRoute exact path="/events" component={Events} layout={LayoutDefault} />
<AppRoute exact path="/achievements" component={Achievements} layout={LayoutDefault} />
<AppRoute exact path="/members" component={Members} layout={LayoutDefault}/>
<AppRoute exact path="/form" component={Form} layout={LayoutDefault}/>

</Switch>
)} />
Expand Down
65 changes: 65 additions & 0 deletions src/assets/scss/form/form.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
.form{
max-width: 1200px;
width: 100%;
margin: 0 auto;
}
.form-container{
gap: 1rem ;
max-width:500px;
margin:0 auto;
width:100%;
}

.input-box{
width: 100% !important;
border:1px solid rgba(255, 255, 255, 0.492);
outline:none;
color:white;
border-radius: 6px;
padding: 10px;
background-color: transparent;

&::placeholder{
font-size: .8rem;
}
}

.form-btn{
background-color: rgb(25, 155, 25);
border-radius: 6px;
cursor:pointer;
width: 100%;
padding:10px;
border:none;
outline:none;
color:white;
transition: all;
transition-duration: 150ms;

&:hover{
background-color: white;
color:black;
}
}

.form-label{
font-size: .8rem;
}

.flex{
display: flex;
}
.flex-col{
flex-direction: column;
}
.flex-wrap{
flex-wrap: wrap;
}
.flex-center{
align-items: center;
justify-content: center;
}

.w-full{
width:100%;
}
5 changes: 5 additions & 0 deletions src/assets/scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,9 @@
--------------------------------------------------------------*/
@import "events/events";

/*--------------------------------------------------------------
# Form
--------------------------------------------------------------*/
@import "form/form";


100 changes: 100 additions & 0 deletions src/components/Form/Form.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import React, { useState } from 'react'
import Hero2 from '../sections/Hero2';

import SectionHeader from '../sections/partials/SectionHeader';
import { useForm } from 'react-hook-form';

const Form = () => {

const sectionHeader = {
title: 'Recruitment Form 2023-2024',
};

const [mode, setMode] = useState(false)
const [display, setDisplay] = useState(false)
const changeMode = (e) => {
console.log(e.target.value)
if (e.target.value === "1") setMode(false)
else setMode(true)
setDisplay(true)
}

const { register, handleSubmit,reset } = useForm()

const onSubmit = (data) => {
console.log(data)
reset()
}

return (
<>
<Hero2 className="illustration-section-01" />

<div className="container">
<SectionHeader style={{ marginTop: "-30px" }} data={sectionHeader} className="center-content" />
<form onSubmit={handleSubmit(onSubmit)} className='form'>
<div className='flex flex-col flex-center form-container'>

<div className='flex flex-col' style={{ gap: "0.5rem", width: "100%" }}>
<label className='form-label' htmlFor="name">Full Name</label>
<input placeholder='Enter your full name' required {...register("name")} type="text" className='input-box' />
</div>
<div className="flex " style={{ width:"100%", gap: "1rem" }}>
<div className='flex flex-col w-full' style={{ gap: "0.5rem" }}>
<label className='form-label' htmlFor="name">Branch</label>
<select required {...register("branch")} className='input-box'>
<option selected disabled>Select Branch</option>
<option value="CSE">CSE</option>
<option value="CSD">CSD</option>
<option value="ME">ME</option>
<option value="ISE">ISE</option>
<option value="ABC">ABC</option>
<option value="CDE">CDE</option>
<option value="XCE">XCE</option>
</select>
</div>
<div className='flex flex-col w-full' style={{ gap: "0.5rem" }}>
<label className='form-label' htmlFor="name">Year</label>
<select required {...register("year")} onChange={(e) => changeMode(e)} className='input-box'>
<option selected disabled>Select year</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</div>

</div>
{display && (<>
{mode === true ? (<>
<div className='flex flex-col' style={{ gap: "0.5rem", width: "100%" }}>
<label className='form-label' htmlFor="usn">USN</label>
<input placeholder='Enter USN' required {...register("usn")} type="text" className='input-box' />
</div>
</>) : (<>
<div className='flex flex-col' style={{ gap: "0.5rem", width: "100%" }}>
<label className='form-label' htmlFor="usn">Registeration No.</label>
<input placeholder='Enter Reg. No.' required {...register("regno")} type="text" className='input-box' />
</div>
</>)}</>)}
<div className='flex flex-col' style={{ gap: "0.5rem", width: "100%" }}>
<label className='form-label' htmlFor="email">Email</label>
<input placeholder='Enter your email' required {...register("email")} type="email" className='input-box' />
</div>
<div className='flex flex-col' style={{ gap: "0.5rem", width: "100%" }}>
<label className='form-label' htmlFor="whatsapp">Whatsapp No.</label>
<input placeholder='Enter your whatsapp number' required {...register("whatsapp")} type="tel" className='input-box' />
</div>
<div className='flex flex-col' style={{ gap: "0.5rem", width: "100%" }}>
<label className='form-label' htmlFor="whatsapp">Tell us something about yourself {"("}max 100 words{"}"}</label>
<textarea placeholder='I am a....' rows={6} required {...register("bio")} type="tel" className='input-box' />
</div>
<button type = "submit" className='form-btn'>Submit</button>
</div>

</form>
</div>
</>
)
}

export default Form
8 changes: 8 additions & 0 deletions src/components/layout/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,13 @@ const Header = ({
)

return (
<>

<header {...props} className={classes}>
<div style = {{backgroundColor:" #ffb618 ", width:"100%", padding:"10px",textAlign:"center",color:"black",fontWeight:"600"}}>
We are recruiting !!&nbsp;
<a href="/form" style = {{textDecoration:"underline", color:"black"}}>Click here</a>
</div>
<div className='container'>
<div
className={classNames(
Expand Down Expand Up @@ -174,10 +180,12 @@ const Header = ({
</div>
</div>
</header>
</>
)
}

Header.propTypes = propTypes
Header.defaultProps = defaultProps

export default Header

7 changes: 6 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9421,6 +9421,11 @@ react-ga@^2.7.0:
resolved "https://registry.npmjs.org/react-ga/-/react-ga-2.7.0.tgz"
integrity sha512-AjC7UOZMvygrWTc2hKxTDvlMXEtbmA0IgJjmkhgmQQ3RkXrWR11xEagLGFGaNyaPnmg24oaIiaNPnEoftUhfXA==

react-hook-form@^7.48.2:
version "7.48.2"
resolved "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.48.2.tgz"
integrity sha512-H0T2InFQb1hX7qKtDIZmvpU1Xfn/bdahWBN1fH19gSe4bBEqTfmlr7H3XWTaVtiK4/tpPaI1F3355GPMZYge+A==

react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.4:
version "16.13.1"
resolved "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz"
Expand Down Expand Up @@ -9528,7 +9533,7 @@ react-visibility-sensor@^5.0.2:
dependencies:
prop-types "^15.7.2"

"react@^15.0.0 || ^16.0.0", "react@^15.6.2 || ^16.0", react@^16.14.0, "react@>= 0.11.2 <= 16", react@>=15, react@>=16.0.0:
"react@^15.0.0 || ^16.0.0", "react@^15.6.2 || ^16.0", react@^16.14.0, "react@^16.8.0 || ^17 || ^18", "react@>= 0.11.2 <= 16", react@>=15, react@>=16.0.0:
version "16.14.0"
resolved "https://registry.npmjs.org/react/-/react-16.14.0.tgz"
integrity sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g==
Expand Down

0 comments on commit 85e1294

Please sign in to comment.