mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-05-04 23:46:40 +07:00
fixed imports
This commit is contained in:
parent
23c9e42bd5
commit
103097edbd
50 changed files with 260 additions and 229 deletions
|
@ -1,17 +1,15 @@
|
|||
// @flow
|
||||
import * as React from 'react';
|
||||
import React, { createElement } from 'react';
|
||||
import { DIALOGS, IDialogs } from '$constants/dialogs';
|
||||
import * as classnames from 'classnames';
|
||||
import classnames from 'classnames';
|
||||
import { AppInfoDialog } from '$components/dialogs/AppInfoDialog';
|
||||
import { Icon } from '$components/panels/Icon';
|
||||
import { MapListDialog } from '$components/dialogs/MapListDialog';
|
||||
import * as ActionCreators from "$redux/user/actions";
|
||||
import { StatelessComponent } from "react";
|
||||
import * as USER_ACTIONS from '$redux/user/actions';
|
||||
|
||||
interface Props {
|
||||
dialog: keyof IDialogs,
|
||||
dialog_active: Boolean,
|
||||
setDialogActive: typeof ActionCreators.setDialogActive,
|
||||
dialog: keyof IDialogs;
|
||||
dialog_active: Boolean;
|
||||
setDialogActive: typeof USER_ACTIONS.setDialogActive;
|
||||
}
|
||||
|
||||
const LEFT_DIALOGS = {
|
||||
|
@ -19,22 +17,25 @@ const LEFT_DIALOGS = {
|
|||
[DIALOGS.APP_INFO]: AppInfoDialog,
|
||||
};
|
||||
|
||||
export const LeftDialog = ({ dialog, dialog_active, setDialogActive }: Props) => (
|
||||
const LeftDialog = ({ dialog, dialog_active, setDialogActive }: Props) => (
|
||||
<React.Fragment>
|
||||
{
|
||||
Object.keys(LEFT_DIALOGS).map(item => (
|
||||
<div className={classnames('dialog', { active: dialog_active && (dialog === item) })} key={item}>
|
||||
{ dialog && LEFT_DIALOGS[item] && React.createElement(LEFT_DIALOGS[item]) }
|
||||
<div className="dialog-close-button desktop-only" onClick={() => setDialogActive(false)}>
|
||||
<Icon icon="icon-cancel-1" />
|
||||
</div>
|
||||
{Object.keys(LEFT_DIALOGS).map(item => (
|
||||
<div
|
||||
className={classnames('dialog', { active: dialog_active && dialog === item })}
|
||||
key={item}
|
||||
>
|
||||
{dialog && LEFT_DIALOGS[item] && createElement(LEFT_DIALOGS[item], {})}
|
||||
|
||||
<div className="dialog-close-button mobile-only" onClick={() => setDialogActive(false)}>
|
||||
<Icon icon="icon-chevron-down" />
|
||||
</div>
|
||||
<div className="dialog-close-button desktop-only" onClick={() => setDialogActive(false)}>
|
||||
<Icon icon="icon-cancel-1" />
|
||||
</div>
|
||||
))
|
||||
}
|
||||
|
||||
<div className="dialog-close-button mobile-only" onClick={() => setDialogActive(false)}>
|
||||
<Icon icon="icon-chevron-down" />
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</React.Fragment>
|
||||
);
|
||||
|
||||
export { LeftDialog };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue