mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: use editable workaround for blocks
This commit is contained in:
parent
a05b298c91
commit
21f1f2fd94
10 changed files with 36 additions and 14 deletions
|
|
@ -8,10 +8,13 @@ import { getActivityBlockMediaDirectory } from "@services/media/media";
|
|||
import { UploadIcon } from "@radix-ui/react-icons";
|
||||
import { useOrg } from "@components/Contexts/OrgContext";
|
||||
import { useCourse } from "@components/Contexts/CourseContext";
|
||||
import { useEditorProvider } from "@components/Contexts/Editor/EditorContext";
|
||||
|
||||
function VideoBlockComponents(props: any) {
|
||||
const org = useOrg() as any;
|
||||
const course = useCourse() as any;
|
||||
const editorState = useEditorProvider() as any;
|
||||
const isEditable = editorState.isEditable;
|
||||
const [video, setVideo] = React.useState(null);
|
||||
const [isLoading, setIsLoading] = React.useState(false);
|
||||
const [blockObject, setblockObject] = React.useState(props.node.attrs.blockObject);
|
||||
|
|
@ -39,7 +42,7 @@ function VideoBlockComponents(props: any) {
|
|||
return (
|
||||
<NodeViewWrapper className="block-video">
|
||||
{!blockObject && (
|
||||
<BlockVideoWrapper className="flex items-center space-x-3 py-7 bg-gray-50 rounded-xl text-gray-900 px-3 border-dashed border-gray-150 border-2" contentEditable={props.extension.options.editable}>
|
||||
<BlockVideoWrapper className="flex items-center space-x-3 py-7 bg-gray-50 rounded-xl text-gray-900 px-3 border-dashed border-gray-150 border-2" contentEditable={isEditable}>
|
||||
{isLoading ? (
|
||||
<Loader className="animate-spin animate-pulse text-gray-200" size={50} />
|
||||
) : (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue