Updated compose modal button

Removed pubilsh button from compose modal component. Using original compose form publish button instead.
This commit is contained in:
mgabdev 2019-10-18 01:36:04 -04:00
parent caf72d0467
commit 236dbf8efd
3 changed files with 12 additions and 7 deletions

View File

@ -233,13 +233,15 @@ class ComposeForm extends ImmutablePureComponent {
publishText = intl.formatMessage(messages.schedulePost);
}
const showPublish = isModalOpen ? false : !condensed;
const composeClassNames = classNames({
'compose-form': true,
'condensed': condensed,
});
const composeFormPublishClasses = classNames('compose-form__publish', {
'in-modal': isModalOpen,
});
return (
<div className={composeClassNames} ref={this.setForm} onClick={this.handleClick}>
<WarningContainer />
@ -311,8 +313,8 @@ class ComposeForm extends ImmutablePureComponent {
}
{
showPublish &&
<div className='compose-form__publish'>
!condensed &&
<div className={composeFormPublishClasses}>
<div className='compose-form__publish-button-wrapper'><Button text={publishText} onClick={this.handleSubmit} disabled={disabledButton} block /></div>
</div>
}

View File

@ -7,14 +7,12 @@ import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import ImmutablePureComponent from 'react-immutable-pure-component';
import ComposeFormContainer from '../../compose/containers/compose_form_container';
import IconButton from 'gabsocial/components/icon_button';
import Button from 'gabsocial/components/button';
import { openModal } from '../../../actions/modal';
import { cancelReplyCompose } from '../../../actions/compose';
const messages = defineMessages({
close: { id: 'lightbox.close', defaultMessage: 'Close' },
confirm: { id: 'confirmations.delete.confirm', defaultMessage: 'Delete' },
publish: { id: 'compose_form.publish', defaultMessage: 'Publish' },
});
const mapStateToProps = state => {
@ -61,7 +59,6 @@ class ComposeModal extends ImmutablePureComponent {
<h3 className='compose-modal__header__title'>
<FormattedMessage id='navigation_bar.compose' defaultMessage='Compose new gab' />
</h3>
<Button className='compose-modal__publish' text={intl.formatMessage(messages.publish)} onClick={this.onClickClose} />
</div>
<div className='compose-modal__content compose-modal__content--scroll'>
<div className='timeline-compose-block'>

View File

@ -4967,6 +4967,12 @@ noscript {
border-radius: 0;
height: 100vh;
width: 100vw;
.compose-form__publish.in-modal {
position: fixed;
top: 0;
right: 15px;
}
}
}