-
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-38: Add homepage #57
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
f1b5204
OV-38: + basic video section component
Sanchousina 56df2b6
OV-38: + basic main section component for home page
Sanchousina c39ad56
OV-38: + basic home page component
Sanchousina 86b0c5a
OV-38: * add home page to app routes
Sanchousina bb98ddb
OV-38: - margin bottom from header
Sanchousina f66caed
OV-38: + video card component
Sanchousina e852b92
OV-38: + video card color overlay effect on hover
Sanchousina 39a50f8
OV-38: + edit icon on video card hover
Sanchousina 21943da
OV-38: + reusable icon component
Sanchousina f0b47b7
OV-38: + number of videos indicator
Sanchousina c4c7354
OV-38: - fragment wrappers
Sanchousina 78c6128
OV-38: * use badge instead of box
Sanchousina d292f55
OV-38: * import chackra ui components from components.ts
Sanchousina 6d99874
OV-38: + icons folder for fa icons
Sanchousina cb3da0b
OV-38: + export all home components
Sanchousina ef50774
OV-38: * use chakra iconButton instead of custom icon component
Sanchousina 208fe75
OV-38: - custom icon button component
Sanchousina 0af2906
Merge remote-tracking branch origin/next into task/OV-38-add-homepage
Sanchousina 8671186
OV-38: + home page route to protected routes
Sanchousina e93e218
OV-38: * generalize icons approach
Sanchousina ab7720d
OV-38: + add comment about mocked data
Sanchousina ab5375d
OV-38: * icons structure
Sanchousina 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
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
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.
leave comment that is mocked data, and we need to update it