Skip to content

Commit

Permalink
feat: add hostelRequired field in form (#93)
Browse files Browse the repository at this point in the history
* feat:Added new site data and some minor changes

* feat: added updated events section

* chore: added text sizes from tailwind

* feat: added Registartion page

* chore:updated backgrounf image of Registerpage

* chore: few fixes

* chore:updatd bg

* added registration form and cloudinary api

* chore:cloudinary fix and google sign in fix

* chore: added queries and mutaitions

* chore:added zod validation

* chore:validation fix

* fix: fixed according to the changes

* chore: improvements to form and added cookies.

* chore: removed cookies and added GET_USER_BY_ID check

* fix:prettier

* fix: prettier formatting

* fix: fixed authcotext err

* fix: added fixes to query and mutations

* feat: started profile view in progress

* chore:ui finished

* feat:completed profile menu

* chore:added college

* chore:authenticates user

* chore: footer toast fixes and registration form fixes

* added orgId to fix authorization error

* fix:some fixes

* fix: important fixes

* fix: responsiveness update on eventModal

* fix: lint:fix

* fix:issues fix

* chore: add isHostelRequired

* chore: added optional chaining

---------

Co-authored-by: anmol5936 <[email protected]>
Co-authored-by: Srishty Mangutte <[email protected]>
  • Loading branch information
3 people authored Jul 11, 2024
1 parent f8fe9fd commit 49df10a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/components/events/Events.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,18 @@ export default function Events() {
if (userInfo.uid) {
setUid(userInfo.uid)
if (allEventsMade) {
getAllEvents(allEventsMade.getEvents)
getAllEvents(allEventsMade?.getEvents)
}

if (userDataInDb) {
setMongoId(userDataInDb.getUser.id)
setMongoId(userDataInDb?.getUser?.id)
}
if (soloRegistrations) {
setSoloRegistration(soloRegistrations.eventRegistration)
setSoloRegistration(soloRegistrations?.eventRegistration)
}

if (teamRegistrations) {
setTeamRegistration(teamRegistrations.teamRegistrations)
setTeamRegistration(teamRegistrations?.teamRegistrations)
}

const combinedRegistrations = [...(soloRegistration || []), ...(teamRegistration || [])]
Expand Down
2 changes: 1 addition & 1 deletion src/components/marginals/Nav_Hero/ProfileMenuDropDown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function ProfileMenuDropDown({ setProfileOpen, user }) {
{ label: 'Name', value: user.name },
{ label: 'Email', value: user.email },
{ label: 'College', value: user.college },
{ label: 'Src Id', value: user.srcId ? user.srcId : 'Available shortly...' }
{ label: 'Src Id', value: user.srcID || 'Available shortly...' }
]
const { handleSignOut } = useContext(AuthContext)
function logout() {
Expand Down
21 changes: 14 additions & 7 deletions src/components/registrationForm/RegistrationForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ import {
TshirtContainer,
TshirtImage
} from './RegisterForm.styles'
import SwitchInput from './SwitchInput'
import { uploadToCloudinary } from '../../utils/uploadToCloudinary'
// import SwitchInput from './SwitchInput'

export default function RegistrationForm() {
const orgId = '668bd9deff0327a608b9b6ea'
Expand All @@ -52,8 +52,8 @@ export default function RegistrationForm() {
college: '',
rollNumber: '',
idCardPhoto: null,
tSize: ''
// isHostelRequired: false
tSize: '',
isHostelRequired: false
})
const initialFormErrors = {
name: '',
Expand Down Expand Up @@ -178,6 +178,13 @@ export default function RegistrationForm() {
}
}

function handleHostelRequired() {
setformData((prevData) => ({
...prevData,
isHostelRequired: !prevData.isHostelRequired
}))
}

function showTshirtSizes() {
openModal()
}
Expand Down Expand Up @@ -227,10 +234,10 @@ export default function RegistrationForm() {
/>
)
)}
{/* <SwitchInput
value={formData.isHostelRequired}
handleHostelRequired={handleHostelRequired}
/> */}
<SwitchInput
value={formData.isHostelRequired}
handleHostelRequired={handleHostelRequired}
/>
<Button onClick={(e) => handleSubmit(e)} disabled={loading}>
Register
</Button>
Expand Down

0 comments on commit 49df10a

Please sign in to comment.