Refactor initial state: "me" (#5563)
* Refactor initial state: "me" * remove "me" from reducers/meta.js
This commit is contained in:
parent
29609fbb6a
commit
b254e6ca5f
24 changed files with 44 additions and 60 deletions
|
@ -4,6 +4,7 @@ import IconButton from '../../../components/icon_button';
|
|||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import DropdownMenuContainer from '../../../containers/dropdown_menu_container';
|
||||
import { defineMessages, injectIntl } from 'react-intl';
|
||||
import { me } from '../../../initial_state';
|
||||
|
||||
const messages = defineMessages({
|
||||
delete: { id: 'status.delete', defaultMessage: 'Delete' },
|
||||
|
@ -36,7 +37,6 @@ export default class ActionBar extends React.PureComponent {
|
|||
onReport: PropTypes.func,
|
||||
onPin: PropTypes.func,
|
||||
onEmbed: PropTypes.func,
|
||||
me: PropTypes.string.isRequired,
|
||||
intl: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
|
@ -80,7 +80,7 @@ export default class ActionBar extends React.PureComponent {
|
|||
}
|
||||
|
||||
render () {
|
||||
const { status, me, intl } = this.props;
|
||||
const { status, intl } = this.props;
|
||||
|
||||
const publicStatus = ['public', 'unlisted'].includes(status.get('visibility'));
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@ const makeMapStateToProps = () => {
|
|||
status: getStatus(state, props.params.statusId),
|
||||
ancestorsIds: state.getIn(['contexts', 'ancestors', props.params.statusId]),
|
||||
descendantsIds: state.getIn(['contexts', 'descendants', props.params.statusId]),
|
||||
me: state.getIn(['meta', 'me']),
|
||||
});
|
||||
|
||||
return mapStateToProps;
|
||||
|
@ -63,7 +62,6 @@ export default class Status extends ImmutablePureComponent {
|
|||
status: ImmutablePropTypes.map,
|
||||
ancestorsIds: ImmutablePropTypes.list,
|
||||
descendantsIds: ImmutablePropTypes.list,
|
||||
me: PropTypes.string,
|
||||
intl: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
|
@ -252,7 +250,7 @@ export default class Status extends ImmutablePureComponent {
|
|||
|
||||
render () {
|
||||
let ancestors, descendants;
|
||||
const { status, ancestorsIds, descendantsIds, me } = this.props;
|
||||
const { status, ancestorsIds, descendantsIds } = this.props;
|
||||
|
||||
if (status === null) {
|
||||
return (
|
||||
|
@ -293,14 +291,12 @@ export default class Status extends ImmutablePureComponent {
|
|||
<div className='focusable' tabIndex='0'>
|
||||
<DetailedStatus
|
||||
status={status}
|
||||
me={me}
|
||||
onOpenVideo={this.handleOpenVideo}
|
||||
onOpenMedia={this.handleOpenMedia}
|
||||
/>
|
||||
|
||||
<ActionBar
|
||||
status={status}
|
||||
me={me}
|
||||
onReply={this.handleReplyClick}
|
||||
onFavourite={this.handleFavouriteClick}
|
||||
onReblog={this.handleReblogClick}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue