Skip to content

Commit

Permalink
https for video src
Browse files Browse the repository at this point in the history
  • Loading branch information
GraemeFulton committed Jun 23, 2024
1 parent 20d35c6 commit 3bc04dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
8 changes: 7 additions & 1 deletion components/Editor/Menus/FloatingMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,13 @@ const uploadMedia = (event, editor, user, setLoading, setIsOpen) => {
toast.success("Video Uploaded!", {
duration: 5000,
});
const url = response?.data?.url;
let url = response?.data?.url;

//ensure url has https:// prefix
if (!url.startsWith("https://")) {
url = "https://" + url;
}

// editor.chain().focus().setFigure({src: url, caption:'enter caption'}).run()
// editor.chain().focus().setImage({ src: url }).run();
editor.commands.setFigure({
Expand Down
22 changes: 2 additions & 20 deletions components/Editor/Menus/VideoMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,13 @@ import { blackA, slate } from "@radix-ui/colors";
import VideoModalButton from "./MenuButtons/VideoPopoverButton/VideoPopoverButton";
// import ImagePopoverButton from "./MenuButtons/ImagePopoverButton/ImagePopoverButton";
import { useState } from "react";
import { posToDOMRect } from "@tiptap/core";
// import { posToDOMRect } from "@tiptap/core";

import { roundArrow } from "tippy.js";
// import { roundArrow } from "tippy.js";
import "tippy.js/dist/svg-arrow.css";

import "tippy.js/animations/scale-subtle.css";

const IconButton = styled("button", {
// all: 'unset',
fontFamily: "inherit",
borderRadius: "6px",
height: 28,
width: 35,
display: "inline-flex",
marginRight: 1,
marginLeft: 1,
alignItems: "center",
justifyContent: "center",
// color: slate.slate6,
// backgroundColor: 'transparent',
boxShadow: `0 2px 10px ${blackA.blackA7}`,
// '&:hover': { backgroundColor: slate.slate11 },
"&:focus": { boxShadow: `0 0 0 2px black` },
// '&:active':{background:'white'}
});

const VideoMenu = ({ editor, isSelecting }) => {
if (!editor) {
Expand Down

0 comments on commit 3bc04dc

Please sign in to comment.