Skip to content

Commit

Permalink
Merge pull request #1658 from gtech-mulearn/dev
Browse files Browse the repository at this point in the history
Dev Server
  • Loading branch information
nashnsulthan authored Oct 20, 2024
2 parents 013d4ff + 97d903b commit f561c87
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const LcReportAttendee = () => {
formData.append("report", reportText);
if (submitedTasks.length === 0) {
toast.error(
"Hmmm, please submit proof of work for atleast one task you have done."
"Please submit proof of work for atleast one task you have done."
);
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,37 @@ 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<LcMeetupInfo[]>();
const [selectedCategory, setSelectedCategories] = useState<{
label: string;
value: string;
}>();
useEffect(() => {
getMeetups(setMeetups, undefined, user_id ? user_id : undefined)
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]);
}, [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 (
<div className={styles.ContentWrapper}>
Expand All @@ -31,6 +50,21 @@ const LcMeetups = ({ user_id }: { user_id: string | null }) => {
{meetups && meetups.length > 0 ? (
<>
<b>Meetups</b>
<Select
placeholder="Category"
options={categories}
value={
categories.filter(
cate =>
cate.value ===
selectedCategory?.value
)[0]
}
onChange={val => {
setSelectedCategories(val as any);
}}
isLoading={false}
/>
<div className={styles.meetupGrid}>
{meetups.map((meetup, pos) => (
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ export const getMeetups = async (
| UseStateFunc<LcMeetupInfo[] | undefined>
| UseStateFunc<LcMeetupInfo | undefined>,
meetId: string | undefined = undefined,
userId: string | undefined = undefined
userId: string | undefined = undefined,
category: string | undefined = undefined
) => {
try {
console.log(meetId);
Expand All @@ -172,6 +173,10 @@ export const getMeetups = async (
? {
meet_id: meetId
}
: category
? {
category: category
}
: {}
}
);
Expand Down

0 comments on commit f561c87

Please sign in to comment.