feat(info): automatically show the info dialog (#2018)
* ref(info): be able to open dialog through store * feat(info): automatically show the info dialog Conditions: - Lonely call - Has not opened the info dialog yet * squash: change to show on start, hide later * squash: update naming and comment
This commit is contained in:
@@ -7,23 +7,12 @@ import React, { Component } from 'react';
|
||||
|
||||
import { translate } from '../../base/i18n';
|
||||
|
||||
import { TOOLTIP_TO_POPUP_POSITION } from '../constants';
|
||||
import { isButtonEnabled } from '../functions';
|
||||
import StatelessToolbarButton from './StatelessToolbarButton';
|
||||
|
||||
declare var APP: Object;
|
||||
|
||||
/**
|
||||
* Mapping of tooltip positions to equivalent {@code AKInlineDialog} positions.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
const TOOLTIP_TO_POPUP_POSITION = {
|
||||
bottom: 'bottom center',
|
||||
left: 'left middle',
|
||||
top: 'top center',
|
||||
right: 'right middle'
|
||||
};
|
||||
|
||||
/**
|
||||
* Represents a button in Toolbar on React.
|
||||
*
|
||||
|
||||
@@ -3,21 +3,9 @@ import PropTypes from 'prop-types';
|
||||
import React, { Component } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { TOOLTIP_TO_POPUP_POSITION } from '../constants';
|
||||
import ToolbarButton from './ToolbarButton';
|
||||
|
||||
/**
|
||||
* Maps AtlasKit {@code Tooltip} positions to equivalent {@code InlineDialog}
|
||||
* positions. The {@code InlineDialog} will appear from the the same side of
|
||||
* the button as the tooltip.
|
||||
*
|
||||
*/
|
||||
const TOOLTIP_TO_DIALOG_POSITION = {
|
||||
bottom: 'bottom center',
|
||||
left: 'left middle',
|
||||
right: 'right middle',
|
||||
top: 'top center'
|
||||
};
|
||||
|
||||
/**
|
||||
* React {@code Component} for displaying a button which will open an inline
|
||||
* dialog.
|
||||
@@ -113,7 +101,7 @@ class ToolbarButtonWithDialog extends Component {
|
||||
content = { <Content onClose = { this._onDialogClose } /> }
|
||||
isOpen = { _visible && this.state.showDialog }
|
||||
onClose = { this._onDialogClose }
|
||||
position = { TOOLTIP_TO_DIALOG_POSITION[tooltipPosition] }>
|
||||
position = { TOOLTIP_TO_POPUP_POSITION[tooltipPosition] }>
|
||||
<ToolbarButton
|
||||
button = { buttonConfiguration }
|
||||
onClick = { this._onDialogToggle }
|
||||
|
||||
Reference in New Issue
Block a user