Add relationship-based options to status dropdowns (#12377)
Move bookmark action in inline statuses from action bar to dropdown
This commit is contained in:
parent
cb3e9a2934
commit
853a67ed16
5 changed files with 229 additions and 24 deletions
|
@ -1,4 +1,5 @@
|
|||
import { openDropdownMenu, closeDropdownMenu } from '../actions/dropdown_menu';
|
||||
import { fetchRelationships } from 'mastodon/actions/accounts';
|
||||
import { openModal, closeModal } from '../actions/modal';
|
||||
import { connect } from 'react-redux';
|
||||
import DropdownMenu from '../components/dropdown_menu';
|
||||
|
@ -13,12 +14,15 @@ const mapStateToProps = state => ({
|
|||
|
||||
const mapDispatchToProps = (dispatch, { status, items }) => ({
|
||||
onOpen(id, onItemClick, dropdownPlacement, keyboard) {
|
||||
dispatch(fetchRelationships([status.getIn(['account', 'id'])]));
|
||||
|
||||
dispatch(isUserTouching() ? openModal('ACTIONS', {
|
||||
status,
|
||||
actions: items,
|
||||
onClick: onItemClick,
|
||||
}) : openDropdownMenu(id, dropdownPlacement, keyboard));
|
||||
},
|
||||
|
||||
onClose(id) {
|
||||
dispatch(closeModal('ACTIONS'));
|
||||
dispatch(closeDropdownMenu(id));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue