fixed logo components

This commit is contained in:
Fedor Katurov 2020-01-08 12:15:00 +07:00
parent 0f31144567
commit 23c9e42bd5
4 changed files with 29 additions and 19 deletions

View file

@ -3,14 +3,20 @@ import { LOGOS } from '$constants/logos';
import { Icon } from '$components/panels/Icon';
import classnames from 'classnames';
import * as MAP_ACTIONS from "$redux/map/actions"
import { IMapReducer } from '$redux/map';
import { selectMapLogo } from '$redux/map/selectors';
import { connect } from 'react-redux';
interface Props {
logo: IMapReducer['logo'],
mapSetLogo: typeof MAP_ACTIONS.mapSetLogo,
}
const mapStateToProps = state => ({
logo: selectMapLogo(state),
});
export const LogoDialog = ({ logo, mapSetLogo }: Props) => (
const mapDispatchToProps = {
mapSetLogo: MAP_ACTIONS.mapSetLogo,
};
type Props = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps & {};
const LogoDialogUnconnected = ({ logo, mapSetLogo }: Props) => (
<div className="control-dialog top">
<div className="helper logo-helper">
<div className="helper-back">
@ -30,3 +36,7 @@ export const LogoDialog = ({ logo, mapSetLogo }: Props) => (
</div>
</div>
);
const LogoDialog = connect(mapStateToProps, mapDispatchToProps)(LogoDialogUnconnected);
export { LogoDialog };

View file

@ -3,7 +3,6 @@ import { PROVIDERS, replaceProviderUrl } from '$constants/providers';
import { Icon } from '$components/panels/Icon';
import classnames from 'classnames';
import * as MAP_ACTIONS from "$redux/map/actions";
import { IRootState } from "$redux/user";
import { selectMapProvider } from '$redux/map/selectors';
import { connect } from 'react-redux';