Skip to content
Snippets Groups Projects
Unverified Commit 29a62763 authored by Yash Rajpal's avatar Yash Rajpal Committed by GitHub
Browse files

[IMPROVE] Rounded video attachment (#26832)

parent 5474569f
No related branches found
No related tags found
No related merge requests found
import { VideoAttachmentProps } from '@rocket.chat/core-typings';
import { css } from '@rocket.chat/css-in-js';
import { Box } from '@rocket.chat/fuselage';
import colors from '@rocket.chat/fuselage-tokens/colors';
import { useMediaUrl } from '@rocket.chat/ui-contexts';
import React, { FC } from 'react';
......@@ -13,6 +15,13 @@ import AttachmentSize from '../Attachment/AttachmentSize';
import AttachmentTitle from '../Attachment/AttachmentTitle';
import { useCollapse } from '../hooks/useCollapse';
const videoAttachmentCss = css`
border: 2px solid ${colors.n200} !important;
border-radius: 2px;
display: flex;
flex-direction: column;
`;
export const VideoAttachment: FC<VideoAttachmentProps> = ({
title,
video_url: url,
......@@ -35,7 +44,7 @@ export const VideoAttachment: FC<VideoAttachmentProps> = ({
{hasDownload && link && <AttachmentDownload title={title} href={getURL(link)} />}
</AttachmentRow>
{!collapsed && (
<AttachmentContent width='full'>
<AttachmentContent width='full' className={videoAttachmentCss}>
<Box is='video' width='full' controls preload='metadata'>
<source src={getURL(url)} type={type} />
</Box>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment