This commit is contained in:
mgabdev
2020-05-06 19:40:54 -04:00
parent 4dfb7c9fd6
commit c1131db577
30 changed files with 811 additions and 452 deletions

View File

@@ -8,11 +8,19 @@ import TimelineComposeBlock from '../timeline_compose_block'
const messages = defineMessages({
confirm: { id: 'confirmations.delete.confirm', defaultMessage: 'Delete' },
title: { id: 'navigation_bar.compose', defaultMessage: 'Compose new gab' },
comment: { id: 'navigation_bar.compose_comment', defaultMessage: 'Compose new comment' },
edit: { id: 'navigation_bar.edit_gab', defaultMessage: 'Edit' },
})
const mapStateToProps = (state) => ({
composeText: state.getIn(['compose', 'text']),
})
const mapStateToProps = (state) => {
const status = state.getIn(['statuses', state.getIn(['compose', 'id'])])
return {
composeText: state.getIn(['compose', 'text']),
isEditing: !!status,
isComment: !!state.getIn(['compose', 'in_reply_to']),
}
}
export default
@connect(mapStateToProps)
@@ -24,10 +32,17 @@ class ComposeModal extends ImmutablePureComponent {
onClose: PropTypes.func.isRequired,
composeText: PropTypes.string,
dispatch: PropTypes.func.isRequired,
};
isEditing: PropTypes.bool,
isComment: PropTypes.bool,
}
onClickClose = () => {
const { composeText, dispatch, onClose, intl } = this.props;
const {
composeText,
dispatch,
onClose,
intl,
} = this.props
if (composeText) {
dispatch(openModal('CONFIRM', {
@@ -36,24 +51,30 @@ class ComposeModal extends ImmutablePureComponent {
confirm: intl.formatMessage(messages.confirm),
onConfirm: () => dispatch(cancelReplyCompose()),
onCancel: () => dispatch(openModal('COMPOSE')),
}));
}))
}
else {
onClose('COMPOSE');
onClose('COMPOSE')
}
};
}
render() {
const { intl } = this.props
const {
intl,
isEditing,
isComment,
} = this.props
const title = isEditing ? messages.edit : isComment ? messages.comment : messages.title
return (
<ModalLayout
noPadding
title={intl.formatMessage(messages.title)}
title={intl.formatMessage(title)}
onClose={this.onClickClose}
>
<TimelineComposeBlock modal />
</ModalLayout>
);
)
}
}

View File

@@ -61,29 +61,33 @@ class HomeTimelineSettingsModal extends ImmutablePureComponent {
>
<div className={[_s.default, _s.pb10].join(' ')}>
<SettingSwitch
prefix='home_timeline'
settings={settings}
settingPath={['shows', 'polls']}
onChange={onChange}
label={intl.formatMessage(messages.showPolls)}
/>
{
/*
<SettingSwitch
prefix='home_timeline'
settings={settings}
settingPath={['shows', 'polls']}
onChange={onChange}
label={intl.formatMessage(messages.showPolls)}
/>
<SettingSwitch
prefix='home_timeline'
settings={settings}
settingPath={['shows', 'photos']}
onChange={onChange}
label={intl.formatMessage(messages.showPhotos)}
/>
<SettingSwitch
prefix='home_timeline'
settings={settings}
settingPath={['shows', 'photos']}
onChange={onChange}
label={intl.formatMessage(messages.showPhotos)}
/>
<SettingSwitch
prefix='home_timeline'
settings={settings}
settingPath={['shows', 'videos']}
onChange={onChange}
label={intl.formatMessage(messages.showVideos)}
/>
<SettingSwitch
prefix='home_timeline'
settings={settings}
settingPath={['shows', 'videos']}
onChange={onChange}
label={intl.formatMessage(messages.showVideos)}
/>
*/
}
<SettingSwitch
prefix='home_timeline'

View File

@@ -23,23 +23,24 @@ class UnauthorizedModal extends ImmutablePureComponent {
}
render() {
const { intl } = this.props
const { intl, onClose } = this.props
return (
<ModalLayout
title={intl.formatMessage(messages.signup)}
onClose={onClose}
width={400}
>
<div className={[_s.default, _s.px10, _s.py10].join(' ')}>
<Text className={_s.mb15}>
<Text className={_s.mb15} align='center'>
{intl.formatMessage(messages.text)}
</Text>
<Button href='/auth/sign_up' className={[_s.width240PX, _s.mlAuto, _s.mlAuto].join(' ')}>
<Button isBlock href='/auth/sign_up' className={[_s.mr15, _s.ml15, _s.mlAuto, _s.mrAuto].join(' ')}>
{intl.formatMessage(messages.register)}
</Button>
</div>
<div className={[_s.default, _s.px10, _s.py10].join(' ')}>
<Text color='secondary'>
<div className={[_s.default, _s.px10, _s.py5].join(' ')}>
<Text color='secondary' size='small' align='center'>
{
intl.formatMessage(messages.login, {
login: (