Ensure modals opened from the Settings Sidebar have a close icon (#3994)
* Ensure modals opened from the Settings Sidebar have a close icon * Feedback during review
This commit is contained in:
parent
58dcbb215b
commit
06f03d88e9
1 changed files with 7 additions and 13 deletions
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import React, {PureComponent} from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import {InteractionManager, ScrollView, View} from 'react-native';
|
||||
import {ScrollView, View} from 'react-native';
|
||||
import MaterialIcon from 'react-native-vector-icons/MaterialIcons';
|
||||
|
||||
import {General} from 'mattermost-redux/constants';
|
||||
|
|
@ -37,14 +37,6 @@ export default class SettingsSidebarBase extends PureComponent {
|
|||
status: 'offline',
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
MaterialIcon.getImageSource('close', 20, props.theme.sidebarHeaderTextColor).then((source) => {
|
||||
this.closeButton = source;
|
||||
});
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.mounted = true;
|
||||
EventEmitter.on(NavigationTypes.CLOSE_SETTINGS_SIDEBAR, this.closeSettingsSidebar);
|
||||
|
|
@ -138,9 +130,13 @@ export default class SettingsSidebarBase extends PureComponent {
|
|||
logout();
|
||||
});
|
||||
|
||||
openModal = (screen, title, passProps) => {
|
||||
openModal = async (screen, title, passProps) => {
|
||||
this.closeSettingsSidebar();
|
||||
|
||||
if (!this.closeButton) {
|
||||
this.closeButton = await MaterialIcon.getImageSource('close', 20, this.props.theme.sidebarHeaderTextColor);
|
||||
}
|
||||
|
||||
const options = {
|
||||
topBar: {
|
||||
leftButtons: [{
|
||||
|
|
@ -150,9 +146,7 @@ export default class SettingsSidebarBase extends PureComponent {
|
|||
},
|
||||
};
|
||||
|
||||
InteractionManager.runAfterInteractions(() => {
|
||||
showModal(screen, title, passProps, options);
|
||||
});
|
||||
showModal(screen, title, passProps, options);
|
||||
};
|
||||
|
||||
updateStatus = (status) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue