Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video 10105 finalize audience chat #136

Merged
merged 12 commits into from
Jul 1, 2022

Conversation

olipyskoty
Copy link
Contributor

@olipyskoty olipyskoty commented Jun 27, 2022

Contributing to Twilio

All third party contributors acknowledge that any contributions they provide will be made under the same open source license that the open source project is provided under.

  • I acknowledge that all my contributions will be made under the project's license.

Pull Request Details

JIRA link(s):

Description

This PR has the chat window open by default for desktop. It also fixes a bug where the chat button was not being displayed for viewers even when Chat was enabled 馃槦. Finally, it cleans up the bottom menu bar for mobile (for all types of participants)

Speaker
IMG_8137

Viewer
IMG_8136

Burndown

Before review

  • Added unit tests if necessary
  • Updated affected documentation
  • Verified locally with all effected platforms
  • Manually sanity tested running locally
  • Included screenshot as PR comment (if needed)
  • Ready for review

Before merge

  • Got one or more +1s
  • Re-tested if necessary

@@ -50,7 +52,7 @@ export default function App() {
<RecordingNotifications />
<MobileTopMenuBar />
<Room />
<MenuBar />
{isMobile ? <MobileBottomMenuBar /> : <MenuBar />}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should try to just use <MenuBar /> only, but if we had <MobileBottomMenuBar /> too then we should use this to switch between the two:

  const isMobile = useMediaQuery((theme: Theme) => theme.breakpoints.down('sm'));

isMobile from utils just looks at the user agent. For styling on mobile, we should use media queries.

@@ -54,7 +54,7 @@ export default function LeaveEventButton(props: { buttonClassName?: string }) {
return (
<>
<Button onClick={() => setMenuOpen(isOpen => !isOpen)} ref={anchorRef} className={classes.button}>
Leave Event
{!props.excludeLabel && 'Leave Event'}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this work instead in all buttons?

<Hidden smDown>
  Leave Event
</Hidden>

const isReconnecting = roomState === 'reconnecting';
const { appState } = useAppState();

return (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much of this seems very similar to the MenuBar component. I wonder if we truly need a new MobileBottomMenuBar component. Can we use <Hidden /> in MenuBar to get it to work on mobile?

@@ -1,6 +1,7 @@
import React, { useCallback, useRef, useState } from 'react';
import { createStyles, makeStyles, Theme } from '@material-ui/core/styles';
import { Typography, Grid, Button } from '@material-ui/core';
import { isMobile } from '../../../utils';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will <Hidden> work instead?

Also we should not use this isMobile to adjust styles. Using the userAgent to adjust styles on mobile is not responsive - the UI cannot adjust itself in response to changes in browser width.

display: 'none',
},
'& .MuiButton-mobileBackground': {
marginRight: '1em',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
marginRight: '1em',
margin: '0 0.5em',

This will cause the buttons to be perfectly centered. With marginRight, it's a little lopsided. There's a little more white space on the right than on the left:

image

@olipyskoty olipyskoty requested a review from timmydoza July 1, 2022 22:33
@olipyskoty olipyskoty merged commit 27cd89d into feature/audience-chat Jul 1, 2022
@olipyskoty olipyskoty deleted the VIDEO-10105-finalize-audience-chat branch July 1, 2022 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants