mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +07:00
fixed imports
This commit is contained in:
parent
23c9e42bd5
commit
103097edbd
50 changed files with 260 additions and 229 deletions
|
@ -1,5 +1,5 @@
|
|||
// @flow
|
||||
import * as React from 'react';
|
||||
import React from 'react';
|
||||
|
||||
import { EditorPanel } from '$components/panels/EditorPanel';
|
||||
import { Fills } from '$components/Fills';
|
||||
|
@ -15,23 +15,23 @@ import { LeftDialog } from '$containers/LeftDialog';
|
|||
import { TopLeftPanel } from '$components/panels/TopLeftPanel';
|
||||
import { TopRightPanel } from '$components/panels/TopRightPanel';
|
||||
import { LogoPreview } from '$components/logo/LogoPreview';
|
||||
import { IStickerPack } from "$constants/stickers";
|
||||
import { IDialogs } from "$constants/dialogs";
|
||||
import { IStickerPack } from '$constants/stickers';
|
||||
import { IDialogs } from '$constants/dialogs';
|
||||
|
||||
import { Map } from "$containers/map/Map"
|
||||
import { Map } from '$containers/map/Map';
|
||||
import { IRootReducer } from '$redux/user';
|
||||
|
||||
type Props = {
|
||||
sticker: string,
|
||||
renderer_active: boolean,
|
||||
sticker: string;
|
||||
renderer_active: boolean;
|
||||
|
||||
mode: IRootReducer['mode'],
|
||||
dialog: keyof IDialogs,
|
||||
dialog_active: boolean,
|
||||
set: keyof IStickerPack,
|
||||
hideRenderer: typeof hideRenderer,
|
||||
setDialogActive: typeof setDialogActive,
|
||||
}
|
||||
mode: IRootReducer['mode'];
|
||||
dialog: keyof IDialogs;
|
||||
dialog_active: boolean;
|
||||
set: keyof IStickerPack;
|
||||
hideRenderer: typeof hideRenderer;
|
||||
setDialogActive: typeof setDialogActive;
|
||||
};
|
||||
|
||||
const Component = (props: Props) => (
|
||||
<div>
|
||||
|
@ -41,9 +41,6 @@ const Component = (props: Props) => (
|
|||
|
||||
<TopLeftPanel />
|
||||
<TopRightPanel />
|
||||
<LogoPreview />
|
||||
|
||||
<Cursor mode={props.mode} sticker={props.sticker} set={props.set} />
|
||||
|
||||
<LeftDialog
|
||||
dialog={props.dialog}
|
||||
|
@ -51,18 +48,22 @@ const Component = (props: Props) => (
|
|||
setDialogActive={props.setDialogActive}
|
||||
/>
|
||||
|
||||
<LogoPreview />
|
||||
|
||||
<Map />
|
||||
|
||||
{ props.renderer_active &&
|
||||
<Renderer onClick={props.hideRenderer} />
|
||||
}
|
||||
{props.renderer_active && <Renderer onClick={props.hideRenderer} />}
|
||||
</div>
|
||||
);
|
||||
|
||||
const mapStateToProps = ({
|
||||
user: {
|
||||
mode, dialog, dialog_active, renderer, activeSticker: { sticker = null, set = null }
|
||||
}
|
||||
mode,
|
||||
dialog,
|
||||
dialog_active,
|
||||
renderer,
|
||||
activeSticker: { sticker = null, set = null },
|
||||
},
|
||||
}) => ({
|
||||
renderer_active: renderer.renderer_active,
|
||||
mode,
|
||||
|
@ -72,5 +73,6 @@ const mapStateToProps = ({
|
|||
set,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => bindActionCreators({ hideRenderer, setDialogActive }, dispatch);
|
||||
const mapDispatchToProps = dispatch =>
|
||||
bindActionCreators({ hideRenderer, setDialogActive }, dispatch);
|
||||
export const App = connect(mapStateToProps, mapDispatchToProps)(hot(module)(Component));
|
||||
|
|
|
@ -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 };
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Map as MapInterface, map } from "leaflet";
|
||||
import * as React from "react";
|
||||
import React from "react";
|
||||
import { createPortal } from "react-dom";
|
||||
import {
|
||||
selectMapProvider,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import * as React from "react";
|
||||
import React from "react";
|
||||
import { Map, marker, Marker } from "leaflet";
|
||||
import { IStickerDump } from "$redux/map/types";
|
||||
import { STICKERS } from "$constants/stickers";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import * as React from 'react';
|
||||
import React from 'react';
|
||||
import { IStickerDump } from '$redux/map/types';
|
||||
import { FeatureGroup, Map } from 'leaflet';
|
||||
import { Sticker } from '$containers/map/Sticker';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import * as React from "react";
|
||||
import React from "react";
|
||||
import { TileContext } from "../../../utils/context";
|
||||
import { TileLayer as TileLayerInterface, tileLayer, Map } from "leaflet";
|
||||
import { DEFAULT_PROVIDER, PROVIDERS } from "$constants/providers";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue