fixed dialog witdths

This commit is contained in:
Fedor Katurov 2020-01-10 14:32:12 +07:00
parent 65885acb75
commit afc9654200
13 changed files with 115 additions and 132 deletions

View file

@ -25,7 +25,7 @@ export class CancelDialog extends React.Component<Props, void> {
const { width } = this.props;
return (
<div className="control-dialog" style={{ width }}>
<div className="control-dialog bottom right" style={{ width }}>
<div className="helper cancel-helper">
<div className="helper__text danger">
<Icon icon="icon-cancel-1" />

View file

@ -100,7 +100,7 @@ const RouterDialogUnconnected: FC<Props> = ({
editorRouterSubmit,
width,
}) => (
<div className="control-dialog" style={{ width }}>
<div className="control-dialog bottom right" style={{ width }}>
<div className={classnames('save-loader', { active: is_routing })} />
{!waypoints.length && noPoints({ editorRouterCancel })}

View file

@ -11,11 +11,11 @@ import ExpandableTextarea from 'react-expandable-textarea';
import { connect } from 'react-redux';
import { selectMap } from '~/redux/map/selectors';
import * as EDITOR_ACTIONS from '~/redux/editor/actions';
import { selectEditor } from '~/redux/editor/selectors';
import { selectEditorSave } from '~/redux/editor/selectors';
const mapStateToProps = state => ({
map: selectMap(state),
editor: selectEditor(state),
save: selectEditorSave(state),
});
const mapDispatchToProps = {
@ -94,7 +94,7 @@ class SaveDialogUnconnected extends React.Component<Props, State> {
render() {
const { title, is_public, description } = this.state;
const {
editor: { save_error, save_finished, save_overwriting, save_loading },
save: { error, finished, overwriting, loading },
width,
} = this.props;
const { host, protocol } = getUrlData();
@ -102,7 +102,7 @@ class SaveDialogUnconnected extends React.Component<Props, State> {
return (
<div className="control-dialog control-dialog-medium" style={{ width }}>
<div className="helper save-helper">
<div className={classnames('save-loader', { active: save_loading })} />
<div className={classnames('save-loader', { active: loading })} />
<div className="save-title">
<div className="save-title-input">
@ -112,7 +112,7 @@ class SaveDialogUnconnected extends React.Component<Props, State> {
value={title}
onChange={this.setTitle}
autoFocus
readOnly={save_finished}
readOnly={finished}
/>
</div>
</div>
@ -126,7 +126,7 @@ class SaveDialogUnconnected extends React.Component<Props, State> {
type="text"
value={this.getAddress()}
onChange={this.setAddress}
readOnly={save_finished}
readOnly={finished}
onCopy={this.onCopy}
/>
<div className="save-address-copy" onClick={this.onCopy}>
@ -143,7 +143,7 @@ class SaveDialogUnconnected extends React.Component<Props, State> {
onChange={this.setDescription}
/>
</div>
<div className="save-text">{save_error || TIPS.SAVE_INFO}</div>
<div className="save-text">{error || TIPS.SAVE_INFO}</div>
<div className="save-buttons">
<div
@ -154,27 +154,27 @@ class SaveDialogUnconnected extends React.Component<Props, State> {
{is_public ? ' В каталоге карт' : ' Только по ссылке'}
</div>
<div>
{!save_finished && (
{!finished && (
<div className="button" onClick={this.cancelSaving}>
Отмена
</div>
)}
{!save_finished && !save_overwriting && (
{!finished && !overwriting && (
<div className="button primary" onClick={this.editorSendSaveRequest}>
Сохранить
</div>
)}
{save_overwriting && (
{overwriting && (
<div className="button danger" onClick={this.forceSaveRequest}>
Перезаписать
</div>
)}
{save_finished && (
{finished && (
<div className="button" onClick={this.onCopy}>
Скопировать
</div>
)}
{save_finished && (
{finished && (
<div className="button success" onClick={this.cancelSaving}>
Отлично!
</div>

View file

@ -15,7 +15,7 @@ type Props = ReturnType<typeof mapStateToProps> &
};
const StickersDialogUnconnected = ({ editorSetActiveSticker, width }: Props) => (
<div className="control-dialog control-dialog-big" style={{ width }}>
<div className="control-dialog control-dialog-big bottom right" style={{ width }}>
<div className="helper stickers-helper">
{Object.keys(STICKERS).map(set => (
<div key={set}>

View file

@ -22,7 +22,7 @@ const TrashDialogUnconnected: FC<Props> = ({
editorClearCancel,
width,
}) => (
<div className="control-dialog" style={{ width }}>
<div className="control-dialog bottom right" style={{ width }}>
<div className="helper trash-helper desktop-only">
<div className="helper__text danger">
<div className="big upper desktop-only">Удалить:</div>