Use DialogButtons in ChatCreateOrReuseDialog

Use DialogButtons to eliminate duplicate button code.
This commit is contained in:
Aidan Gauland 2017-12-23 16:15:28 +13:00
parent aecb4650bc
commit 7a761dbf6b

View file

@ -137,6 +137,7 @@ export default class ChatCreateOrReuseDialog extends React.Component {
} else { } else {
// Show the avatar, name and a button to confirm that a new chat is requested // Show the avatar, name and a button to confirm that a new chat is requested
const BaseAvatar = sdk.getComponent('avatars.BaseAvatar'); const BaseAvatar = sdk.getComponent('avatars.BaseAvatar');
const DialogButtons = sdk.getComponent('views.elements.DialogButtons');
const Spinner = sdk.getComponent('elements.Spinner'); const Spinner = sdk.getComponent('elements.Spinner');
title = _t('Start chatting'); title = _t('Start chatting');
@ -166,11 +167,8 @@ export default class ChatCreateOrReuseDialog extends React.Component {
</p> </p>
{ profile } { profile }
</div> </div>
<div className="mx_Dialog_buttons"> <DialogButtons primaryButton={_t('Start Chatting')}
<button className="mx_Dialog_primary" onClick={this.props.onNewDMClick}> onPrimaryButtonClick={this.props.onNewDMClick} />
{ _t('Start Chatting') }
</button>
</div>
</div>; </div>;
} }