Removed GroupRemovedAccountsModal, GroupMembersModal
• Removed: - GroupRemovedAccountsModal, GroupMembersModal
This commit is contained in:
parent
c616a80d4e
commit
ae930c908e
@ -1,37 +0,0 @@
|
||||
import { defineMessages, injectIntl } from 'react-intl'
|
||||
import ModalLayout from './modal_layout'
|
||||
import GroupMembers from '../../features/group_members'
|
||||
|
||||
const messages = defineMessages({
|
||||
title: { id: 'group_members', defaultMessage: 'Group members' },
|
||||
})
|
||||
|
||||
export default
|
||||
@injectIntl
|
||||
class GroupMembersModal extends PureComponent {
|
||||
|
||||
static propTypes = {
|
||||
groupId: PropTypes.string.isRequired,
|
||||
intl: PropTypes.object.isRequired,
|
||||
onClose: PropTypes.func.isRequired,
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
intl,
|
||||
onClose,
|
||||
groupId,
|
||||
} = this.props
|
||||
|
||||
return (
|
||||
<ModalLayout
|
||||
title={intl.formatMessage(messages.title)}
|
||||
width={440}
|
||||
onClose={onClose}
|
||||
noPadding
|
||||
>
|
||||
<GroupMembers groupId={groupId} onCloseModal={onClose} />
|
||||
</ModalLayout>
|
||||
)
|
||||
}
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
import { defineMessages, injectIntl } from 'react-intl'
|
||||
import ModalLayout from './modal_layout'
|
||||
import GroupRemovedAccounts from '../../features/group_removed_accounts'
|
||||
|
||||
const messages = defineMessages({
|
||||
title: { id: 'group_removed', defaultMessage: 'Removed accounts' },
|
||||
})
|
||||
|
||||
export default
|
||||
@injectIntl
|
||||
class GroupRemovedAccountsModal extends PureComponent {
|
||||
|
||||
static propTypes = {
|
||||
groupId: PropTypes.string.isRequired,
|
||||
intl: PropTypes.object.isRequired,
|
||||
onClose: PropTypes.func.isRequired,
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
intl,
|
||||
onClose,
|
||||
groupId,
|
||||
} = this.props
|
||||
|
||||
return (
|
||||
<ModalLayout
|
||||
title={intl.formatMessage(messages.title)}
|
||||
width={440}
|
||||
onClose={onClose}
|
||||
noPadding
|
||||
>
|
||||
<GroupRemovedAccounts groupId={groupId} onCloseModal={onClose} />
|
||||
</ModalLayout>
|
||||
)
|
||||
}
|
||||
}
|
@ -17,8 +17,6 @@ import {
|
||||
MODAL_GIF_PICKER,
|
||||
MODAL_GROUP_CREATE,
|
||||
MODAL_GROUP_DELETE,
|
||||
MODAL_GROUP_MEMBERS,
|
||||
MODAL_GROUP_REMOVED_ACCOUNTS,
|
||||
MODAL_HASHTAG_TIMELINE_SETTINGS,
|
||||
MODAL_HOME_TIMELINE_SETTINGS,
|
||||
MODAL_HOTKEYS,
|
||||
@ -86,8 +84,6 @@ MODAL_COMPONENTS[MODAL_EMBED] = EmbedModal
|
||||
MODAL_COMPONENTS[MODAL_GIF_PICKER] = GifPickerModal
|
||||
MODAL_COMPONENTS[MODAL_GROUP_CREATE] = GroupCreateModal
|
||||
MODAL_COMPONENTS[MODAL_GROUP_DELETE] = GroupDeleteModal
|
||||
MODAL_COMPONENTS[MODAL_GROUP_MEMBERS] = GroupMembersModal
|
||||
MODAL_COMPONENTS[MODAL_GROUP_REMOVED_ACCOUNTS] = GroupRemovedAccountsModal
|
||||
MODAL_COMPONENTS[MODAL_HASHTAG_TIMELINE_SETTINGS] = HashtagTimelineSettingsModal
|
||||
MODAL_COMPONENTS[MODAL_HOME_TIMELINE_SETTINGS] = HomeTimelineSettingsModal
|
||||
MODAL_COMPONENTS[MODAL_HOTKEYS] = HotkeysModal
|
||||
|
@ -1,16 +1,10 @@
|
||||
import ImmutablePureComponent from 'react-immutable-pure-component'
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes'
|
||||
import { defineMessages, injectIntl } from 'react-intl'
|
||||
import {
|
||||
MODAL_GROUP_CREATE,
|
||||
MODAL_GROUP_MEMBERS,
|
||||
MODAL_GROUP_REMOVED_ACCOUNTS,
|
||||
} from '../../constants'
|
||||
import {
|
||||
addShortcut,
|
||||
removeShortcut,
|
||||
} from '../../actions/shortcuts'
|
||||
import { openModal } from '../../actions/modal'
|
||||
import { closePopover } from '../../actions/popover'
|
||||
import PopoverLayout from './popover_layout'
|
||||
import List from '../list'
|
||||
@ -33,19 +27,6 @@ const mapStateToProps = (state, { group }) => {
|
||||
}
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
|
||||
onOpenEditGroup(groupId) {
|
||||
dispatch(closePopover())
|
||||
dispatch(openModal(MODAL_GROUP_CREATE, { groupId }))
|
||||
},
|
||||
onOpenRemovedMembers(groupId) {
|
||||
dispatch(closePopover())
|
||||
dispatch(openModal(MODAL_GROUP_REMOVED_ACCOUNTS, { groupId }))
|
||||
},
|
||||
onOpenGroupMembers(groupId) {
|
||||
dispatch(closePopover())
|
||||
dispatch(openModal(MODAL_GROUP_MEMBERS, { groupId }))
|
||||
},
|
||||
onClosePopover: () => dispatch(closePopover()),
|
||||
onAddShortcut(groupId) {
|
||||
dispatch(addShortcut('group', groupId))
|
||||
@ -53,7 +34,6 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
onRemoveShortcut(groupId) {
|
||||
dispatch(removeShortcut(null, 'group', groupId))
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
export default
|
||||
@ -70,21 +50,6 @@ class GroupOptionsPopover extends ImmutablePureComponent {
|
||||
onAddShortcut: PropTypes.func.isRequired,
|
||||
onRemoveShortcut: PropTypes.func.isRequired,
|
||||
onClosePopover: PropTypes.func.isRequired,
|
||||
onOpenEditGroup: PropTypes.func.isRequired,
|
||||
onOpenGroupMembers: PropTypes.func.isRequired,
|
||||
onOpenRemovedMembers: PropTypes.func.isRequired,
|
||||
}
|
||||
|
||||
handleEditGroup = () => {
|
||||
this.props.onOpenEditGroup(this.props.group.get('id'))
|
||||
}
|
||||
|
||||
handleOnOpenRemovedMembers = () => {
|
||||
this.props.onOpenRemovedMembers(this.props.group.get('id'))
|
||||
}
|
||||
|
||||
handleOnOpenGroupMembers = () => {
|
||||
this.props.onOpenGroupMembers(this.props.group.get('id'))
|
||||
}
|
||||
|
||||
handleOnClosePopover = () => {
|
||||
@ -102,32 +67,40 @@ class GroupOptionsPopover extends ImmutablePureComponent {
|
||||
|
||||
render() {
|
||||
const {
|
||||
group,
|
||||
intl,
|
||||
isAdmin,
|
||||
isShortcut,
|
||||
isXS,
|
||||
} = this.props
|
||||
|
||||
if (!group) return <div/>
|
||||
|
||||
const groupId = group.get('id')
|
||||
|
||||
const listItems = [
|
||||
{
|
||||
hideArrow: true,
|
||||
icon: 'group',
|
||||
title: intl.formatMessage(messages.groupMembers),
|
||||
onClick: this.handleOnOpenGroupMembers,
|
||||
onClick: this.handleOnClosePopover,
|
||||
to: `/groups/${groupId}/members`,
|
||||
isHidden: !isAdmin,
|
||||
},
|
||||
{
|
||||
hideArrow: true,
|
||||
icon: 'block',
|
||||
title: intl.formatMessage(messages.removedMembers),
|
||||
onClick: this.handleOnOpenRemovedMembers,
|
||||
onClick: this.handleOnClosePopover,
|
||||
to: `/groups/${groupId}/removed-accounts`,
|
||||
isHidden: !isAdmin,
|
||||
},
|
||||
{
|
||||
hideArrow: true,
|
||||
icon: 'pencil',
|
||||
title: intl.formatMessage(messages.editGroup),
|
||||
onClick: this.handleEditGroup,
|
||||
onClick: this.handleOnClosePopover,
|
||||
to: `/groups/${groupId}/edit`,
|
||||
isHidden: !isAdmin,
|
||||
},
|
||||
{
|
||||
|
@ -50,8 +50,6 @@ export const MODAL_EMBED = 'EMBED'
|
||||
export const MODAL_GIF_PICKER = 'GIF_PICKER'
|
||||
export const MODAL_GROUP_CREATE = 'GROUP_CREATE'
|
||||
export const MODAL_GROUP_DELETE = 'GROUP_DELETE'
|
||||
export const MODAL_GROUP_MEMBERS = 'GROUP_MEMBERS'
|
||||
export const MODAL_GROUP_REMOVED_ACCOUNTS = 'GROUP_REMOVED_ACCOUNTS'
|
||||
export const MODAL_HASHTAG_TIMELINE_SETTINGS = 'HASHTAG_TIMELINE_SETTINGS'
|
||||
export const MODAL_HOME_TIMELINE_SETTINGS = 'HOME_TIMELINE_SETTINGS'
|
||||
export const MODAL_HOTKEYS = 'HOTKEYS'
|
||||
|
@ -34,12 +34,10 @@ export function GroupCreate() { return import(/* webpackChunkName: "features/gro
|
||||
export function GroupCreateModal() { return import(/* webpackChunkName: "components/group_create_modal" */'../../../components/modal/group_create_modal') }
|
||||
export function GroupDeleteModal() { return import(/* webpackChunkName: "components/group_delete_modal" */'../../../components/modal/group_delete_modal') }
|
||||
export function GroupListSortOptionsPopover() { return import(/* webpackChunkName: "components/group_list_sort_options_popover" */'../../../components/popover/group_list_sort_options_popover') }
|
||||
export function GroupMembersModal() { return import(/* webpackChunkName: "components/group_members_modal" */'../../../components/modal/group_members_modal') }
|
||||
export function GroupMemberOptionsPopover() { return import(/* webpackChunkName: "components/group_member_options_popover" */'../../../components/popover/group_member_options_popover') }
|
||||
export function GroupMembers() { return import(/* webpackChunkName: "features/group_members" */'../../group_members') }
|
||||
export function GroupOptionsPopover() { return import(/* webpackChunkName: "components/group_options_popover" */'../../../components/popover/group_options_popover') }
|
||||
export function GroupRemovedAccounts() { return import(/* webpackChunkName: "features/group_removed_accounts" */'../../group_removed_accounts') }
|
||||
export function GroupRemovedAccountsModal() { return import(/* webpackChunkName: "components/group_removed_accounts_modal" */'../../../components/modal/group_removed_accounts_modal') }
|
||||
export function GroupTimeline() { return import(/* webpackChunkName: "features/group_timeline" */'../../group_timeline') }
|
||||
export function HashtagTimeline() { return import(/* webpackChunkName: "features/hashtag_timeline" */'../../hashtag_timeline') }
|
||||
export function HashtagTimelineSettingsModal() { return import(/* webpackChunkName: "components/hashtag_timeline_settings_modal" */'../../../components/modal/hashtag_timeline_settings_modal') }
|
||||
|
Loading…
x
Reference in New Issue
Block a user