-
Notifications
You must be signed in to change notification settings - Fork 4
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
VIDCS-3322: Implement full-screen right panel on mobile #97
Changes from all commits
22a13cd
4626d46
05e5491
3f0ce1d
80a669f
83724eb
099d8b0
e3ec03b
8356fff
4c8e923
ac5293c
e19debd
2ea05b6
9746960
f84fd73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ const Emoji = ({ emojiWrapper }: EmojiProps): ReactElement => { | |
animationTimingFunction: 'linear', | ||
animationIterationCount: 1, | ||
maxWidth: '35%', | ||
zIndex: 1, | ||
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. Make emojis visible, even when someone has their panel/toolbar opened |
||
}; | ||
|
||
return ( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,7 +86,7 @@ const ParticipantList = ({ handleClose, isOpen }: ParticipantListProps): ReactEl | |
</Tooltip> | ||
</IconButton> | ||
</div> | ||
<List sx={{ overflowX: 'auto', height: 'calc(100vh - 240px)' }}> | ||
<List sx={{ overflowX: 'auto', height: 'calc(100dvh - 240px)' }}> | ||
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. 👏 |
||
<ParticipantListItem | ||
key="you" | ||
dataTestId="participant-list-item-you" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ import { ChangeEvent, useRef, useState, ReactElement } from 'react'; | |
import { Button, IconButton, Tooltip, Typography } from '@mui/material'; | ||
import { Delete } from '@mui/icons-material'; | ||
import captureScreenshot from '../../../../../utils/captureScreenshot'; | ||
import { isMobile } from '../../../../../utils/util'; | ||
|
||
// Setting the maximum file size to 20MB | ||
const maxFileSize = 2e7; | ||
|
@@ -92,14 +93,22 @@ const FilePicker = ({ | |
)} | ||
{!imageSrc ? ( | ||
<> | ||
<Button | ||
sx={{ width: '100%', textTransform: 'none', mb: 1 }} | ||
variant="outlined" | ||
component="label" | ||
onClick={processScreenshot} | ||
> | ||
Capture screenshot | ||
</Button> | ||
{!isMobile() && ( | ||
// The screenshot capture relies on the getDisplayMedia browser API which is unsupported on mobile devices | ||
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. Maybe we can use 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. Let's keep as-is since this utility is a little simpler 🙏 |
||
// See: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia#browser_compatibility | ||
cpettet marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<Button | ||
sx={{ | ||
width: '100%', | ||
textTransform: 'none', | ||
mb: 1, | ||
}} | ||
variant="outlined" | ||
component="label" | ||
onClick={processScreenshot} | ||
> | ||
Capture screenshot | ||
</Button> | ||
)} | ||
<Button | ||
sx={{ width: '100%', textTransform: 'none' }} | ||
variant="outlined" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,7 @@ import ParticipantList from '../ParticipantList/ParticipantList'; | |
import Chat from '../Chat'; | ||
import ReportIssue from '../ReportIssue'; | ||
import type { RightPanelActiveTab } from '../../../hooks/useRightPanel'; | ||
|
||
const height = '@apply h-[calc(100vh_-_96px)]'; | ||
import useIsSmallViewport from '../../../hooks/useIsSmallViewport'; | ||
|
||
export type RightPanelProps = { | ||
handleClose: () => void; | ||
|
@@ -21,16 +20,19 @@ export type RightPanelProps = { | |
* @returns {ReactElement} RightPanel Component | ||
*/ | ||
const RightPanel = ({ activeTab, handleClose }: RightPanelProps): ReactElement => { | ||
const isSmallViewport = useIsSmallViewport(); | ||
const width = isSmallViewport ? 'w-dvw' : 'w-[360px]'; | ||
const margins = isSmallViewport ? 'm-0' : 'mr-4 mt-4'; | ||
const height = isSmallViewport | ||
? '@apply h-[calc(100dvh_-_80px)]' | ||
: '@apply h-[calc(100dvh_-_96px)]'; | ||
const className = `${height} absolute top-0 ${margins} ${width} overflow-hidden rounded bg-white transition-[right] ${activeTab === 'closed' ? 'right-[-380px] hidden' : 'right-0'}`; | ||
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. For the other reviewers, looks like mostly light refactoring. |
||
|
||
return ( | ||
<div | ||
data-testid="right-panel" | ||
className={`${height} absolute top-0 mr-4 mt-4 w-[360px] overflow-hidden rounded bg-white transition-[right] ${activeTab === 'closed' ? 'right-[-380px] hidden' : 'right-0'}`} | ||
> | ||
<div> | ||
<ParticipantList handleClose={handleClose} isOpen={activeTab === 'participant-list'} /> | ||
<Chat handleClose={handleClose} isOpen={activeTab === 'chat'} /> | ||
<ReportIssue handleClose={handleClose} isOpen={activeTab === 'issues'} /> | ||
</div> | ||
<div data-testid="right-panel" className={className}> | ||
<ParticipantList handleClose={handleClose} isOpen={activeTab === 'participant-list'} /> | ||
<Chat handleClose={handleClose} isOpen={activeTab === 'chat'} /> | ||
<ReportIssue handleClose={handleClose} isOpen={activeTab === 'issues'} /> | ||
</div> | ||
); | ||
}; | ||
|
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.
👏