-
Notifications
You must be signed in to change notification settings - Fork 336
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
feat(gcal): add Google Meet #8818
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
245795a
add video conferencing options to gcal modal
nickoferrall 9e77162
add zoom logo to video conferencing menu
nickoferrall 4faed55
implement video conferencing and menu components
nickoferrall 5293629
improve padding video conferencing padding
nickoferrall 70fdd3b
add videoType to gcal input
nickoferrall 2ae9281
change provider logos to tailwind
nickoferrall 069dde9
use GcalVideoTypeEnum
nickoferrall 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import logo from '../styles/theme/images/graphics/google-meet-icon.svg' | ||
import React from 'react' | ||
|
||
const GoogleMeetProviderLogo = () => { | ||
return ( | ||
<div | ||
className='h-6 w-6 bg-contain bg-no-repeat' | ||
style={{backgroundImage: `url(${logo})`}} | ||
></div> | ||
) | ||
} | ||
|
||
export default GoogleMeetProviderLogo |
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,13 @@ | ||
import React from 'react' | ||
import logo from '../styles/theme/images/graphics/zoom-logo.svg' | ||
|
||
const ZoomProviderLogo = () => { | ||
return ( | ||
<div | ||
className='h-6 w-6 bg-contain bg-no-repeat' | ||
style={{backgroundImage: `url(${logo})`}} | ||
></div> | ||
) | ||
} | ||
|
||
export default ZoomProviderLogo |
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
60 changes: 60 additions & 0 deletions
60
packages/client/modules/userDashboard/components/GcalModal/VideoConferencing.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,60 @@ | ||
import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown' | ||
import {Close} from '@mui/icons-material' | ||
import React from 'react' | ||
import {MenuPosition} from '../../../../hooks/useCoords' | ||
import useMenu from '../../../../hooks/useMenu' | ||
import VideoConferencingMenu from './VideoConferencingMenu' | ||
import RaisedButton from '../../../../components/RaisedButton' | ||
import {Elevation} from '../../../../styles/elevation' | ||
import GoogleMeetProviderLogo from '../../../../components/GoogleMeetProviderLogo' | ||
import ZoomProviderLogo from '../../../../components/ZoomProviderLogo' | ||
import {GcalVideoTypeEnum} from '../../../../__generated__/StartTeamPromptMutation.graphql' | ||
|
||
type Props = { | ||
videoType: GcalVideoTypeEnum | null | ||
handleChangeVideoType: (videoType: GcalVideoTypeEnum | null) => void | ||
} | ||
|
||
const VideoConferencing = (props: Props) => { | ||
const {videoType, handleChangeVideoType} = props | ||
const {togglePortal, originRef, menuPortal, menuProps} = useMenu(MenuPosition.UPPER_CENTER) | ||
|
||
const selectedOptionLabel = videoType === 'meet' ? 'Google Meet' : 'Zoom' | ||
|
||
return ( | ||
<div> | ||
{videoType ? ( | ||
<div className='bg-gray-100 flex items-center rounded py-3 px-2'> | ||
{videoType === 'meet' ? <GoogleMeetProviderLogo /> : <ZoomProviderLogo />} | ||
<span className='text-gray-500 text-md h-[38px] py-2 pl-2 font-normal'> | ||
{selectedOptionLabel} | ||
</span> | ||
<Close | ||
className='text-gray-500 ml-auto cursor-pointer hover:opacity-50' | ||
onClick={() => handleChangeVideoType(null)} | ||
/> | ||
</div> | ||
) : ( | ||
<div className='py-3'> | ||
<RaisedButton | ||
onClick={togglePortal} | ||
ref={originRef} | ||
className='rounded py-1.5 px-4' | ||
elevationHovered={Elevation.Z3} | ||
> | ||
{'Add Video Conferencing'} <ArrowDropDownIcon /> | ||
</RaisedButton> | ||
</div> | ||
)} | ||
{menuPortal( | ||
<VideoConferencingMenu | ||
menuProps={menuProps} | ||
videoType={videoType} | ||
handleChangeVideoType={handleChangeVideoType} | ||
/> | ||
)} | ||
</div> | ||
) | ||
} | ||
|
||
export default VideoConferencing |
46 changes: 46 additions & 0 deletions
46
packages/client/modules/userDashboard/components/GcalModal/VideoConferencingMenu.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,46 @@ | ||
import React from 'react' | ||
import Menu from '../../../../components/Menu' | ||
import MenuItem from '../../../../components/MenuItem' | ||
import {MenuProps} from '../../../../hooks/useMenu' | ||
import GoogleMeetProviderLogo from '../../../../components/GoogleMeetProviderLogo' | ||
import ZoomProviderLogo from '../../../../components/ZoomProviderLogo' | ||
import {GcalVideoTypeEnum} from '../../../../__generated__/StartTeamPromptMutation.graphql' | ||
|
||
type Props = { | ||
menuProps: MenuProps | ||
handleChangeVideoType: (option: GcalVideoTypeEnum | null) => void | ||
videoType: GcalVideoTypeEnum | null | ||
} | ||
|
||
const VideoConferencingMenu = (props: Props) => { | ||
const {menuProps, handleChangeVideoType, videoType} = props | ||
if (videoType) return null | ||
return ( | ||
<Menu ariaLabel={'Select a video conferencing option'} {...menuProps}> | ||
<MenuItem | ||
onClick={() => handleChangeVideoType('meet')} | ||
label={ | ||
<div className='flex items-center p-3 hover:cursor-pointer'> | ||
<GoogleMeetProviderLogo /> | ||
<label className='text-gray-500 pl-2 text-sm font-normal hover:cursor-pointer'> | ||
Google Meet | ||
</label> | ||
</div> | ||
} | ||
></MenuItem> | ||
<MenuItem | ||
isDisabled | ||
label={ | ||
<div className='flex items-center p-3 hover:cursor-not-allowed'> | ||
<ZoomProviderLogo /> | ||
<label className='text-gray-500 pl-2 text-sm font-normal hover:cursor-not-allowed'> | ||
Zoom (Coming Soon!) | ||
</label> | ||
</div> | ||
} | ||
></MenuItem> | ||
</Menu> | ||
) | ||
} | ||
|
||
export default VideoConferencingMenu |
1 change: 1 addition & 0 deletions
1
packages/client/styles/theme/images/graphics/google-meet-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,12 @@ | ||
import {GraphQLEnumType} from 'graphql' | ||
|
||
const GcalVideoTypeEnum = new GraphQLEnumType({ | ||
name: 'GcalVideoTypeEnum', | ||
description: 'The type of video conferencing used in the gcal event', | ||
values: { | ||
meet: {}, | ||
zoom: {} | ||
} | ||
}) | ||
|
||
export default GcalVideoTypeEnum |
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.
-1 could you use
@radix-ui/react-dropdown-menu
or another radix component here? They offer SO MUCH bug free great little accessibility features that this old one doesn't. Soon I wanna replace all my crummy menu/modal hacks with radix!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.
I started using Radix but refactored back to the old pattern because it wasn't working well with MUI - see: #8711. I'm running into a similar issue here with Radix where the parent closes when the menu closes, and the menu items aren't clickable.
Once #8711 is resolved, I'd like to refactor the gcal modal away from the old pattern to Radix.
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.
Hey @mattkrick, just following up to see if this is good to merge?
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.
Hey @mattkrick, bumping this
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.
merging now, it'll make the ship this week!