From b440f3f924a03ebf04f4205368292ef347f42323 Mon Sep 17 00:00:00 2001 From: keraliss Date: Mon, 22 Jan 2024 14:57:09 +0530 Subject: [PATCH 01/19] fixes #110 : [V2] Cohort Application Page --- src/components/common/Application.jsx | 83 +++++++++++++++++++++++++++ src/pages/cohorts/bpd.astro | 2 + src/pages/cohorts/index.astro | 1 + src/pages/cohorts/lbtcl.astro | 2 + src/pages/cohorts/mb.astro | 2 + src/pages/cohorts/pb.astro | 2 + 6 files changed, 92 insertions(+) create mode 100644 src/components/common/Application.jsx diff --git a/src/components/common/Application.jsx b/src/components/common/Application.jsx new file mode 100644 index 0000000..c85ba6b --- /dev/null +++ b/src/components/common/Application.jsx @@ -0,0 +1,83 @@ +import { + Accordion, + AccordionDetails, + AccordionSummary, + Card, + Collapse, + Input, + Typography, +} from "@mui/material"; +import React, { useState } from "react"; + +const Application = ({ name }) => { + const [open, setOpen] = useState(false); + const toggleOpen = () => setOpen((cur) => !cur); + return ( + <> +
+ +
+ + ); +}; + +export default Application; diff --git a/src/pages/cohorts/bpd.astro b/src/pages/cohorts/bpd.astro index 7b7c6ac..5583b30 100644 --- a/src/pages/cohorts/bpd.astro +++ b/src/pages/cohorts/bpd.astro @@ -6,6 +6,7 @@ import CohortStructure from "../../components/cohortPages/CohortStructure.astro" import CohortDetails from "../../components/cohortPages/CohortDetails.astro"; import Syllabus from "../../components/cohortPages/Syllabus.astro"; import CohortHeader from "../../components/cohort/CohortHeader.astro"; +import Application from "../../components/common/Application"; const headerProps = { removeHeader: true, @@ -132,5 +133,6 @@ const headerProps = { ]} /> + diff --git a/src/pages/cohorts/index.astro b/src/pages/cohorts/index.astro index 0dbe4d6..8702202 100644 --- a/src/pages/cohorts/index.astro +++ b/src/pages/cohorts/index.astro @@ -4,6 +4,7 @@ import CohortCard from "../../components/cohort/CohortCard.astro"; import Carousel from "../../components/common/Carousel"; import { CollapseList } from "../../components/cohort/CollapseList"; import Checkerboard from "../../components/cohort/Checkerboard.astro"; +import Application from "../../components/common/Application"; const faqConfig = [ { diff --git a/src/pages/cohorts/lbtcl.astro b/src/pages/cohorts/lbtcl.astro index 6000512..48bdb96 100644 --- a/src/pages/cohorts/lbtcl.astro +++ b/src/pages/cohorts/lbtcl.astro @@ -6,6 +6,7 @@ import CohortStructure from "../../components/cohortPages/CohortStructure.astro" import CohortDetails from "../../components/cohortPages/CohortDetails.astro"; import Syllabus from "../../components/cohortPages/Syllabus.astro"; import CohortHeader from "../../components/cohort/CohortHeader.astro"; +import Application from "../../components/common/Application"; const headerProps = { removeHeader: true, }; @@ -167,5 +168,6 @@ const headerProps = { ]} /> + diff --git a/src/pages/cohorts/mb.astro b/src/pages/cohorts/mb.astro index 205a66b..8d56a89 100644 --- a/src/pages/cohorts/mb.astro +++ b/src/pages/cohorts/mb.astro @@ -6,6 +6,7 @@ import CohortStructure from "../../components/cohortPages/CohortStructure.astro" import CohortDetails from "../../components/cohortPages/CohortDetails.astro"; import Syllabus from "../../components/cohortPages/Syllabus.astro"; import CohortHeader from "../../components/cohort/CohortHeader.astro"; +import Application from "../../components/common/Application"; const headerProps = { removeHeader: true, }; @@ -125,5 +126,6 @@ const headerProps = { ]} /> + diff --git a/src/pages/cohorts/pb.astro b/src/pages/cohorts/pb.astro index 7f5ca0d..a001ee5 100644 --- a/src/pages/cohorts/pb.astro +++ b/src/pages/cohorts/pb.astro @@ -6,6 +6,7 @@ import CohortStructure from "../../components/cohortPages/CohortStructure.astro" import CohortDetails from "../../components/cohortPages/CohortDetails.astro"; import Syllabus from "../../components/cohortPages/Syllabus.astro"; import CohortHeader from "../../components/cohort/CohortHeader.astro"; +import Application from "../../components/common/Application"; const headerProps = { removeHeader: true, @@ -151,5 +152,6 @@ const headerProps = { ]} /> + From e24797531218e65cec932575880c61a72ab38c32 Mon Sep 17 00:00:00 2001 From: keraliss Date: Tue, 6 Feb 2024 11:14:45 +0530 Subject: [PATCH 02/19] database endpoint added and test call working --- package.json | 1 + pnpm-lock.yaml | 64 +++++++++++++++++++++ src/components/common/Application.jsx | 83 --------------------------- src/components/common/Application.tsx | 63 ++++++++++++++++++++ src/pages/cohorts/bpd.astro | 2 +- src/pages/cohorts/lbtcl.astro | 2 +- src/pages/cohorts/mb.astro | 2 +- src/pages/cohorts/pb.astro | 2 +- 8 files changed, 132 insertions(+), 87 deletions(-) delete mode 100644 src/components/common/Application.jsx create mode 100644 src/components/common/Application.tsx diff --git a/package.json b/package.json index 8b1ae86..710d770 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "@types/react": "^18.0.21", "@types/react-dom": "^18.0.6", "astro": "^3.2.3", + "axios": "^1.6.7", "react": "^18.0.0", "react-dom": "^18.0.0", "react-icons": "^4.12.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5dc3034..872d360 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,6 +29,9 @@ dependencies: astro: specifier: ^3.2.3 version: 3.2.3 + axios: + specifier: ^1.6.7 + version: 1.6.7 react: specifier: ^18.0.0 version: 18.2.0 @@ -1653,6 +1656,10 @@ packages: - terser dev: false + /asynckit@0.4.0: + resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + dev: false + /autoprefixer@10.4.16(postcss@8.4.31): resolution: {integrity: sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ==} engines: {node: ^10 || ^12 || >=14} @@ -1669,6 +1676,16 @@ packages: postcss-value-parser: 4.2.0 dev: false + /axios@1.6.7: + resolution: {integrity: sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==} + dependencies: + follow-redirects: 1.15.5 + form-data: 4.0.0 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + dev: false + /b4a@1.6.4: resolution: {integrity: sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==} requiresBuild: true @@ -1911,6 +1928,13 @@ packages: color-string: 1.9.1 dev: false + /combined-stream@1.0.8: + resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} + engines: {node: '>= 0.8'} + dependencies: + delayed-stream: 1.0.0 + dev: false + /comma-separated-tokens@2.0.3: resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} dev: false @@ -2027,6 +2051,11 @@ packages: dev: false optional: true + /delayed-stream@1.0.0: + resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} + engines: {node: '>=0.4.0'} + dev: false + /dequal@2.0.3: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} @@ -2291,6 +2320,25 @@ packages: pkg-dir: 4.2.0 dev: false + /follow-redirects@1.15.5: + resolution: {integrity: sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + dev: false + + /form-data@4.0.0: + resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} + engines: {node: '>= 6'} + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + mime-types: 2.1.35 + dev: false + /fraction.js@4.3.6: resolution: {integrity: sha512-n2aZ9tNfYDwaHhvFTkhFErqOMIb8uyzSQ+vGJBjZyanAKZVbGUQ1sngfk9FdkBw7G26O7AgNjLcecLffD1c7eg==} dev: false @@ -3166,6 +3214,18 @@ packages: picomatch: 2.3.1 dev: false + /mime-db@1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + dev: false + + /mime-types@2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + dependencies: + mime-db: 1.52.0 + dev: false + /mime@3.0.0: resolution: {integrity: sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==} engines: {node: '>=10.0.0'} @@ -3684,6 +3744,10 @@ packages: resolution: {integrity: sha512-gVNZ74nqhRMiIUYWGQdosYetaKc83x8oT41a0LlV3AAFCAZwCpg4vmGkq8t34+cUhp3cnM4XDiU/7xlgK7HGrg==} dev: false + /proxy-from-env@1.1.0: + resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + dev: false + /pump@3.0.0: resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==} requiresBuild: true diff --git a/src/components/common/Application.jsx b/src/components/common/Application.jsx deleted file mode 100644 index c85ba6b..0000000 --- a/src/components/common/Application.jsx +++ /dev/null @@ -1,83 +0,0 @@ -import { - Accordion, - AccordionDetails, - AccordionSummary, - Card, - Collapse, - Input, - Typography, -} from "@mui/material"; -import React, { useState } from "react"; - -const Application = ({ name }) => { - const [open, setOpen] = useState(false); - const toggleOpen = () => setOpen((cur) => !cur); - return ( - <> -
- -
- - ); -}; - -export default Application; diff --git a/src/components/common/Application.tsx b/src/components/common/Application.tsx new file mode 100644 index 0000000..9ccc749 --- /dev/null +++ b/src/components/common/Application.tsx @@ -0,0 +1,63 @@ +import React, { useState, FormEvent } from "react"; +import axios from "axios"; + +const Application: React.FC = () => { + const [userName, setUserName] = useState(""); + const [email, setEmail] = useState(""); + const [role, setRole] = useState(""); + + const handleSubmit = (e: FormEvent): void => { + e.preventDefault(); + console.log("Starting"); + const userData = { + name: userName, + email: email, + role: role, + }; + console.log("userdata", userData); + axios.post("http://13.232.129.218/register", userData).then((response) => { + console.log(response); + }); + console.log("done"); + }; + + return ( + <> +
+

+ Found the cohort interesting? Click here to apply! +

+ +
+ + + + +
+
+ + ); +}; + +export default Application; diff --git a/src/pages/cohorts/bpd.astro b/src/pages/cohorts/bpd.astro index 5583b30..7bbf6e0 100644 --- a/src/pages/cohorts/bpd.astro +++ b/src/pages/cohorts/bpd.astro @@ -133,6 +133,6 @@ const headerProps = { ]} /> - + diff --git a/src/pages/cohorts/lbtcl.astro b/src/pages/cohorts/lbtcl.astro index 48bdb96..3656ef9 100644 --- a/src/pages/cohorts/lbtcl.astro +++ b/src/pages/cohorts/lbtcl.astro @@ -168,6 +168,6 @@ const headerProps = { ]} /> - + diff --git a/src/pages/cohorts/mb.astro b/src/pages/cohorts/mb.astro index 8d56a89..75a9bfc 100644 --- a/src/pages/cohorts/mb.astro +++ b/src/pages/cohorts/mb.astro @@ -126,6 +126,6 @@ const headerProps = { ]} /> - + diff --git a/src/pages/cohorts/pb.astro b/src/pages/cohorts/pb.astro index a001ee5..dfdd761 100644 --- a/src/pages/cohorts/pb.astro +++ b/src/pages/cohorts/pb.astro @@ -152,6 +152,6 @@ const headerProps = { ]} /> - + From 0a8023ff669819960ae13380d0545c9ebfc0512c Mon Sep 17 00:00:00 2001 From: keraliss Date: Thu, 15 Feb 2024 19:29:09 +0530 Subject: [PATCH 03/19] updated question and input ui change --- src/components/common/Application.tsx | 145 +++++++++++++++++++------- 1 file changed, 105 insertions(+), 40 deletions(-) diff --git a/src/components/common/Application.tsx b/src/components/common/Application.tsx index 9ccc749..7c727ae 100644 --- a/src/components/common/Application.tsx +++ b/src/components/common/Application.tsx @@ -1,23 +1,40 @@ -import React, { useState, FormEvent } from "react"; +import React, { useState, type FormEvent } from "react"; import axios from "axios"; const Application: React.FC = () => { - const [userName, setUserName] = useState(""); - const [email, setEmail] = useState(""); - const [role, setRole] = useState(""); + const [formData, setFormData] = useState({ + name: "", + email: "", + location: "", + year: "", + background: "", + time: "", + why: "", + // readMB: "", + // work: "", + // role: "", + // expectation: "", + // bitcoinCrypto: "", + enrolled: false, + }); + + const handleChange = ( + e: React.ChangeEvent + ) => { + const { name, value } = e.target; + setFormData((prevState) => ({ + ...prevState, + [name]: value, + })); + }; const handleSubmit = (e: FormEvent): void => { e.preventDefault(); console.log("Starting"); - const userData = { - name: userName, - email: email, - role: role, - }; - console.log("userdata", userData); - axios.post("http://13.232.129.218/register", userData).then((response) => { - console.log(response); - }); + console.log("userdata", formData); + // axios.post("http://13.232.129.218/register", formData).then((response) => { + // console.log(response); + // }); console.log("done"); }; @@ -25,35 +42,83 @@ const Application: React.FC = () => { <>

- Found the cohort interesting? Click here to apply! + Register for the cohort now!

-
- - - - + +

Name/Pseudonym*

+ +

Email*

+ +

Location*

+ +

Which year did you start taking Bitcoin seriously?*

+ +

Skills

+ +

Portfolio/Github/Side-project link:

+ +

How many hours per week are you willing to dedicate to this cohort?

+ +

What do you hope to achieve through this Cohort?

+