[Glitch] Add dropdown for boost privacy in boost confirmation modal

Port 07b46cb332 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Claire
2021-02-11 00:53:12 +01:00
parent 9213b02656
commit 49eef466b8
14 changed files with 134 additions and 25 deletions

View File

@@ -31,6 +31,8 @@ export default class ComposerOptionsDropdown extends React.PureComponent {
title: PropTypes.string,
value: PropTypes.string,
onChange: PropTypes.func,
noModal: PropTypes.bool,
container: PropTypes.func,
};
state = {
@@ -42,10 +44,10 @@ export default class ComposerOptionsDropdown extends React.PureComponent {
// Toggles opening and closing the dropdown.
handleToggle = ({ target, type }) => {
const { onModalOpen } = this.props;
const { onModalOpen, noModal } = this.props;
const { open } = this.state;
if (isUserTouching()) {
if (!noModal && isUserTouching()) {
if (this.state.open) {
this.props.onModalClose();
} else {
@@ -183,6 +185,7 @@ export default class ComposerOptionsDropdown extends React.PureComponent {
items,
onChange,
value,
container,
} = this.props;
const { open, placement } = this.state;
const computedClass = classNames('composer--options--dropdown', {
@@ -219,6 +222,7 @@ export default class ComposerOptionsDropdown extends React.PureComponent {
placement={placement}
show={open}
target={this}
container={container}
>
<DropdownMenu
items={items}