Skip to content

Commit

Permalink
Merge pull request #23 from Bloceducare/development
Browse files Browse the repository at this point in the history
  • Loading branch information
codeWhizperer authored Jul 2, 2023
2 parents d84368f + 8b441d6 commit e12b3bc
Show file tree
Hide file tree
Showing 7 changed files with 161 additions and 49 deletions.
2 changes: 1 addition & 1 deletion components/AboveFold.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const AboveFold = () => {
{" "}
Sponsor{" "}
</a>
<Link href="/apply/speaker">Speaker </Link>
<Link href="/apply/registration">Register </Link>
</nav>

<section className="w-250 h-255">
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"react-dom": "18.1.0",
"react-hook-form": "^7.34.2",
"react-icons": "^4.4.0",
"react-share": "^4.4.1",
"react-tabs": "^5.1.0",
"sharp": "^0.30.7",
"yup": "^0.32.11"
Expand Down
18 changes: 9 additions & 9 deletions pages/api/participant/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,19 @@ router.post(async (req, res) => {
...userInfo,
userName: userName.toLowerCase(),
email: email.toLowerCase(),
qrCode:true,
hackingEmail:true
// qrCode:true,
// hackingEmail:true
};

const QrCodetemplate =`
Web3Lagos Conference 2023
${userName}
${type}`;
// const QrCodetemplate =`
// Web3Lagos Conference 2023
// ${userName}
// ${type}`;



const qrcode = (await QRcode(QrCodetemplate)) as string;
const {secure_url:qrCodeUrl} = await cloudinary.uploader.upload(qrcode)
// const qrcode = (await QRcode(QrCodetemplate)) as string;
// const {secure_url:qrCodeUrl} = await cloudinary.uploader.upload(qrcode)


const userData: any = new participantsDb(data);
Expand Down Expand Up @@ -162,4 +162,4 @@ export default router.handler({
onNoMatch: (req, res) => {
res.status(404).end("Page is not found");
},
});
});
47 changes: 33 additions & 14 deletions servers/models/participant.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
import mongoose from "mongoose";

