mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 19:16:41 +07:00
fixed logo & provider dialogs
This commit is contained in:
parent
46a9f9daba
commit
71b6fe3a59
2 changed files with 26 additions and 36 deletions
|
@ -18,7 +18,7 @@ export const LogoDialog = ({ logo, setLogo }: Props) => (
|
||||||
Object.keys(LOGOS).map(item => (
|
Object.keys(LOGOS).map(item => (
|
||||||
<div
|
<div
|
||||||
className={classnames('helper-menu-item', { active: (item === logo) })}
|
className={classnames('helper-menu-item', { active: (item === logo) })}
|
||||||
onClick={() => setLogo(item)}
|
onMouseDown={() => setLogo(item)}
|
||||||
key={item}
|
key={item}
|
||||||
>
|
>
|
||||||
{LOGOS[item][0]}
|
{LOGOS[item][0]}
|
||||||
|
|
|
@ -2,44 +2,34 @@ import React from 'react';
|
||||||
import { PROVIDERS, replaceProviderUrl } from '$constants/providers';
|
import { PROVIDERS, replaceProviderUrl } from '$constants/providers';
|
||||||
import { Icon } from '$components/panels/Icon';
|
import { Icon } from '$components/panels/Icon';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import { MODES } from '$constants/modes';
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
changeProvider: Function,
|
changeProvider: Function,
|
||||||
setMode: Function,
|
|
||||||
provider: String,
|
provider: String,
|
||||||
};
|
};
|
||||||
|
|
||||||
export class ProviderDialog extends React.Component<Props, void> {
|
export const ProviderDialog = ({ provider, changeProvider }: Props) => (
|
||||||
closeDialog = () => this.props.setMode(MODES.NONE);
|
<div className="control-dialog top right control-dialog-provider">
|
||||||
|
<div className="helper provider-helper">
|
||||||
render() {
|
{
|
||||||
const { provider, changeProvider } = this.props;
|
Object.keys(PROVIDERS).map(item => (
|
||||||
|
<div
|
||||||
return (
|
className={classnames('provider-helper-thumb', { active: provider === item })}
|
||||||
<div className="control-dialog top right control-dialog-provider">
|
style={{
|
||||||
<div className="helper provider-helper">
|
backgroundImage: `url(${replaceProviderUrl(item, { x: 5980, y: 2589, zoom: 13 })})`,
|
||||||
{
|
}}
|
||||||
Object.keys(PROVIDERS).map(item => (
|
onMouseDown={() => changeProvider(item)}
|
||||||
<div
|
key={PROVIDERS[item].name}
|
||||||
className={classnames('provider-helper-thumb', { active: provider === item })}
|
>
|
||||||
style={{
|
{
|
||||||
backgroundImage: `url(${replaceProviderUrl(item, { x: 5980, y: 2589, zoom: 13 })})`,
|
provider === item &&
|
||||||
}}
|
<div className="provider-helper-check">
|
||||||
onClick={() => changeProvider(item)}
|
<Icon icon="icon-check-1" />
|
||||||
key={PROVIDERS[item].name}
|
</div>
|
||||||
>
|
}
|
||||||
{
|
</div>
|
||||||
provider === item &&
|
))
|
||||||
<div className="provider-helper-check">
|
}
|
||||||
<Icon icon="icon-check-1" />
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
);
|
||||||
</div>
|
|
||||||
))
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue