-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from BinaryStudioAcademy/task/OV-38-add-homepage
OV-38: Add homepage
- Loading branch information
Showing
11 changed files
with
180 additions
and
1 deletion.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,8 @@ | ||
import { faEllipsisVertical, faPen } from '@fortawesome/free-solid-svg-icons'; | ||
|
||
const IconName = { | ||
OPTIONS_VERTICAL: faEllipsisVertical, | ||
PEN: faPen, | ||
} as const; | ||
|
||
export { IconName }; |
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 { IconName } from './icon-name.js'; |
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 @@ | ||
export { MainContent } from './main-content/main-content.js'; | ||
export { VideoCard } from './video-card/video-card.js'; | ||
export { VideoSection } from './video-section/video-section.js'; |
14 changes: 14 additions & 0 deletions
14
frontend/src/bundles/home/components/main-content/main-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,14 @@ | ||
import { Box } from '~/bundles/common/components/components.js'; | ||
|
||
import { VideoSection } from '../components.js'; | ||
|
||
const MainContent: React.FC = () => { | ||
return ( | ||
<Box bg="background.50" borderRadius="lg" margin="0 25px"> | ||
<VideoSection /> | ||
<VideoSection /> | ||
</Box> | ||
); | ||
}; | ||
|
||
export { MainContent }; |
92 changes: 92 additions & 0 deletions
92
frontend/src/bundles/home/components/video-card/video-card.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,92 @@ | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
|
||
import photo from '~/assets/img/photo.png'; | ||
import { | ||
Box, | ||
Flex, | ||
Icon, | ||
IconButton, | ||
Image, | ||
Text, | ||
} from '~/bundles/common/components/components.js'; | ||
import { IconName } from '~/bundles/common/icons/icons.js'; | ||
|
||
const VideoCard: React.FC = () => { | ||
return ( | ||
<Box borderRadius="8px" bg="white" padding="7px"> | ||
<Box position="relative" role="group"> | ||
<Image src={photo} alt="Video preview" borderRadius="5px" /> | ||
|
||
{/* Overlay effect */} | ||
<Box | ||
position="absolute" | ||
top="0" | ||
left="0" | ||
width="100%" | ||
height="100%" | ||
bg="rgba(53, 57, 154, 0.3)" | ||
opacity="0" | ||
transition="opacity 0.3s ease" | ||
_groupHover={{ opacity: 1 }} | ||
borderRadius="5px" | ||
/> | ||
|
||
<IconButton | ||
aria-label="Video options" | ||
position="absolute" | ||
bg="white" | ||
top="5px" | ||
right="5px" | ||
size="xs" | ||
opacity="0" | ||
transition="opacity 0.3s ease" | ||
_groupHover={{ opacity: 1 }} | ||
icon={ | ||
<Icon | ||
as={FontAwesomeIcon} | ||
icon={IconName.OPTIONS_VERTICAL} | ||
color="background.600" | ||
/> | ||
} | ||
/> | ||
|
||
<IconButton | ||
aria-label="Edit video" | ||
isRound={true} | ||
size="lg" | ||
position="absolute" | ||
bg="white" | ||
top="50%" | ||
left="calc(50% - 12.5px)" | ||
transform="translate(-50%, -50%)" | ||
opacity="0" | ||
transition="opacity 0.3s ease" | ||
_groupHover={{ opacity: 1 }} | ||
icon={ | ||
<Icon | ||
as={FontAwesomeIcon} | ||
icon={IconName.PEN} | ||
color="background.600" | ||
/> | ||
} | ||
/> | ||
</Box> | ||
|
||
<Box padding="7px 10px 5px 5px"> | ||
<Text variant="button" color="typography.900"> | ||
Video Name | ||
</Text> | ||
<Flex justify="space-between"> | ||
<Text variant="caption" color="typography.300"> | ||
Aug 9, 2024, 1:24 PM | ||
</Text> | ||
<Text variant="caption" color="typography.300"> | ||
0,30 sec | ||
</Text> | ||
</Flex> | ||
</Box> | ||
</Box> | ||
); | ||
}; | ||
|
||
export { VideoCard }; |
39 changes: 39 additions & 0 deletions
39
frontend/src/bundles/home/components/video-section/video-section.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,39 @@ | ||
import { | ||
Badge, | ||
Box, | ||
Flex, | ||
Heading, | ||
SimpleGrid, | ||
} from '~/bundles/common/components/components.js'; | ||
|
||
import { VideoCard } from '../components.js'; | ||
|
||
const VideoSection: React.FC = () => { | ||
return ( | ||
<Box padding="17px 28px"> | ||
<Flex alignItems="center" marginBottom="9px"> | ||
<Heading color="typography.900" variant="H3" marginRight="11px"> | ||
Videos | ||
</Heading> | ||
<Badge | ||
color="background.600" | ||
bg="#D1D4DB" | ||
fontWeight="400" | ||
padding="2px 10px" | ||
> | ||
23 | ||
</Badge> | ||
</Flex> | ||
<SimpleGrid minChildWidth="253px" spacing="20px"> | ||
{/* TODO: Update this mocked data */} | ||
<VideoCard /> | ||
<VideoCard /> | ||
<VideoCard /> | ||
<VideoCard /> | ||
<VideoCard /> | ||
</SimpleGrid> | ||
</Box> | ||
); | ||
}; | ||
|
||
export { VideoSection }; |
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,15 @@ | ||
import { Box, Header } from '~/bundles/common/components/components.js'; | ||
|
||
import { MainContent } from '../components/components.js'; | ||
|
||
const Home: React.FC = () => { | ||
return ( | ||
<Box bg="background.900" height="100vh"> | ||
<Header /> | ||
{/* Sidebar */} | ||
<MainContent /> | ||
</Box> | ||
); | ||
}; | ||
|
||
export { Home }; |
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