This repository has been archived by the owner on Jan 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1432 from ecency/improve-3speak-video-upload
Improve 3speak video upload
- Loading branch information
Showing
21 changed files
with
329 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/common/components/decks/deck-threads-form/deck-threads-form-toolbar-video-picker.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import Tooltip from "../../tooltip"; | ||
import { _t } from "../../../i18n"; | ||
import { PopperDropdown } from "../../popper-dropdown"; | ||
import { videoSvg } from "../../../img/svg"; | ||
import React, { useState } from "react"; | ||
import { useMappedStore } from "../../../store/use-mapped-store"; | ||
import { VideoUpload } from "../../video-upload-threespeak"; | ||
import VideoGallery from "../../video-gallery"; | ||
|
||
interface Props { | ||
onSelect: (video: string) => void; | ||
} | ||
|
||
export function DeckThreadsFormToolbarVideoPicker({ onSelect }: Props) { | ||
const { activeUser, global } = useMappedStore(); | ||
|
||
const [showUpload, setShowUpload] = useState(false); | ||
const [showGallery, setShowGallery] = useState(false); | ||
|
||
return ( | ||
<div className="deck-threads-form-toolbar-video-picker"> | ||
{activeUser && ( | ||
<Tooltip content={_t("editor-toolbar.image")}> | ||
<PopperDropdown toggle={videoSvg} hideOnClick={true}> | ||
<div className="dropdown-menu"> | ||
<div className="dropdown-item" onClick={() => setShowUpload(true)}> | ||
{_t("video-upload.upload-video")} | ||
</div> | ||
{global.usePrivate && ( | ||
<div className="dropdown-item" onClick={() => setShowGallery(true)}> | ||
{_t("video-upload.video-gallery")} | ||
</div> | ||
)} | ||
</div> | ||
</PopperDropdown> | ||
</Tooltip> | ||
)} | ||
<VideoUpload show={showUpload} setShow={setShowUpload} setShowGallery={setShowGallery} /> | ||
<VideoGallery | ||
preFilter="published" | ||
showGallery={showGallery} | ||
setShowGallery={setShowGallery} | ||
insertText={(v) => { | ||
onSelect(v); | ||
}} | ||
/> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.