enum IGender {
male,
female,
others,
// enum IGender {
// male,
// female,
// others,
// }

enum Irole{
beginner,
developer,
designer,
content,
community,
others
}

const Schema = mongoose.Schema;
Expand All @@ -17,6 +26,10 @@ const ParticipantSchema = new Schema(
type: String,
required: true,
},
phone:{
type:String,
required:true
},
password: {
type: String,
},
Expand All @@ -41,10 +54,14 @@ const ParticipantSchema = new Schema(
spokenAtWeb3Before: {
type: Boolean,
},
gender: {
type: String,
enum: IGender,
// enum : ['female','male', 'others'],
// gender: {
// type: String,
// enum: IGender,
// // enum : ['female','male', 'others'],
// },
role:{
type:String,
enum:Irole
},
Im: {
type: String,
Expand All @@ -62,15 +79,15 @@ const ParticipantSchema = new Schema(
whyAcceptAsSponsor: {
type: String,
},
reasonForAttending: {
type: String,
},
// reasonForAttending: {
// type: String,
// },
attendingOtherDays: {
type: Boolean,
},
reasonForOtherDays: {
type: String,
},
// reasonForOtherDays: {
// type: String,
// },
sponsorAmtRange: {
type: String,
enum: ["2000-4999", "5000-9999", "10000-above"],
Expand Down Expand Up @@ -104,3 +121,5 @@ const users =
mongoose.models.Participant ||
mongoose.model("eventParticipants", ParticipantSchema, "eventParticipants");
export default users;
// qrJaqFY4ojlYpMBp
// AD4npgLxEA1zBhY8
2 changes: 1 addition & 1 deletion servers/template/application-resp.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ Registration
<td class="v-container-padding-padding" style="overflow-wrap:break-word;word-break:break-word;padding:5px 10px 10px 20px;font-family:'Open Sans',sans-serif;" align="left">

<div style="color: #333333; line-height: 140%; text-align: left; word-wrap: break-word;">
<p style="font-size: 14px; line-height: 140%;"><strong>Start Date / Time : </strong>&nbsp;<span style="color: #828080; font-size: 14px; line-height: 19.6px;">August 17-19 2023 </span></p>
<p style="font-size: 14px; line-height: 140%;"><strong>Start Date / Time : </strong>&nbsp;<span style="color: #828080; font-size: 14px; line-height: 19.6px;">August 31 - September 2 2023 </span></p>
</div>

</td>
Expand Down
108 changes: 84 additions & 24 deletions views/apply-registration/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import { useState } from "react";
import axios from "axios";

import { TwitterShareButton, TwitterIcon } from "react-share";
type IRegister = {
userName: string;
email: string;
telegramID: string;
twitterHandle: string;
companyName: string;
gender: string;
role: string;
phone: string;
type: string;
location: string;
reasonForAttending: string;
// reasonForAttending: string;
attendingOtherDays: boolean;
reasonForOtherDays: String;
// reasonForOtherDays: String;
};

const defaultUserInput = {
Expand All @@ -21,12 +22,13 @@ const defaultUserInput = {
telegramID: "",
twitterHandle: "",
companyName: "",
gender: "",
location: "",
role: "", // out
phone: "",
type: "attendant",
location: "", //out
attendingOtherDays: false,
reasonForOtherDays: "",
reasonForAttending: "",
// reasonForOtherDays: "", //out
// reasonForAttending: "", //out
};
type DetailedHTMLProps = /*unresolved*/ any;
const ApplyAsAnAttendant = () => {
Expand All @@ -41,9 +43,10 @@ const ApplyAsAnAttendant = () => {
twitterHandle,
companyName,
location,
reasonForAttending,
reasonForOtherDays,
attendingOtherDays,
// reasonForAttending,
// reasonForOtherDays,
// attendingOtherDays,
phone,
} = userInputs;

const handleChange = (
Expand Down Expand Up @@ -95,7 +98,7 @@ const ApplyAsAnAttendant = () => {
<div className="p-3 mt-12">
<div className="text-center">
<h1 className="mb-2 text-3xl font-semibold text-gray-800">
Web3 Lagos 2022 Registration
Web3 Lagos 2023 Registration
</h1>
{!!dataStatus.error && (
<span className="text-red-500 ">{dataStatus.error}</span>
Expand Down Expand Up @@ -144,6 +147,26 @@ const ApplyAsAnAttendant = () => {
{/* border-red-300 */}
{/* <p className="mt-2 text-sm text-red-400">Email is required</p> */}
</div>
<div className="mb-5">
<label
htmlFor="twitter"
className="block mb-2 font-bold text-gray-600"
>
Phone number <span className="text-red-600">*</span>{" "}
</label>
<input
type="text"
id="phone"
name="phone"
onChange={handleChange}
placeholder="Put in your phone number."
className="w-full p-3 border rounded shadow"
value={phone}
required
/>
{/* border-red-300 */}
{/* <p className="mt-2 text-sm text-red-400">Email is required</p> */}
</div>

<div className="mb-5">
<label className="block mb-2 font-bold text-gray-600">
Expand All @@ -152,15 +175,15 @@ const ApplyAsAnAttendant = () => {
<input
type="text"
name="location"
placeholder="Put in your location."
placeholder="Lagos,Nigeria"
className="w-full p-3 border rounded shadow"
onChange={handleChange}
value={location}
required
/>
</div>

<div className="mb-5">
{/* <div className="mb-5">
<label className="block mb-2 font-bold text-gray-600">
Why Do you want to attend{" "}
<span className="text-red-600">*</span>{" "}
Expand All @@ -174,11 +197,11 @@ const ApplyAsAnAttendant = () => {
placeholder="Enter your reason here."
required
></textarea>
</div>
</div> */}

<div className="mb-5 ">
<span className="block mb-2 font-bold text-gray-600">
Are you attending day 1 and 2 ?
Are you attending workshop days (Thursday and Friday)?
</span>
<div className="flex items-center p-3 mt-2">
<div className="">
Expand Down Expand Up @@ -217,7 +240,7 @@ const ApplyAsAnAttendant = () => {
</div>
</div>

{!!attendingOtherDays && (
{/* {!!attendingOtherDays && (
<div className="mb-5">
<label className="block mb-2 font-bold text-gray-600">
Reasons For Attending Day 1 and 2
Expand All @@ -238,7 +261,7 @@ const ApplyAsAnAttendant = () => {
required
></textarea>
</div>
)}
)} */}

<div className="mb-5">
<label className="block mb-2 font-bold text-gray-600">
Expand All @@ -256,18 +279,21 @@ const ApplyAsAnAttendant = () => {

<div className="mb-5">
<label className="block mb-2 font-bold text-gray-600">
Gender{" "}
What best describes your role in web3{" "}
</label>
<select
className="block w-full p-3 mt-1 border form-select"
name="gender"
name="role"
onChange={handleChange}
>
<option selected disabled>
Please Select an Option
</option>
<option value="male">Male</option>
<option value="female">Female</option>
<option value="beginner">I am new to Blockchain/Web3</option>
<option value="developer">Developer</option>
<option value="designer">Designer</option>
<option value="content">Content Creator</option>
<option value="community">Community Manager</option>
<option value="others">Others</option>
</select>
</div>
Expand All @@ -276,7 +302,13 @@ const ApplyAsAnAttendant = () => {
<div className="grid grid-cols-1 md:grid-cols-2 md:gap-4">
<div className="mb-5 ">
<label className="block mb-2 font-bold text-gray-600">
Telegram Username{" "}
<span> Telegram Username </span>
<br />
<span className="text-xs hover:text-sky-500">
<a href="https://t.me/Web3bridge" target="_blank">
Do join our telegram channel
</a>
</span>
</label>
<input
type="text"
Expand All @@ -290,7 +322,16 @@ const ApplyAsAnAttendant = () => {

<div className="mb-5">
<label className="block mb-2 font-bold text-gray-600">
Twitter Handle{" "}
<span> Twitter Handle </span>
<br />
<span className="text-xs hover:text-sky-500">
<a
href="https://twitter.com/Web3Bridge"
target="_blank"
>
Follow us on twitter
</a>
</span>
</label>
<input
type="text"
Expand All @@ -315,6 +356,25 @@ const ApplyAsAnAttendant = () => {
)}

{!!message && message}
{!!message && (
<div>
<h4 className="mt-2">Make a tweet</h4>
<TwitterShareButton
className="items-center"
url="https://event.web3bridge.com/"
title="I just registered for web3Lagos Conference 2023 !!"
hashtags={[
"Web3",
"Blockchain",
"Web3Bridge",
"Web3LagosConference",
]}
related={["@Web3Bridge"]}
>
<TwitterIcon size={32} round />
</TwitterShareButton>
</div>
)}
</div>
</div>
);
Expand Down
Loading

0 comments on commit e12b3bc

Please sign in to comment.