mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
chore: use lectures naming
This commit is contained in:
parent
d7f1e6f94a
commit
7237a4de49
36 changed files with 404 additions and 403 deletions
|
|
@ -0,0 +1,36 @@
|
|||
import React, { useState } from "react";
|
||||
|
||||
function DynamicCanvaModal({ submitLecture, chapterId }: any) {
|
||||
const [lectureName, setLectureName] = useState("");
|
||||
const [lectureDescription, setLectureDescription] = useState("");
|
||||
|
||||
const handleLectureNameChange = (e: any) => {
|
||||
setLectureName(e.target.value);
|
||||
};
|
||||
|
||||
const handleLectureDescriptionChange = (e: any) => {
|
||||
setLectureDescription(e.target.value);
|
||||
};
|
||||
|
||||
const handleSubmit = async (e: any) => {
|
||||
e.preventDefault();
|
||||
console.log({ lectureName, lectureDescription, chapterId });
|
||||
submitLecture({
|
||||
name: lectureName,
|
||||
chapterId: chapterId,
|
||||
type: "dynamic",
|
||||
});
|
||||
};
|
||||
return (
|
||||
<div>
|
||||
<div>
|
||||
<input type="text" onChange={handleLectureNameChange} placeholder="Lecture Name" /> <br />
|
||||
<input type="text" onChange={handleLectureDescriptionChange} placeholder="Lecture Description" />
|
||||
<br />
|
||||
<button onClick={handleSubmit}>Add Lecture</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default DynamicCanvaModal;
|
||||
Loading…
Add table
Add a link
Reference in a new issue