Skip to content

Commit

Permalink
ref(ui-components) Use new Button on prejoin (jitsi#12372)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertpin authored Oct 13, 2022
1 parent f5fb402 commit 51bbc3f
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 46 deletions.
4 changes: 4 additions & 0 deletions css/premeeting/_lobby.scss
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,7 @@
}
}
}

.lobby-button-margin {
margin-bottom: 16px;
}
3 changes: 2 additions & 1 deletion react/features/base/ui/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ export const commonStyles = (theme: Theme) => {
},

'.prejoin-dialog-btn': {
width: '309px'
width: '309px',
marginBottom: '8px'
},

'.prejoin-dialog-dialin-container': {
Expand Down
56 changes: 31 additions & 25 deletions react/features/lobby/components/web/LobbyScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import React from 'react';

import { translate } from '../../../base/i18n';
import { Icon, IconClose } from '../../../base/icons';
import { ActionButton, InputField, PreMeetingScreen } from '../../../base/premeeting';
import { InputField, PreMeetingScreen } from '../../../base/premeeting';
import { LoadingIndicator } from '../../../base/react';
import { connect } from '../../../base/redux';
import Button from '../../../base/ui/components/web/Button';
import ChatInput from '../../../chat/components/web/ChatInput';
import MessageContainer from '../../../chat/components/web/MessageContainer';
import AbstractLobbyScreen, {
Expand Down Expand Up @@ -222,22 +223,22 @@ class LobbyScreen extends AbstractLobbyScreen<Props> {
* @inheritdoc
*/
_renderPasswordJoinButtons() {
const { t } = this.props;

return (
<>
<ActionButton
<Button
className = 'lobby-button-margin'
fullWidth = { true }
labelKey = 'prejoin.joinMeeting'
onClick = { this._onJoinWithPassword }
testId = 'lobby.passwordJoinButton'
type = 'primary'>
{ t('prejoin.joinMeeting') }
</ActionButton>
<ActionButton
type = 'primary' />
<Button
className = 'lobby-button-margin'
fullWidth = { true }
labelKey = 'lobby.backToKnockModeButton'
onClick = { this._onSwitchToKnockMode }
testId = 'lobby.backToKnockModeButton'
type = 'secondary'>
{ t('lobby.backToKnockModeButton') }
</ActionButton>
type = 'secondary' />
</>
);
}
Expand All @@ -248,30 +249,35 @@ class LobbyScreen extends AbstractLobbyScreen<Props> {
* @inheritdoc
*/
_renderStandardButtons() {
const { _knocking, _isLobbyChatActive, _renderPassword, t } = this.props;
const { _knocking, _isLobbyChatActive, _renderPassword } = this.props;

return (
<>
{ _knocking || <ActionButton
{_knocking || <Button
className = 'lobby-button-margin'
disabled = { !this.state.displayName }
fullWidth = { true }
labelKey = 'lobby.knockButton'
onClick = { this._onAskToJoin }
testId = 'lobby.knockButton'
type = 'primary'>
{ t('lobby.knockButton') }
</ActionButton> }
{ (_knocking && _isLobbyChatActive) && <ActionButton
className = 'open-chat-button'
type = 'primary' />
}
{(_knocking && _isLobbyChatActive) && <Button
className = 'lobby-button-margin open-chat-button'
fullWidth = { true }
labelKey = 'toolbar.openChat'
onClick = { this._onToggleChat }
testId = 'toolbar.openChat'
type = 'primary' >
{ t('toolbar.openChat') }
</ActionButton> }
{_renderPassword && <ActionButton
type = 'primary' />
}
{_renderPassword && <Button
className = 'lobby-button-margin'
fullWidth = { true }
labelKey = 'lobby.enterPasswordButton'
onClick = { this._onSwitchToPasswordMode }
testId = 'lobby.enterPasswordButton'
type = 'secondary'>
{ t('lobby.enterPasswordButton') }
</ActionButton> }
type = 'secondary' />
}
</>
);
}
Expand Down
19 changes: 9 additions & 10 deletions react/features/prejoin/components/dialogs/DialInDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { makeStyles } from 'tss-react/mui';
import { translate } from '../../../base/i18n/functions';
import Icon from '../../../base/icons/components/Icon';
import { IconArrowLeft } from '../../../base/icons/svg';
// @ts-ignore
import { ActionButton } from '../../../base/premeeting';
import { Button } from '../../../base/ui/components/web';
// @ts-ignore
import { getCountryCodeFromPhone } from '../../utils';
// @ts-ignore
Expand Down Expand Up @@ -153,18 +152,18 @@ function DialinDialog(props: Props) {
{t('prejoin.connectedWithAudioQ')}
</Label>
<div className = 'prejoin-dialog-dialin-btns'>
<ActionButton
<Button
className = 'prejoin-dialog-btn'
fullWidth = { true }
labelKey = 'prejoin.joinMeeting'
onClick = { onPrimaryButtonClick }
type = 'primary'>
{t('prejoin.joinMeeting')}
</ActionButton>
<ActionButton
type = 'primary' />
<Button
className = 'prejoin-dialog-btn'
fullWidth = { true }
labelKey = 'dialog.Cancel'
onClick = { onTextButtonClick }
type = 'text'>
{t('dialog.Cancel')}
</ActionButton>
type = 'tertiary' />
</div>
</div>
);
Expand Down
19 changes: 9 additions & 10 deletions react/features/prejoin/components/dialogs/DialOutDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { makeStyles } from 'tss-react/mui';
import { translate } from '../../../base/i18n/functions';
import Icon from '../../../base/icons/components/Icon';
import { IconClose } from '../../../base/icons/svg';
// @ts-ignore
import { ActionButton } from '../../../base/premeeting';
import { Button } from '../../../base/ui/components/web';
// @ts-ignore
import Label from '../Label';
// @ts-ignore
Expand Down Expand Up @@ -77,12 +76,12 @@ function DialOutDialog(props: Props) {
<div className = { classes.picker }>
<CountryPicker onSubmit = { onSubmit } />
</div>
<ActionButton
<Button
className = 'prejoin-dialog-btn'
fullWidth = { true }
labelKey = 'prejoin.callMe'
onClick = { onSubmit }
type = 'primary'>
{t('prejoin.callMe')}
</ActionButton>
type = 'primary' />
<div className = 'prejoin-dialog-delimiter-container'>
<div className = 'prejoin-dialog-delimiter' />
<div className = 'prejoin-dialog-delimiter-txt-container'>
Expand All @@ -92,12 +91,12 @@ function DialOutDialog(props: Props) {
</div>
</div>
<div className = 'prejoin-dialog-dialin-container'>
<ActionButton
<Button
className = 'prejoin-dialog-btn'
fullWidth = { true }
labelKey = 'prejoin.iWantToDialIn'
onClick = { onTextButtonClick }
type = 'text'>
{t('prejoin.iWantToDialIn')}
</ActionButton>
type = 'tertiary' />
</div>
</div>
);
Expand Down

0 comments on commit 51bbc3f

Please sign in to comment.