[Glitch] Change dropdown menu icon to not be replaced by close icon when open in web UI
Port 2347ea813e
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
777510a696
commit
efbc8cba17
|
@ -9,7 +9,6 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import { supportsPassiveEvents } from 'detect-passive-events';
|
import { supportsPassiveEvents } from 'detect-passive-events';
|
||||||
import Overlay from 'react-overlays/Overlay';
|
import Overlay from 'react-overlays/Overlay';
|
||||||
|
|
||||||
import CloseIcon from '@/material-icons/400-24px/close.svg?react';
|
|
||||||
import { CircularProgress } from 'flavours/glitch/components/circular_progress';
|
import { CircularProgress } from 'flavours/glitch/components/circular_progress';
|
||||||
import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router';
|
import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router';
|
||||||
|
|
||||||
|
@ -298,7 +297,7 @@ class Dropdown extends PureComponent {
|
||||||
}) : (
|
}) : (
|
||||||
<IconButton
|
<IconButton
|
||||||
icon={!open ? icon : 'close'}
|
icon={!open ? icon : 'close'}
|
||||||
iconComponent={!open ? iconComponent : CloseIcon}
|
iconComponent={iconComponent}
|
||||||
title={title}
|
title={title}
|
||||||
active={open}
|
active={open}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
|
|
|
@ -83,7 +83,6 @@ const mapStateToProps = state => ({
|
||||||
hasMediaAttachments: state.getIn(['compose', 'media_attachments']).size > 0,
|
hasMediaAttachments: state.getIn(['compose', 'media_attachments']).size > 0,
|
||||||
canUploadMore: !state.getIn(['compose', 'media_attachments']).some(x => ['audio', 'video'].includes(x.get('type'))) && state.getIn(['compose', 'media_attachments']).size < 4,
|
canUploadMore: !state.getIn(['compose', 'media_attachments']).some(x => ['audio', 'video'].includes(x.get('type'))) && state.getIn(['compose', 'media_attachments']).size < 4,
|
||||||
isWide: state.getIn(['local_settings', 'stretch']),
|
isWide: state.getIn(['local_settings', 'stretch']),
|
||||||
dropdownMenuIsOpen: state.dropdownMenu.openId !== null,
|
|
||||||
unreadNotifications: state.getIn(['notifications', 'unread']),
|
unreadNotifications: state.getIn(['notifications', 'unread']),
|
||||||
showFaviconBadge: state.getIn(['local_settings', 'notifications', 'favicon_badge']),
|
showFaviconBadge: state.getIn(['local_settings', 'notifications', 'favicon_badge']),
|
||||||
hicolorPrivacyIcons: state.getIn(['local_settings', 'hicolor_privacy_icons']),
|
hicolorPrivacyIcons: state.getIn(['local_settings', 'hicolor_privacy_icons']),
|
||||||
|
@ -274,7 +273,6 @@ class UI extends PureComponent {
|
||||||
hasMediaAttachments: PropTypes.bool,
|
hasMediaAttachments: PropTypes.bool,
|
||||||
canUploadMore: PropTypes.bool,
|
canUploadMore: PropTypes.bool,
|
||||||
intl: PropTypes.object.isRequired,
|
intl: PropTypes.object.isRequired,
|
||||||
dropdownMenuIsOpen: PropTypes.bool,
|
|
||||||
unreadNotifications: PropTypes.number,
|
unreadNotifications: PropTypes.number,
|
||||||
showFaviconBadge: PropTypes.bool,
|
showFaviconBadge: PropTypes.bool,
|
||||||
hicolorPrivacyIcons: PropTypes.bool,
|
hicolorPrivacyIcons: PropTypes.bool,
|
||||||
|
@ -600,7 +598,7 @@ class UI extends PureComponent {
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { draggingOver } = this.state;
|
const { draggingOver } = this.state;
|
||||||
const { children, isWide, location, dropdownMenuIsOpen, layout, moved } = this.props;
|
const { children, isWide, location, layout, moved } = this.props;
|
||||||
|
|
||||||
const className = classNames('ui', {
|
const className = classNames('ui', {
|
||||||
'wide': isWide,
|
'wide': isWide,
|
||||||
|
@ -632,7 +630,7 @@ class UI extends PureComponent {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HotKeys keyMap={keyMap} handlers={handlers} ref={this.setHotkeysRef} attach={window} focused>
|
<HotKeys keyMap={keyMap} handlers={handlers} ref={this.setHotkeysRef} attach={window} focused>
|
||||||
<div className={className} ref={this.setRef} style={{ pointerEvents: dropdownMenuIsOpen ? 'none' : null }}>
|
<div className={className} ref={this.setRef}>
|
||||||
{moved && (<div className='flash-message alert'>
|
{moved && (<div className='flash-message alert'>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='moved_to_warning'
|
id='moved_to_warning'
|
||||||
|
|
Loading…
Reference in New Issue