Skip to content

Commit a5a977b

Browse files
committed
chore(dashboard): fixes
1 parent 6a7d500 commit a5a977b

File tree

2 files changed

+71
-33
lines changed

2 files changed

+71
-33
lines changed

src/modules/Dashboard/modules/LearningCircleV2/pages/CreateLCMeetup/CreateLCMeetup.tsx

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -48,34 +48,37 @@ export default function CreateLCMeetup() {
4848
date: date(),
4949
duration: 3
5050
};
51-
const onSubmit = (values: any) => {
52-
if (!selectedLocation) {
53-
toast.error("Please select a location for the meetup");
54-
return;
55-
}
56-
setIsLoading(true);
57-
const date = new Date(values.date);
58-
const meetupData: LCMeetCreate = {
59-
circle_id: params.circle_id ?? "",
60-
title: values.title,
61-
is_report_needed: values.is_proof_required,
62-
report_description: values.proof_description,
63-
meet_place: selectedLocation.name,
64-
coord_x: selectedLocation.lat,
65-
coord_y: selectedLocation.lon,
66-
meet_time: date.toISOString(),
67-
duration: values.duration
68-
};
51+
// const onSubmit = (values: any) => {
52+
// if (!selectedLocation) {
53+
// toast.error("Please select a location for the meetup");
54+
// return;
55+
// }
56+
// setIsLoading(true);
57+
// const date = new Date(values.date);
58+
// const meetupData: LCMeetCreate = {
59+
// circle_id: params.circle_id ?? "",
60+
// title: values.title,
61+
// is_report_needed: values.is_proof_required,
62+
// report_description: values.proof_description,
63+
// meet_place: selectedLocation.name,
64+
// coord_x: selectedLocation.lat,
65+
// coord_y: selectedLocation.lon,
66+
// meet_time: date.toISOString(),
67+
// duration: values.duration,
68+
// description: values.,
69+
// meet_link,
70+
// mode
71+
// };
6972

70-
scheduleMeetup(meetupData).then(status => {
71-
setIsLoading(false);
72-
if (status) {
73-
navigate(
74-
`/dashboard/learningcircle/dashboard/${params.circle_id}`
75-
);
76-
}
77-
});
78-
};
73+
// scheduleMeetup(meetupData).then(status => {
74+
// setIsLoading(false);
75+
// if (status) {
76+
// navigate(
77+
// `/dashboard/learningcircle/dashboard/${params.circle_id}`
78+
// );
79+
// }
80+
// });
81+
// };
7982
const handleLocationSearch = (location: string) => {
8083
setLocationLoading(true);
8184
searchCoordinates(location).then(data => {
@@ -87,11 +90,10 @@ export default function CreateLCMeetup() {
8790
return (
8891
<div className={styles.createLCMeetup}>
8992
<h1>Schedule your next meet</h1>
90-
<Formik initialValues={initialValues} onSubmit={onSubmit}>
93+
{/* <Formik initialValues={initialValues} onSubmit={onSubmit}>
9194
{formik => (
9295
<Form className={styles.form}>
9396
<div className={styles.formGroup}>
94-
{/* <label htmlFor="title">Title</label> */}
9597
<SimpleInput
9698
name="title"
9799
required
@@ -126,9 +128,6 @@ export default function CreateLCMeetup() {
126128
</div>
127129
{formik.values.is_proof_required ? (
128130
<div className={styles.formGroup}>
129-
{/* <label htmlFor="proof_description">
130-
Proof description
131-
</label> */}
132131
<textarea
133132
required={formik.values.is_proof_required}
134133
maxLength={1000}
@@ -254,7 +253,7 @@ export default function CreateLCMeetup() {
254253
</PowerfulButton>
255254
</Form>
256255
)}
257-
</Formik>
256+
</Formik> */}
258257
</div>
259258
);
260259
}

src/modules/Dashboard/modules/LearningPaths/pages/LearningPathOne/LearningCircleCreateForm.tsx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ import { useState } from "react";
22
import styles from "./LearningCircleLanding.module.css";
33
import { createLearningCircle, scheduleMeetup } from "../../../LearningCircleV2/services/LearningCircleAPIs";
44
import { useNavigate } from "react-router-dom";
5+
import ReactSelect from "react-select";
6+
import { getInterests } from "../../../ManageUsers/apis";
57

68

79
const LearningCircleCreateForm = ({ setIsCreateModalOpen }: { setIsCreateModalOpen: (type: boolean) => void }) => {
810
const [title, setTitle] = useState('');
11+
const [ig, setIg] = useState('');
912
const [description, setDescription] = useState('');
1013
const [meetingType, setMeetingType] = useState('online'); // default selection
1114
const [meetLink, setMeetLink] = useState('');
@@ -47,6 +50,15 @@ const LearningCircleCreateForm = ({ setIsCreateModalOpen }: { setIsCreateModalOp
4750
setIsCreateModalOpen(false);
4851
};
4952

53+
const getOptions = () => {
54+
getInterests().then((data) => {
55+
return data.map(ig => ({
56+
label: ig.name,
57+
value: ig.id
58+
}))
59+
})
60+
}
61+
5062

5163
return (
5264
<form className={styles.form} onSubmit={handleSubmit}>
@@ -64,6 +76,33 @@ const LearningCircleCreateForm = ({ setIsCreateModalOpen }: { setIsCreateModalOp
6476
/>
6577
</div>
6678

79+
{/* Title Field */}
80+
{/* <div className={styles.formGroup}>
81+
<label htmlFor="title">Learning Circle</label>
82+
<input
83+
id="lc"
84+
type="select"
85+
placeholder="What are you going to learn?"
86+
value={title}
87+
onChange={(e) => setIg(e.target.value)}
88+
className={styles.input}
89+
required
90+
/>
91+
</div> */}
92+
{/* <ReactSelect
93+
// onInputChange={e => {
94+
// setIg(e);
95+
// }}
96+
options={getOptions()}
97+
name="organization"
98+
placeholder="Select Category"
99+
// filterOption={CustomFilter}
100+
// isDisabled={isloading}
101+
onChange={(e: string) => {
102+
setIg(e);
103+
}}
104+
/> */}
105+
67106
{/* Description Field */}
68107
<div className={styles.formGroup}>
69108
<label htmlFor="description">Description</label>

0 commit comments

Comments
 (0)