-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OV-18: add videomodal component #36
Merged
+263
−0
Merged
Changes from 19 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
af7193f
OV-18: + Modal component
sergiy4 3a737fe
OV-18: + merge
sergiy4 2faab74
OV-18: + Tab component
sergiy4 d2340b6
OV-18: + VideoModalSideBar component
sergiy4 fe050ed
OV-18: + VideoModal component
sergiy4 64162de
OV-18: + tab component
sergiy4 d9b5c99
OV-18: * colors
sergiy4 393710b
OV-18: + enum
sergiy4 9da3d92
OV-18: + type
sergiy4 aadc9dc
OV-18: + video-preview component
sergiy4 742e62a
OV-18: + exports
sergiy4 0dbf2ce
OV-18: - old files
sergiy4 68796b7
OV-18: + VideoModalContent component
sergiy4 d2bec02
OV-18: + VideoModal component
sergiy4 a6158d4
OV-18: + enum
sergiy4 8270db9
OV-18: + icon
sergiy4 be2a8fd
OV-18: + dependencies
sergiy4 ff65ee3
OV-18: * VideoModal component
sergiy4 e7f992f
OV-18: + merge
sergiy4 a957cdc
OV-18: - libs folder
sergiy4 6189c42
OV-18: - libs folder
sergiy4 3b48a9e
Merge branch 'next' into task/OV-18-add-videomodal
sergiy4 0c3c35a
OV-18: * video-preview
sergiy4 6f03027
OV-18: * video-modal
sergiy4 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
frontend/src/bundles/common/components/video-modal/libs/components/components.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { VideoModalContent } from './video-modal-content/video-modal-content.js'; |
2 changes: 2 additions & 0 deletions
2
.../components/video-modal/libs/components/video-modal-content/libs/components/components.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { Tab } from './tab/tab.js'; | ||
export { VideoPreview } from './video-preview/video-preview.js'; |
29 changes: 29 additions & 0 deletions
29
...on/components/video-modal/libs/components/video-modal-content/libs/components/tab/tab.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Icon, Tab as ChakraTab } from '@chakra-ui/react'; | ||
import { type IconDefinition } from '@fortawesome/free-solid-svg-icons'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
|
||
type Properties = { | ||
label: string; | ||
icon: IconDefinition; | ||
}; | ||
|
||
const Tab = ({ label, icon }: Properties): JSX.Element => { | ||
return ( | ||
<ChakraTab | ||
justifyContent="stretch" | ||
borderRadius="10px" | ||
textAlign="left" | ||
_selected={{ backgroundColor: 'gray.300' }} | ||
> | ||
<Icon | ||
as={FontAwesomeIcon} | ||
icon={icon} | ||
padding="5px" | ||
height="16px" | ||
/>{' '} | ||
{label} | ||
</ChakraTab> | ||
); | ||
}; | ||
|
||
export { Tab }; |
2 changes: 2 additions & 0 deletions
2
...dal/libs/components/video-modal-content/libs/components/video-preview/libs/enums/enums.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { VideoPreview } from './video-preview.enum.js'; | ||
export { VideoSizeLabel } from './video-sizes.enum.js'; |
6 changes: 6 additions & 0 deletions
6
...onents/video-modal-content/libs/components/video-preview/libs/enums/video-preview.enum.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const VideoPreview = { | ||
PORTRAIT: 'portrait', | ||
LANDSCAPE: 'landscape', | ||
} as const; | ||
|
||
export { VideoPreview }; |
6 changes: 6 additions & 0 deletions
6
...mponents/video-modal-content/libs/components/video-preview/libs/enums/video-sizes.enum.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const VideoSizeLabel = { | ||
PORTRAIT: '1080 x 1920', | ||
LANDSCAPE: '1920 x 1080', | ||
} as const; | ||
|
||
export { VideoSizeLabel }; |
1 change: 1 addition & 0 deletions
1
...dal/libs/components/video-modal-content/libs/components/video-preview/libs/types/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { type VideoPreview } from './video-preview.type.js'; |
3 changes: 3 additions & 0 deletions
3
...onents/video-modal-content/libs/components/video-preview/libs/types/video-preview.type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
type VideoPreview = 'portrait' | 'landscape'; | ||
|
||
export { type VideoPreview }; |
78 changes: 78 additions & 0 deletions
78
...modal/libs/components/video-modal-content/libs/components/video-preview/video-preview.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import { Button, Flex, Icon, Text } from '@chakra-ui/react'; | ||
import { faPlay } from '@fortawesome/free-solid-svg-icons'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import { useCallback, useState } from 'react'; | ||
|
||
import { | ||
VideoPreview as VideoPreviewValues, | ||
VideoSizeLabel, | ||
} from './libs/enums/enums.js'; | ||
import { type VideoPreview as VideoPreviewType } from './libs/types/types.js'; | ||
|
||
const VideoPreview = (): JSX.Element => { | ||
const [view, setView] = useState<VideoPreviewType>( | ||
VideoPreviewValues.PORTRAIT, | ||
); | ||
|
||
const setPortraitView = useCallback((): void => { | ||
setView(VideoPreviewValues.PORTRAIT); | ||
}, []); | ||
|
||
const setLandscapeView = useCallback((): void => { | ||
setView(VideoPreviewValues.LANDSCAPE); | ||
}, []); | ||
|
||
return ( | ||
<Flex flexDirection="column" alignItems="center"> | ||
<Flex | ||
width={view === VideoPreviewValues.PORTRAIT ? '250px' : '720px'} | ||
height="444px" | ||
borderWidth="1px" | ||
borderColor="gray.300" | ||
borderRadius="md" | ||
justifyContent="center" | ||
alignItems="center" | ||
mb={4} | ||
> | ||
<Flex | ||
flexDirection="column" | ||
alignItems="center" | ||
color="gray.400" | ||
> | ||
<Icon | ||
as={FontAwesomeIcon} | ||
icon={faPlay} | ||
padding="5px" | ||
height="16px" | ||
/> | ||
<Text> | ||
{view === VideoPreviewValues.PORTRAIT | ||
? VideoSizeLabel.PORTRAIT | ||
: VideoSizeLabel.LANDSCAPE} | ||
</Text> | ||
</Flex> | ||
</Flex> | ||
|
||
<Flex justifyContent="center" gap={4}> | ||
<Button | ||
backgroundColor="brand.secondary.300" | ||
color="white" | ||
onMouseEnter={setLandscapeView} | ||
_hover={{ bg: 'brand.secondary.600' }} | ||
> | ||
Use landscape | ||
</Button> | ||
<Button | ||
backgroundColor="brand.secondary.300" | ||
color="white" | ||
onMouseEnter={setPortraitView} | ||
_hover={{ bg: 'brand.secondary.600' }} | ||
> | ||
Use portrait | ||
</Button> | ||
</Flex> | ||
</Flex> | ||
); | ||
}; | ||
|
||
export { VideoPreview }; |
29 changes: 29 additions & 0 deletions
29
...common/components/video-modal/libs/components/video-modal-content/video-modal-content.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { TabList, TabPanel, TabPanels, Tabs } from '@chakra-ui/react'; | ||
import { faPlay } from '@fortawesome/free-solid-svg-icons/faPlay'; | ||
|
||
import { Tab, VideoPreview } from './libs/components/components.js'; | ||
|
||
const VideoModalContent = (): JSX.Element => { | ||
return ( | ||
<Tabs orientation="vertical" variant="unstyled" height="full"> | ||
<TabList | ||
backgroundColor="gray.100" | ||
padding="20px 20px 20px" | ||
minWidth="290px" | ||
> | ||
<Tab icon={faPlay} label="Start from scratch" /> | ||
</TabList> | ||
<TabPanels | ||
display="flex" | ||
alignItems="center" | ||
justifyContent="center" | ||
> | ||
<TabPanel> | ||
<VideoPreview /> | ||
</TabPanel> | ||
</TabPanels> | ||
</Tabs> | ||
); | ||
}; | ||
|
||
export { VideoModalContent }; |
44 changes: 44 additions & 0 deletions
44
frontend/src/bundles/common/components/video-modal/video-modal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,44 @@ | ||||||
import { | ||||||
Modal, | ||||||
ModalBody, | ||||||
ModalCloseButton, | ||||||
ModalContent, | ||||||
ModalHeader, | ||||||
ModalOverlay, | ||||||
} from '@chakra-ui/react'; | ||||||
|
||||||
import { VideoModalContent } from './libs/components/components.js'; | ||||||
|
||||||
type Properties = { | ||||||
isOpen: boolean; | ||||||
closeModal: () => void; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
https://github.com/BinaryStudioAcademy/quality-criteria/blob/production/src/javascript.md A9 |
||||||
}; | ||||||
|
||||||
const VideoModal = ({ isOpen, closeModal }: Properties): JSX.Element => { | ||||||
return ( | ||||||
<Modal isOpen={isOpen} onClose={closeModal} isCentered> | ||||||
<ModalOverlay /> | ||||||
<ModalContent | ||||||
borderRadius="17px" | ||||||
maxWidth="90%" | ||||||
maxHeight="90%" | ||||||
height="full" | ||||||
overflow="auto" | ||||||
> | ||||||
<ModalHeader | ||||||
backgroundColor="gray.100" | ||||||
width="290px" | ||||||
padding="33px 44px 0px" | ||||||
> | ||||||
Create video | ||||||
</ModalHeader> | ||||||
<ModalCloseButton margin="20px" /> | ||||||
<ModalBody padding="0px"> | ||||||
<VideoModalContent /> | ||||||
</ModalBody> | ||||||
</ModalContent> | ||||||
</Modal> | ||||||
); | ||||||
}; | ||||||
|
||||||
export { VideoModal }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we dont need
libs
folder