mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: get element content from Course
This commit is contained in:
parent
4e966d9126
commit
57e64a2b74
7 changed files with 134 additions and 17 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import Link from "next/link";
|
||||
import React from "react";
|
||||
import { Draggable } from "react-beautiful-dnd";
|
||||
import { EyeOpenIcon, Pencil2Icon } from '@radix-ui/react-icons'
|
||||
import styled from "styled-components";
|
||||
|
||||
function Element(props: any) {
|
||||
|
|
@ -10,8 +11,11 @@ function Element(props: any) {
|
|||
{(provided) => (
|
||||
<ElementWrapper key={props.element.id} {...provided.draggableProps} {...provided.dragHandleProps} ref={provided.innerRef}>
|
||||
<p>{props.element.name} </p>
|
||||
<Link href={`/org/${props.orgslug}/course/${props.courseid}/element/${props.element.id.replace("element_", "")}`}>
|
||||
<a target="_blank" rel="noopener noreferrer"> <EyeOpenIcon/></a>
|
||||
</Link>
|
||||
<Link href={`/org/${props.orgslug}/course/${props.courseid}/element/${props.element.id.replace("element_", "")}/edit`}>
|
||||
<a target="_blank" rel="noopener noreferrer">Edit</a>
|
||||
<a target="_blank" rel="noopener noreferrer"> <Pencil2Icon/></a>
|
||||
</Link>
|
||||
</ElementWrapper>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ function Editor(props: EditorProps) {
|
|||
|
||||
async function setContent(content: any) {
|
||||
let element = props.element;
|
||||
element.content = content.content;
|
||||
element.content = content;
|
||||
const res = await updateElement(element, element.element_id);
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue