parent
f7d787f798
commit
6b59d3674c
|
@ -22,6 +22,7 @@ export const NavigationBar = () => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const account = useSelector(state => state.getIn(['accounts', me]));
|
const account = useSelector(state => state.getIn(['accounts', me]));
|
||||||
const isReplying = useSelector(state => !!state.getIn(['compose', 'in_reply_to']));
|
const isReplying = useSelector(state => !!state.getIn(['compose', 'in_reply_to']));
|
||||||
|
const isQuoting = useSelector(state => !!state.getIn(['compose', 'quote_id']));
|
||||||
|
|
||||||
const handleCancelClick = useCallback(() => {
|
const handleCancelClick = useCallback(() => {
|
||||||
dispatch(cancelReplyCompose());
|
dispatch(cancelReplyCompose());
|
||||||
|
@ -30,7 +31,7 @@ export const NavigationBar = () => {
|
||||||
return (
|
return (
|
||||||
<div className='navigation-bar'>
|
<div className='navigation-bar'>
|
||||||
<Account account={account} minimal />
|
<Account account={account} minimal />
|
||||||
{isReplying ? <IconButton title={intl.formatMessage(messages.cancel)} iconComponent={CloseIcon} onClick={handleCancelClick} /> : <ActionBar />}
|
{(isReplying || isQuoting) ? <IconButton title={intl.formatMessage(messages.cancel)} iconComponent={CloseIcon} onClick={handleCancelClick} /> : <ActionBar />}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,6 +22,7 @@ export const NavigationBar = () => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const account = useSelector(state => state.getIn(['accounts', me]));
|
const account = useSelector(state => state.getIn(['accounts', me]));
|
||||||
const isReplying = useSelector(state => !!state.getIn(['compose', 'in_reply_to']));
|
const isReplying = useSelector(state => !!state.getIn(['compose', 'in_reply_to']));
|
||||||
|
const isQuoting = useSelector(state => !!state.getIn(['compose', 'quote_id']));
|
||||||
|
|
||||||
const handleCancelClick = useCallback(() => {
|
const handleCancelClick = useCallback(() => {
|
||||||
dispatch(cancelReplyCompose());
|
dispatch(cancelReplyCompose());
|
||||||
|
@ -30,7 +31,7 @@ export const NavigationBar = () => {
|
||||||
return (
|
return (
|
||||||
<div className='navigation-bar'>
|
<div className='navigation-bar'>
|
||||||
<Account account={account} minimal />
|
<Account account={account} minimal />
|
||||||
{isReplying ? <IconButton title={intl.formatMessage(messages.cancel)} iconComponent={CloseIcon} onClick={handleCancelClick} /> : <ActionBar />}
|
{(isReplying || isQuoting) ? <IconButton title={intl.formatMessage(messages.cancel)} iconComponent={CloseIcon} onClick={handleCancelClick} /> : <ActionBar />}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue