Skip to content

Commit

Permalink
[#3] feat: VideoModal-VideoSection UI implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
hanbin9775 committed Aug 1, 2021
1 parent 916a980 commit 678df9e
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useContext } from 'react';
import styled, { ThemeContext } from 'styled-components';

const UploaderSection = () => {
const themeStyle = useContext(ThemeContext);
return <div>Hi</div>;
};

Expand Down
3 changes: 3 additions & 0 deletions src/components/VideoModal/VideoModal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useContext } from 'react';
import styled, { ThemeContext } from 'styled-components';

import VideoSection from './VideoSection';
import UploaderSection from './UploaderSection';
import CommentSection from './CommentSection';
Expand Down Expand Up @@ -45,11 +46,13 @@ const ModalContentWrapper = styled.div`

const ModalLeftContent = styled.div`
width: 100%;
position: relative;
`;

const ModalRightContent = styled.div`
width: 100%;
display: flex;
padding: 20px;
flex-direction: column;
`;

Expand Down
58 changes: 56 additions & 2 deletions src/components/VideoModal/VideoSection/VideoSection.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,63 @@
import React, { useContext } from 'react';
import styled, { ThemeContext } from 'styled-components';
import SampleVideo from 'assets/video/shorts_1min.mp4';
import sampleVideoUrl from 'assets/video/shorts_1min.mp4';

const VideoSection = () => {
return <div>Hi</div>;
return (
<VideoWrapper>
<video
loop
muted
autoPlay
playsInline
style={{
width: '100%',
height: '100%',
position: 'absolute',
objectFit: 'cover',
zIndex: 0,
}}
>
<source src={sampleVideoUrl} type="video/mp4" />
<track kind="captions" />
</video>
<VideoController>
<PlayButton />
<VolumeButton />
</VideoController>
</VideoWrapper>
);
};

const VideoWrapper = styled.div`
height: 100%;
width: 100%;
position: relative;
overflow: hidden;
border-radius: 5px 0 0 5px;
`;

const VideoController = styled.div`
position: absolute;
display: flex;
bottom: 20px;
width: 100%;
padding: 0 20px;
justify-content: space-between;
`;

const PlayButton = styled.div`
height: 24px;
width: 24px;
background: #fff;
cursor: pointer;
`;

const VolumeButton = styled.div`
height: 24px;
width: 24px;
background: #fff;
cursor: pointer;
`;

export default VideoSection;

0 comments on commit 678df9e

Please sign in to comment.