-
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.
Add compact layout to video media player
Fixes Collaborne/backlog#3032
- Loading branch information
Showing
16 changed files
with
356 additions
and
211 deletions.
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
30 changes: 30 additions & 0 deletions
30
src/components/bottom-control-buttons/components/CollapseIconButton.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,30 @@ | ||
import { IconButton } from '@mui/material'; | ||
import { PiArrowsInLineVertical, PiArrowsVertical } from 'react-icons/pi'; | ||
|
||
import { useOnHoveredControlElement } from '../../../hooks'; | ||
|
||
export interface CollapseIconButtonProps { | ||
isCollapsed?: boolean; | ||
onToggleCollapse: VoidFunction; | ||
} | ||
|
||
/** | ||
* @category React Component | ||
* @category UI Controls | ||
*/ | ||
export function CollapseIconButton(props: CollapseIconButtonProps) { | ||
const { onMouseEnter, onMouseLeave } = useOnHoveredControlElement(); | ||
|
||
const Icon = !props.isCollapsed ? PiArrowsInLineVertical : PiArrowsVertical; | ||
|
||
return ( | ||
<IconButton | ||
onMouseEnter={onMouseEnter} | ||
onMouseLeave={onMouseLeave} | ||
onClick={props.onToggleCollapse} | ||
size="medium" | ||
> | ||
<Icon fontSize="medium" /> | ||
</IconButton> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,10 +1,16 @@ | ||
import { makeStyles } from 'tss-react/mui'; | ||
|
||
export const useControlsStyles = makeStyles()({ | ||
export const useControlsStyles = makeStyles<{ | ||
isCollapsed?: boolean; | ||
} | void>()((theme, { isCollapsed = false } = {}) => ({ | ||
controls: { | ||
width: '100%', | ||
height: '100%', | ||
position: 'absolute', | ||
pointerEvents: 'none', | ||
...(isCollapsed && { | ||
position: 'relative', | ||
backgroundColor: theme.palette.common.black, | ||
}), | ||
}, | ||
}); | ||
})); |
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
Oops, something went wrong.