Skip to content

Commit

Permalink
[highlighter] - top bar improvements (#5270)
Browse files Browse the repository at this point in the history
* add share feedback button to top bar

* export and preview button to correct position

* translation fix

* only to kick off test again

* kick off pipe again

---------

Co-authored-by: Micheline Wu <[email protected]>
  • Loading branch information
marvinoffers and michelinewu authored Jan 15, 2025
1 parent ebdd5ed commit 5fa5e03
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 16 deletions.
31 changes: 28 additions & 3 deletions app/components-react/highlighter/ClipsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from './utils';
import ClipsViewModal from './ClipsViewModal';
import { useVuex } from 'components-react/hooks';
import { Button } from 'antd';
import { Button, Tooltip } from 'antd';
import { SUPPORTED_FILE_TYPES } from 'services/highlighter/constants';
import { $t } from 'services/i18n';
import path from 'path';
Expand Down Expand Up @@ -59,6 +59,8 @@ export default function ClipsView({
return HighlighterService.getClips(HighlighterService.views.clips, props.id);
}, [props.id]);

const noClipsToExport = getClips().some(clip => clip.enabled) === false;

useEffect(() => {
setClipsLoaded(false);
setClips(sortAndFilterClips(getClips(), props.id, activeFilter));
Expand Down Expand Up @@ -196,13 +198,36 @@ export default function ClipsView({
{props.streamTitle ?? $t('All highlight clips')}
</h1>
</header>
<div style={{ padding: '20px' }}>
<div style={{ padding: '20px', display: 'flex', gap: '8px' }}>
<Button
type="text"
icon={<i className="icon-community" style={{ marginRight: 8 }} />}
onClick={shareFeedback}
>
Share Feedback
{$t('Share feedback')}
</Button>
<Tooltip
title={
noClipsToExport ? $t('Select at least one clip to preview your video') : null
}
placement="bottom"
>
<Button disabled={noClipsToExport} onClick={() => setModal({ modal: 'preview' })}>
{$t('Preview')}
</Button>
</Tooltip>
<Tooltip
title={noClipsToExport ? $t('Select at least one clip to export your video') : null}
placement="bottom"
>
<Button
disabled={noClipsToExport}
type="primary"
onClick={() => setModal({ modal: 'export' })}
>
{$t('Export')}
</Button>
</Tooltip>
</div>
</div>
{sortedList.length === 0 ? (
Expand Down
13 changes: 0 additions & 13 deletions app/components-react/highlighter/EditingControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,6 @@ export function EditingControls({
)}
</Animate>
</Form>
<Button
style={{ marginTop: '16px', marginRight: '8px' }}
onClick={() => emitSetShowModal('preview')}
>
{$t('Preview')}
</Button>
<Button
type="primary"
style={{ marginTop: '16px' }}
onClick={() => emitSetShowModal('export')}
>
{$t('Export')}
</Button>
</Scrollable>
);
}

0 comments on commit 5fa5e03

Please sign in to comment.