mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-20 09:17:46 +00:00
Adds base dialog implementation.
This commit is contained in:
58
react/features/base/dialog/components/Dialog.native.js
Normal file
58
react/features/base/dialog/components/Dialog.native.js
Normal file
@@ -0,0 +1,58 @@
|
||||
import React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import Prompt from 'react-native-prompt';
|
||||
|
||||
import { translate } from '../../i18n';
|
||||
|
||||
import AbstractDialog from './AbstractDialog';
|
||||
|
||||
/**
|
||||
* Native dialog using Prompt.
|
||||
*/
|
||||
class Dialog extends AbstractDialog {
|
||||
|
||||
/**
|
||||
* Native sialog component's property types.
|
||||
*
|
||||
* @static
|
||||
*/
|
||||
static propTypes = {
|
||||
/**
|
||||
* I18n key to put as body title.
|
||||
*/
|
||||
bodyKey: React.PropTypes.string
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements React's {@link Component#render()}.
|
||||
*
|
||||
* @inheritdoc
|
||||
* @returns {ReactElement}
|
||||
*/
|
||||
render() {
|
||||
const {
|
||||
cancelDisabled,
|
||||
cancelTitleKey,
|
||||
bodyKey,
|
||||
okDisabled,
|
||||
okTitleKey,
|
||||
t,
|
||||
titleKey
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
<Prompt
|
||||
cancelText = { cancelDisabled
|
||||
? undefined : t(cancelTitleKey || 'dialog.Cancel') }
|
||||
onCancel = { this._onCancel }
|
||||
onSubmit = { this._onSubmit }
|
||||
placeholder = { t(bodyKey) }
|
||||
submitText = { okDisabled
|
||||
? undefined : t(okTitleKey || 'dialog.Ok') }
|
||||
title = { t(titleKey) }
|
||||
visible = { true } />
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default translate(connect()(Dialog));
|
||||
Reference in New Issue
Block a user