mirror of https://github.com/jitsi/jitsi-meet
* Fix toolbox buttons not displaying properly when chat is open. * Open chat in fullscreen dialog past custom thresholds when mobile/desktop toolbox would become unusable due to chat * Remove mobile chat check when displaying toolboxpull/8385/head jitsi-meet_5401
parent
1ab0f1993a
commit
43e655b619
@ -0,0 +1,37 @@ |
||||
// @flow
|
||||
|
||||
import React from 'react'; |
||||
|
||||
import { Dialog } from '../../../base/dialog'; |
||||
|
||||
import Header from './ChatDialogHeader'; |
||||
|
||||
type Props = { |
||||
|
||||
/** |
||||
* Children of the component. |
||||
*/ |
||||
children: React$Node |
||||
} |
||||
|
||||
/** |
||||
* Component that renders the content of the chat in a modal. |
||||
* |
||||
* @returns {React$Element<any>} |
||||
*/ |
||||
function ChatDialog({ children }: Props) { |
||||
return ( |
||||
<Dialog |
||||
customHeader = { Header } |
||||
disableEnter = { true } |
||||
hideCancelButton = { true } |
||||
submitDisabled = { true } |
||||
titleKey = 'chat.title'> |
||||
<div className = 'chat-dialog'> |
||||
{children} |
||||
</div> |
||||
</Dialog> |
||||
); |
||||
} |
||||
|
||||
export default ChatDialog; |
@ -0,0 +1,42 @@ |
||||
// @flow
|
||||
|
||||
import React from 'react'; |
||||
|
||||
import { translate } from '../../../base/i18n'; |
||||
import { Icon, IconClose } from '../../../base/icons'; |
||||
import { connect } from '../../../base/redux'; |
||||
import { toggleChat } from '../../../chat'; |
||||
|
||||
type Props = { |
||||
|
||||
/** |
||||
* Function to be called when pressing the close button. |
||||
*/ |
||||
onCancel: Function, |
||||
|
||||
/** |
||||
* Invoked to obtain translated strings. |
||||
*/ |
||||
t: Function |
||||
}; |
||||
|
||||
/** |
||||
* Custom header of the {@code ChatDialog}. |
||||
* |
||||
* @returns {React$Element<any>} |
||||
*/ |
||||
function Header({ onCancel, t }: Props) { |
||||
return ( |
||||
<div |
||||
className = 'chat-dialog-header'> |
||||
{ t('chat.title') } |
||||
<Icon |
||||
onClick = { onCancel } |
||||
src = { IconClose } /> |
||||
</div> |
||||
); |
||||
} |
||||
|
||||
const mapDispatchToProps = { onCancel: toggleChat }; |
||||
|
||||
export default translate(connect(null, mapDispatchToProps)(Header)); |
Loading…
Reference in new issue