mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-22 22:37:57 -05:00
feat: whisper STT and record screen (#1363)
This commit is contained in:
@@ -86,20 +86,6 @@ function EditMediaButton(props) {
|
||||
);
|
||||
}
|
||||
|
||||
function EditSubtitleButton(props) {
|
||||
let link = props.link;
|
||||
|
||||
if (window.MediaCMS.site.devEnv) {
|
||||
link = '#';
|
||||
}
|
||||
|
||||
return (
|
||||
<a href={link} rel="nofollow" title={translateString('Edit subtitle')} className="edit-subtitle">
|
||||
{translateString('EDIT SUBTITLE')}
|
||||
</a>
|
||||
);
|
||||
}
|
||||
|
||||
export default function ViewerInfoContent(props) {
|
||||
const { userCan } = useUser();
|
||||
|
||||
@@ -231,14 +217,9 @@ export default function ViewerInfoContent(props) {
|
||||
/>
|
||||
) : null}
|
||||
|
||||
{userCan.editMedia || userCan.editSubtitle || userCan.deleteMedia ? (
|
||||
{userCan.editMedia || userCan.deleteMedia ? (
|
||||
<div className="media-author-actions">
|
||||
{userCan.editMedia ? <EditMediaButton link={MediaPageStore.get('media-data').edit_url} /> : null}
|
||||
{userCan.editSubtitle && 'video' === MediaPageStore.get('media-data').media_type ? (
|
||||
<EditSubtitleButton
|
||||
link={MediaPageStore.get('media-data').edit_url.replace('edit?', 'add_subtitle?')}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
<PopupTrigger contentRef={popupContentRef}>
|
||||
<button className="remove-media">{translateString('DELETE MEDIA')}</button>
|
||||
|
||||
@@ -77,16 +77,37 @@ function headerPopupPages(user, popupNavItems, hasHeaderThemeSwitcher) {
|
||||
}
|
||||
|
||||
function UploadMediaButton({ user, links }) {
|
||||
const [popupContentRef, PopupContent, PopupTrigger] = usePopup();
|
||||
|
||||
const uploadMenuItems = [
|
||||
{
|
||||
link: links.user.addMedia,
|
||||
icon: 'upload',
|
||||
text: translateString('Upload'),
|
||||
},
|
||||
{
|
||||
link: '/record_screen',
|
||||
icon: 'videocam',
|
||||
text: translateString('Record Screen'),
|
||||
},
|
||||
];
|
||||
|
||||
return !user.is.anonymous && user.can.addMedia ? (
|
||||
<div className={'hidden-only-in-small'}>
|
||||
<CircleIconButton type="link" href={links.user.addMedia} title="Upload media">
|
||||
<MaterialIcon type="video_call" />
|
||||
<span className="hidden-txt">Upload media</span>
|
||||
</CircleIconButton>
|
||||
<div>
|
||||
<PopupTrigger contentRef={popupContentRef}>
|
||||
<CircleIconButton title={translateString('Upload media')}>
|
||||
<MaterialIcon type="video_call" />
|
||||
<span className="hidden-txt">{translateString('Upload media')}</span>
|
||||
</CircleIconButton>
|
||||
</PopupTrigger>
|
||||
<PopupContent contentRef={popupContentRef}>
|
||||
<PopupMain>
|
||||
<NavigationMenuList items={uploadMenuItems} />
|
||||
</PopupMain>
|
||||
</PopupContent>
|
||||
</div>
|
||||
) : null;
|
||||
}
|
||||
|
||||
function LoginButton({ user, link, hasHeaderThemeSwitcher }) {
|
||||
return user.is.anonymous && user.can.login ? (
|
||||
<div className="sign-in-wrap">
|
||||
|
||||
Reference in New Issue
Block a user