@@ -40,8 +49,8 @@ const LcHome = (props: Props) => {
...props.temp,
isReport: false,
isHistory: false,
- isTeam: false,
- isSchedule: false
+ isTeam: false
+ // isSchedule: false
})
}
>
@@ -59,7 +68,321 @@ const LcHome = (props: Props) => {
Team
- {props.temp.isReport ? (
+
+
+
+ {props.temp.isReport ? (
+
+ ) : props.temp.isCreateMeeting ? (
+
+ ) : (
+ <>
+
+ {meetups.length > 0 ? (
+ meetups.map(meetup => (
+
+
+
+
+
+
+ {convertToFormatedDate(
+ meetup.meet_time
+ )}
+
+
+ {meetup.is_started
+ ? "Ongoing"
+ : "Upcoming"}
+
+
+
+
+ {meetup.title}
+
+
+ {meetup.agenda}
+
+
+
+ Venue Details
+
+
+
+
{
+ props.setTemp(
+ prev => ({
+ ...prev,
+ isReport:
+ true
+ })
+ );
+ setSelectedMeeting(
+ meetup.id
+ );
+ }}
+ >
+ Submit Report
+
+
{
+ navigate(
+ "/dashboard/learning-circle/meetup/" +
+ meetup.id
+ );
+ }}
+ >
+ More Info
+
+
+
+
+
+ ))
+ ) : (
+ <>
+
+
+ Next meeting not scheduled.
+
+ Kindly schedule a meeting.
+
+
+
{
+ props.setTemp(prev => ({
+ ...prev,
+ isCreateMeeting: true
+ }));
+ }}
+ >
+ Schedule Meet
+
+ >
+ )}
+
+
+ {/*
+
+ {props.lc?.meet_place && (
+
Venue: {props.lc?.meet_place}
+ )}
+ {props.lc?.meet_time && (
+
Time: {nextMeet?.formattedTime}
+ )}
+
+ {props.lc?.meet_time && (
+
+ )}
+
*/}
+ >
+ )}
+
+ {!props.temp.isSchedule &&
+ !props.temp.isTeam &&
+ !props.temp.isReport ? (
+ <>
+ {(reportPending ?? []).length > 0 ? (
+
+
Pending Report Submissions
+
+ {reportPending.map((report, index) => (
+
+
+
{index + 1}.
+
+ {convertToFormatedDate(
+ report.meet_time
+ )}
+
+
+
+
+ {convertToFormatedDate(
+ report.meet_time
+ )}{" "}
+ {convert24to12(
+ extract24hTimeFromDateTime(
+ report.meet_time
+ )
+ )}
+
+
+
+
+ ))}
+
+
+ ) : (
+ <>>
+ )}
+
+ {props.lc?.previous_meetings &&
+ props.lc?.previous_meetings.length > 0 && (
+
Your past meetings
+ )}
+
+ {pastMeetups.map((report, index) => (
+
{
+ navigate(
+ "/dashboard/learning-circle/meetup/" +
+ report.id
+ );
+ }}
+ >
+
+
{index + 1}.
+
+ {convertToFormatedDate(
+ report.meet_time
+ )}
+
+
+
+
+ {convertToFormatedDate(
+ report.meet_time
+ )}{" "}
+ {convert24to12(
+ extract24hTimeFromDateTime(
+ report.meet_time
+ )
+ )}
+
+
+
+
+ ))}
+
+
+ >
+ ) : (
+ <>>
+ )}
+
+
+ {/* {props.temp.isReport ? (
) : props.temp.isHistory ? (
@@ -67,8 +390,8 @@ const LcHome = (props: Props) => {
- {props.temp.isSchedule ? (
-
{
<>
{nextMeet &&
- props.lc?.meet_place &&
- props.lc?.meet_time ? (
+ props.lc?.meet_place &&
+ props.lc?.meet_time ? (
Next meeting on
@@ -103,7 +426,7 @@ const LcHome = (props: Props) => {
onClick={() => {
props.setTemp(prev => ({
...prev,
- isSchedule: true
+ isCreateMeeting: true
}));
}}
>
@@ -125,16 +448,18 @@ const LcHome = (props: Props) => {
)}
- {props.lc?.meet_time && (
)}
+ {props.lc?.meet_time && (
+
+ )}
>
)}
@@ -151,52 +476,11 @@ const LcHome = (props: Props) => {
Your past meetings
)}
- {props.lc?.previous_meetings.map(
- (report, index) => (
-
{
- props.setTemp({
- ...props.temp,
- isReport: false,
- isHistory: true
- });
- setSelectedMeeting(report.id);
- }}
- >
-
-
{index + 1}.
-
- {convertToFormatedDate(
- report.meet_time
- )}
-
-
-
-
- {convert24to12(
- extract24hTimeFromDateTime(
- report.meet_time
- )
- )}
-
-
-
-
- )
- )}
+
- )}
+ )} */}
);
};
diff --git a/src/modules/Dashboard/modules/LearningCircle/pages/LcDashboard/components/LcMeetCreate.tsx b/src/modules/Dashboard/modules/LearningCircle/pages/LcDashboard/components/LcMeetCreate.tsx
new file mode 100644
index 000000000..49888b147
--- /dev/null
+++ b/src/modules/Dashboard/modules/LearningCircle/pages/LcDashboard/components/LcMeetCreate.tsx
@@ -0,0 +1,379 @@
+import { createRef, Dispatch, SetStateAction, useRef, useState } from "react";
+import styles from "../LcDashboard.module.css";
+import toast from "react-hot-toast";
+import {
+ createMeetup,
+ setLCMeetTime
+} from "../../../services/LearningCircleAPIs";
+import { useFormik } from "formik";
+import { Switch } from "@chakra-ui/react";
+import { PowerfulButton } from "@/MuLearnComponents/MuButtons/MuButton";
+
+type Props = {
+ setTemp: Dispatch
>;
+ lc: LcDetail | undefined;
+ id: string | undefined;
+};
+
+const LcMeetCreate = (props: Props) => {
+ const [tasks, setTasks] = useState([]);
+ const taskInputRef = createRef();
+ const [isLoading, setIsLoading] = useState(false);
+ const formik = useFormik({
+ initialValues: {
+ title: "",
+ location: "",
+ meet_time: "",
+ meet_place: "",
+ agenda: "",
+ need_pre_requirements: false,
+ pre_requirements: null,
+ is_public: true,
+ limit_attendees: false,
+ max_attendees: -1,
+ is_online: false
+ },
+ onSubmit: values => {
+ if (tasks.length === 0) {
+ toast.error("Please add tasks");
+ return;
+ }
+ setIsLoading(true);
+ createMeetup({ ...values, tasks: tasks }, props.id ?? "")
+ .then(res => {
+ setIsLoading(false);
+ if (res) {
+ if (res.hasError) {
+ toast.error(res.message.general[0]);
+ } else {
+ toast.success(res.message.general[0]);
+ }
+ }
+ })
+ .catch(err => {
+ setIsLoading(false);
+ toast.error("Failed to create meetup");
+ });
+
+ props.setTemp(prev => ({
+ ...prev,
+ isCreateMeeting: false
+ }));
+ },
+ validate: values => {
+ if (values.location === "") {
+ return { location: "Location is required" };
+ } else if (!values.location.startsWith("http")) {
+ return {
+ location:
+ "Location should be link to maps location or online meet link."
+ };
+ }
+ }
+ });
+
+ return (
+ <>
+
+
Create a Meetup
+
Enter details to schedule a meet
+
+
+
+ >
+ );
+};
+
+export default LcMeetCreate;
diff --git a/src/modules/Dashboard/modules/LearningCircle/pages/LcDashboard/components/LcMeetups.tsx b/src/modules/Dashboard/modules/LearningCircle/pages/LcDashboard/components/LcMeetups.tsx
new file mode 100644
index 000000000..d64786360
--- /dev/null
+++ b/src/modules/Dashboard/modules/LearningCircle/pages/LcDashboard/components/LcMeetups.tsx
@@ -0,0 +1,144 @@
+import styles from "../../LearningCircle.module.css";
+import imageBottom from "../../../assets/images/LC3.webp";
+import { PowerfulButton } from "@/MuLearnComponents/MuButtons/MuButton";
+import { useNavigate } from "react-router-dom";
+import { useEffect, useState } from "react";
+import { BsChevronRight } from "react-icons/bs";
+import { getMeetups } from "../../../services/LearningCircleAPIs";
+import toast from "react-hot-toast";
+import { convertToFormatedDate } from "../../../../../utils/common";
+import {
+ convert24to12,
+ extract24hTimeFromDateTime
+} from "../../../services/utils";
+import Select from "react-select";
+
+const LcMeetups = ({ user_id }: { user_id: string | null }) => {
+ const navigate = useNavigate();
+ const [meetups, setMeetups] = useState();
+ const [selectedCategory, setSelectedCategories] = useState<{
+ label: string;
+ value: string;
+ }>();
+ useEffect(() => {
+ getMeetups(
+ setMeetups,
+ undefined,
+ user_id ? user_id : undefined,
+ selectedCategory?.value == "all"
+ ? undefined
+ : selectedCategory?.value
+ )
+ .then(() => {})
+ .catch(error => {
+ console.log(error);
+ toast.error("Failed to fetch meetups");
+ });
+ }, [user_id, selectedCategory]);
+ const categories = [
+ { label: "All Categories", value: "all" },
+ { label: "Coder", value: "coder" },
+ { label: "Hardware", value: "hardware" },
+ { label: "Manager", value: "manager" },
+ { label: "Creative", value: "creative" }
+ ];
+
+ return (
+
+
+
+ {meetups && meetups.length > 0 ? (
+ <>
+ Meetups
+
+
+
+ );
+};
+
+export default LcMeetups;
diff --git a/src/modules/Dashboard/modules/LearningCircle/pages/LcDashboard/components/LcReport.tsx b/src/modules/Dashboard/modules/LearningCircle/pages/LcDashboard/components/LcReport.tsx
index 7a80f72e5..a8637eb7c 100644
--- a/src/modules/Dashboard/modules/LearningCircle/pages/LcDashboard/components/LcReport.tsx
+++ b/src/modules/Dashboard/modules/LearningCircle/pages/LcDashboard/components/LcReport.tsx
@@ -1,9 +1,15 @@
import { Dispatch, SetStateAction, useEffect, useState } from "react";
import styles from "../LcDashboard.module.css";
import UploadImage from "../../../assets/images/uploadIcon.svg";
-import { LcAttendees } from "./LcAttendees";
-import { reportMeeting } from "../../../services/LearningCircleAPIs";
+import {
+ getMeetupAttendees,
+ reportMeeting
+} from "../../../services/LearningCircleAPIs";
import toast from "react-hot-toast";
+import StarRatings from "react-star-ratings";
+import { BiDownArrow } from "react-icons/bi";
+import { BsEye } from "react-icons/bs";
+import { PowerfulButton } from "@/MuLearnComponents/MuButtons/MuButton";
type Props = {
setTemp: Dispatch>;
@@ -12,94 +18,58 @@ type Props = {
};
const LcReport = (props: Props) => {
- const [formData, setFormData] = useState({
- day: "",
- meet_time: "",
- agenda: "",
- attendees: []
- });
+ const [reportText, setReportText] = useState("");
const [uploadedImage, setUploadedImage] = useState(null);
-
- useEffect(() => {
- const now = new Date();
- const hours = now.getHours().toString().padStart(2, "0");
- const minutes = now.getMinutes().toString().padStart(2, "0");
- const year = now.getFullYear().toString();
- const month = (now.getMonth() + 1).toString().padStart(2, "0");
- const day = now.getDate().toString().padStart(2, "0");
- setFormData(prevState => ({
- ...prevState,
- day: `${year}-${month}-${day}`,
- meet_time: `${hours}:${minutes}:00`
- }));
- }, []);
-
+ const [attendees, setAttendees] = useState([]);
+ const [attendeeRating, setAttendeeRating] = useState<{
+ [user_id: string]: number;
+ }>({});
+ const [attendeeDetailsExpanded, setAttendeeDetailsExpanded] = useState<{
+ [user_id: string]: boolean;
+ }>({});
const handleImageUpload = (event: React.ChangeEvent) => {
const file = event.target.files && event.target.files[0];
+
if (file) {
setUploadedImage(file);
}
};
-
- const handleMemberClick = (memberId: string) => {
- setFormData(prevState => {
- // Check if the attendee is already in the list
- const isAlreadySelected = prevState.attendees.includes(memberId);
-
- // If already selected, remove them; otherwise, add them
- const updatedAttendees = isAlreadySelected
- ? prevState.attendees.filter(id => id !== memberId) // Remove the attendee
- : [...prevState.attendees, memberId]; // Add the attendee
-
- return {
- ...prevState,
- attendees: updatedAttendees
- };
- });
- };
-
- const validateForm = (state: LcReport) => {
- let errors: { [key: string]: string } = {};
- if (!state.day) {
- errors.day = "Date is required";
- }
- if (!state.meet_time) {
- errors.time = "Time is required";
- }
- if (!state.agenda.trim()) {
- errors.agenda = "Agenda is required";
- }
- if (state.attendees.length === 0) {
- errors.attendees = "At least one attendee is required";
- }
- if (!uploadedImage) {
- errors.image = "Image is required";
- } else {
- const allowedTypes = ["image/jpeg", "image/png", "image/gif"];
- if (!allowedTypes.includes(uploadedImage.type)) {
- errors.image =
- "Invalid image type. Please upload a JPEG, PNG, or GIF.";
- }
- }
- {
- Object.keys(errors).length > 0
- ? toast.error(Object.values(errors).join("\n"))
- : null;
- }
- return Object.keys(errors).length > 0 ? false : true;
- };
+ useEffect(() => {
+ getMeetupAttendees(props.id ?? "")
+ .then(res => {
+ setAttendees(res);
+ })
+ .catch(err => {
+ toast.error("Failed to fetch attendees");
+ });
+ }, []);
const handleSubmit = (event: any) => {
event.preventDefault();
- if (validateForm(formData)) {
+ if (!uploadedImage) {
+ toast.error("Please upload an image");
+ return;
+ }
+ if (reportText.length > 0) {
const data = new FormData();
- data.append("agenda", formData.agenda);
- data.append("attendees", formData.attendees.join(","));
- data.append("time", formData.meet_time);
+ data.append("report_text", reportText);
if (uploadedImage) {
data.append("images", uploadedImage);
}
-
+ var ratings = {};
+ for (var attendee of attendees) {
+ if (!attendeeRating[attendee.attendee_id]) {
+ toast.error("Please rate all attendees");
+ return;
+ } else {
+ ratings = {
+ ...ratings,
+ [attendee.attendee_id]:
+ attendeeRating[attendee.attendee_id]
+ };
+ }
+ }
+ data.append("ratings", JSON.stringify(ratings));
toast.promise(reportMeeting(props.id, data), {
loading: "Reporting...",
success: response => {
@@ -122,13 +92,29 @@ const LcReport = (props: Props) => {
}
);
-
- return Failed to report meeting!;
+ return error?.response?.data?.message ? (
+
+ {
+ (error?.response?.data?.message?.general ?? [
+ "Failed to report meeting"
+ ])[0]
+ }
+
+ ) : (
+ Failed to report meeting!
+ );
}
});
+ } else {
+ toast.error("Please fill the notes");
}
};
-
+ const changeRating = (attendee_id: string, newRating: number): void => {
+ setAttendeeRating(prevState => ({
+ ...prevState,
+ [attendee_id]: newRating
+ }));
+ };
const handleRemoveImage = () => {
setUploadedImage(null);
};
@@ -136,72 +122,116 @@ const LcReport = (props: Props) => {
return (
-
-
Agenda
+
Brief description *
-
Attendees
-
- {props.lc?.members.map(member => (
+
Attendees List
+
+ {attendees.map(attendee => (
handleMemberClick(member.id)}
+ className={styles.attendee}
+ key={attendee.attendee_id}
+ onClick={() => {
+ setAttendeeDetailsExpanded(prevState => ({
+ ...prevState,
+ [attendee.attendee_id]:
+ !prevState?.[attendee.attendee_id]
+ }));
+ }}
>
-
+
+ {attendee.fullname}
+
+
+ {
+ changeRating(
+ attendee.attendee_id,
+ rating
+ );
+ }}
+ numberOfStars={5}
+ name="rating"
+ starDimension="15px"
+ starSpacing="1px"
+ />
+
+
+
+
Report
+
+ {attendee.report}
+
+
Tasks Completed
+ {attendee.proof_of_work.map(
+ (task, index) => (
+
+
+ {index + 1} |
+ {task.title}
+
+
+
{
+ if (task.is_image) {
+ window.open(
+ import.meta
+ .env
+ .VITE_BACKEND_URL +
+ (task.image_url ??
+ "404"),
+ "_blank"
+ );
+ } else {
+ window.open(
+ task.proof_url ??
+ "",
+ "_blank"
+ );
+ }
+ }}
+ >
+
+
+
+
+ )
)}
- />
+
))}
- {/*
*/}
diff --git a/src/modules/Dashboard/modules/LearningCircle/pages/LcDashboard/components/YourLc.tsx b/src/modules/Dashboard/modules/LearningCircle/pages/LcDashboard/components/YourLc.tsx
new file mode 100644
index 000000000..e1cca1351
--- /dev/null
+++ b/src/modules/Dashboard/modules/LearningCircle/pages/LcDashboard/components/YourLc.tsx
@@ -0,0 +1,107 @@
+import styles from "../../LearningCircle.module.css";
+import imageBottom from "../../../assets/images/LC3.webp";
+import { PowerfulButton } from "@/MuLearnComponents/MuButtons/MuButton";
+import { useNavigate } from "react-router-dom";
+import { useEffect, useState } from "react";
+import { BsChevronRight } from "react-icons/bs";
+import { getUserLearningCircles } from "../../../services/LearningCircleAPIs";
+
+const YourLc = ({ userCircleList }: { userCircleList: LcType[] }) => {
+ const navigate = useNavigate();
+
+ return (
+
+ );
+};
+
+export default YourLc;
diff --git a/src/modules/Dashboard/modules/LearningCircle/pages/LcDashboard/components/YourMeetups.tsx b/src/modules/Dashboard/modules/LearningCircle/pages/LcDashboard/components/YourMeetups.tsx
new file mode 100644
index 000000000..621d56052
--- /dev/null
+++ b/src/modules/Dashboard/modules/LearningCircle/pages/LcDashboard/components/YourMeetups.tsx
@@ -0,0 +1,108 @@
+import styles from "../../LearningCircle.module.css";
+import imageBottom from "../../../assets/images/LC3.webp";
+import { PowerfulButton } from "@/MuLearnComponents/MuButtons/MuButton";
+import { useNavigate } from "react-router-dom";
+import { useEffect, useState } from "react";
+import { BsChevronRight } from "react-icons/bs";
+import { getMeetups } from "../../../services/LearningCircleAPIs";
+import toast from "react-hot-toast";
+import { convertToFormatedDate } from "../../../../../utils/common";
+import {
+ convert24to12,
+ extract24hTimeFromDateTime
+} from "../../../services/utils";
+
+const YourMeetups = ({ user_id }: { user_id: string | null }) => {
+ const navigate = useNavigate();
+ const [meetups, setMeetups] = useState
();
+ useEffect(() => {
+ console.log(user_id);
+ getMeetups(setMeetups, undefined, "user")
+ .then(() => {})
+ .catch(error => {
+ console.log(error);
+ toast.error("Failed to fetch meetups");
+ });
+ }, [user_id]);
+
+ return (
+
+ );
+};
+
+export default YourMeetups;
diff --git a/src/modules/Dashboard/modules/LearningCircle/pages/LearningCircle.module.css b/src/modules/Dashboard/modules/LearningCircle/pages/LearningCircle.module.css
index 8d1abd845..30888fa70 100644
--- a/src/modules/Dashboard/modules/LearningCircle/pages/LearningCircle.module.css
+++ b/src/modules/Dashboard/modules/LearningCircle/pages/LearningCircle.module.css
@@ -29,6 +29,7 @@
}
.learningCircleLandingPageMiddle {
+ width: 100%;
display: flex;
flex-direction: column;
justify-content: center;
@@ -164,6 +165,9 @@
.learningCircleLandingPageLevel div {
font-size: 0.8rem;
}
+ .learningCircleLandingPage .learningCircleLandingPageButton button {
+ font-size: 15px;
+ }
}
@media (width<=820px) {
@@ -1264,3 +1268,118 @@
transform: scaleX(-1);
}
}
+.SwitchNav {
+ display: flex;
+ gap: 5px;
+ align-items: center;
+ .items {
+ padding: 8px 20px;
+ background-color: #f3f3f4;
+ color: black;
+ font-weight: 600;
+ border-radius: 15px;
+ &.active {
+ background-color: white;
+ border-radius: 15px 15px 0px 0px;
+ }
+ }
+ .plusItem {
+ border-left: 2px solid #8b8e92;
+ color: black;
+ font-size: 25px;
+ padding: 0px;
+ height: fit-content;
+ padding-left: 10px;
+ line-height: 1;
+ }
+}
+
+.ContentWrapper {
+ width: 100%;
+ padding: 30px;
+ background-color: white;
+ display: flex;
+ flex-direction: column;
+ gap: 15px;
+ align-items: start;
+}
+.inputBox {
+ background: #fff;
+ margin: 0px 10px;
+ input {
+ width: 100%;
+ background-color: rgba(238, 242, 255, 1);
+ border: none;
+ border-radius: 10px;
+ padding: 10px;
+ }
+}
+.modalinfo {
+ margin: 10px;
+ color: #22222290;
+ font-size: 15px;
+}
+.meetupGrid {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: 20px;
+ .meetupCard {
+ background: #fdfdfd;
+ color: #222;
+ padding: 20px;
+ box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.05);
+ border-radius: 10px;
+ .meetupTitle {
+ font-size: 20px;
+ font-weight: 600;
+ color: #5570f2;
+ margin: 10px;
+ }
+ .meetupAgenda {
+ font-size: 15px;
+ margin: 10px;
+ text-align: justify;
+ }
+ .buttons {
+ display: flex;
+ margin: 10px;
+ gap: 10px;
+ width: 100%;
+ justify-content: space-between;
+ align-items: center;
+ margin-top: 20px;
+ a {
+ display: flex;
+ align-items: center;
+ gap: 5px;
+ padding: 10px 20px;
+ border: 1px dashed var(--blue);
+ border-radius: 10px;
+ }
+ }
+ .tags {
+ display: flex;
+ gap: 10px;
+ padding: 10px 0;
+ .tag {
+ display: flex;
+ align-items: center;
+ padding: 5px;
+ border: 1px dashed #5570f2;
+ border-radius: 10px;
+ color: #222;
+ font-size: 10px;
+ }
+ }
+ }
+ @media screen and (max-width: 768px) {
+ grid-template-columns: 1fr;
+ .meetupCard {
+ .tags {
+ .tag {
+ font-size: 10px;
+ }
+ }
+ }
+ }
+}
diff --git a/src/modules/Dashboard/modules/LearningCircle/pages/LearningCircleLandingPage.tsx b/src/modules/Dashboard/modules/LearningCircle/pages/LearningCircleLandingPage.tsx
index 59fd3de51..863c2e9f3 100644
--- a/src/modules/Dashboard/modules/LearningCircle/pages/LearningCircleLandingPage.tsx
+++ b/src/modules/Dashboard/modules/LearningCircle/pages/LearningCircleLandingPage.tsx
@@ -1,24 +1,31 @@
import styles from "./LearningCircle.module.css";
import imageTop from "../assets/images/LC2.webp";
-import imageBottom from "../assets/images/LC3.webp";
import { PowerfulButton } from "@/MuLearnComponents/MuButtons/MuButton";
import { useNavigate } from "react-router-dom";
import { useEffect, useState } from "react";
-import { BsChevronRight } from "react-icons/bs";
-import { getUserLearningCircles } from "../services/LearningCircleAPIs";
+import {
+ getUserLearningCircles,
+ joinMeetup
+} from "../services/LearningCircleAPIs";
import MuLoader from "@/MuLearnComponents/MuLoader/MuLoader";
+import YourLc from "./LcDashboard/components/YourLc";
+import LcMeetups from "./LcDashboard/components/LcMeetups";
+import MuModal from "@/MuLearnComponents/MuModal/MuModal";
+import toast from "react-hot-toast";
+import YourMeetups from "./LcDashboard/components/YourMeetups";
const LearningCircleLandingPage = () => {
const navigate = useNavigate();
const [userCircleList, setUserCircleList] = useState();
const [isLoading, setIsLoading] = useState(true);
-
+ const [curpage, setCurPage] = useState(0);
+ const [meetingCodeModalOpen, setMeetingCodeModalOpen] = useState(false);
useEffect(() => {
getUserLearningCircles(setUserCircleList).then(() => {
setIsLoading(false);
});
}, []);
-
+ const [meetupCode, setMeetupCode] = useState("");
const handleJoin = () => {
navigate("/dashboard/learning-circle/find-circle");
};
@@ -27,8 +34,46 @@ const LearningCircleLandingPage = () => {
navigate("/dashboard/learning-circle/create-circle");
};
+ const joinMeet = () => {
+ if (meetupCode.length !== 6) {
+ toast.error("Invalid meetup code");
+ return;
+ }
+ joinMeetup(meetupCode);
+ setMeetingCodeModalOpen(false);
+ };
+
+ const handleJoinMeetup = () => {
+ setMeetingCodeModalOpen(true);
+ };
return (
<>
+ {
+ setMeetingCodeModalOpen(false);
+ }}
+ title={"Enter Meeting Code"}
+ type={"success"}
+ onDone={joinMeet}
+ >
+
+ {
+ setMeetupCode(e.target.value.toUpperCase());
+ }}
+ />
+
+
+ Enter the 6 digit code provided by the meetup organizer to
+ join the meetup and earn karma points.
+
+
{isLoading ? (
@@ -49,6 +94,11 @@ const LearningCircleLandingPage = () => {
styles.learningCircleLandingPageButton
}
>
+
{
onClick={handleJoin}
/>
-
-