Feature/video updates (#109)

* Revert audio player
* Show media body text
* Add snackbar on upload Video click
This commit is contained in:
Ilya Y 2023-06-13 10:26:50 +03:00 committed by GitHub
parent e2858c1eed
commit 06c3740db2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 2 deletions

View File

@ -46,6 +46,15 @@ const MediaView = (props: { media: MediaItem; kind: Shout['layout'] }) => {
description={props.media.body} description={props.media.body}
/> />
</Match> </Match>
<Match when={props.kind === 'audio'}>
<div>
<h5>{props.media.title}</h5>
<audio controls>
<source src={props.media.url} />
</audio>
<hr />
</div>
</Match>
</Switch> </Switch>
</> </>
) )
@ -79,6 +88,7 @@ export const FullArticle = (props: ArticleProps) => {
} }
const body = createMemo(() => props.article.body) const body = createMemo(() => props.article.body)
const media = createMemo(() => { const media = createMemo(() => {
const mi = JSON.parse(props.article.media || '[]') const mi = JSON.parse(props.article.media || '[]')
console.debug('!!! media items', mi) console.debug('!!! media items', mi)
@ -169,6 +179,9 @@ export const FullArticle = (props: ArticleProps) => {
{(m: MediaItem) => ( {(m: MediaItem) => (
<div class={styles.shoutMediaBody}> <div class={styles.shoutMediaBody}>
<MediaView media={m} kind={props.article.layout} /> <MediaView media={m} kind={props.article.layout} />
<Show when={m?.body}>
<MD body={m.body} />
</Show>
</div> </div>
)} )}
</For> </For>

View File

@ -11,8 +11,17 @@
font-weight: 500; font-weight: 500;
padding: 24px; padding: 24px;
transition: background-color 0.3s ease-in-out; transition: background-color 0.3s ease-in-out;
cursor: pointer;
overflow: hidden;
position: relative;
&.active { .text {
position: relative;
z-index: 1;
}
&.active,
&:hover {
background-color: rgba(#2638d9, 0.3); background-color: rgba(#2638d9, 0.3);
&::after { &::after {

View File

@ -98,10 +98,17 @@ export const VideoUploader = (props: Props) => {
onDragEnter={handleDrag} onDragEnter={handleDrag}
onDragLeave={handleDrag} onDragLeave={handleDrag}
onDragOver={handleDrag} onDragOver={handleDrag}
onClick={() =>
showSnackbar({
body: t(
'This functionality is currently not available, we would like to work on this issue. Use the download link.'
)
})
}
ref={dropzoneRef} ref={dropzoneRef}
class={clsx(styles.dropArea, { [styles.active]: dragActive() })} class={clsx(styles.dropArea, { [styles.active]: dragActive() })}
> >
{t('Upload video')} <div class={styles.text}>{t('Upload video')}</div>
</div> </div>
<Show when={dragError()}> <Show when={dragError()}>
<div class={styles.error}>{dragError()}</div> <div class={styles.error}>{dragError()}</div>