Sha256: 139aa98802583c070637ea27d2ba2d25744b1d517245e44067a35a1308064941

Contents?: true

Size: 1.47 KB

Versions: 323

Compression:

Stored size: 1.47 KB

Contents

import React from "react";
import Button from "../pb_button/_button";
import Icon from "../pb_icon/_icon";
import Flex from "../pb_flex/_flex";
import { getAllIcons } from "../utilities/icons/allicons"

type MapControlTypes = {
  zoomBtns?: boolean, 
  flyTo?: boolean, 
  zoomInClick?: () => void,
  zoomOutClick?: () => void,
  flyToClick?: () => void,
  children?: React.ReactNode | React.ReactNode[]
}

const eyeIcon = getAllIcons()["eye"]

const MapControls = ({
  zoomBtns,
  zoomInClick,
  zoomOutClick,
  flyTo,
  flyToClick,
  children,
}: MapControlTypes) => {
  return (
    <Flex className="custom-nav-control"
        orientation="column"
    >
      {zoomBtns ? (
        <>
          <div className="custom-nav-control-zoom">
            <Button className="map-zoom-in-button"
                onClick={zoomInClick}
            >
              <Icon icon="plus" />
            </Button>
            <Button className="map-zoom-out-button"
                onClick={zoomOutClick}
            >
              <Icon icon="minus" />
            </Button>
          </div>
          {flyTo ? (
            <Button className="map-flyto-button"
                onClick={flyToClick}
            >
              <Icon 
                  className="svg-inline--fa"
                  customIcon={eyeIcon.icon as unknown as { [key: string]: SVGElement }} 
              />
            </Button>
          ) : null}
        </>
      ) : null}
      {children}
    </Flex>
  );
};

export default MapControls;

Version data entries

323 entries across 323 versions & 1 rubygems

Version Path
playbook_ui-14.10.0.pre.rc.23 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.10.0.pre.rc.22 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.10.0.pre.rc.21 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.9.0.pre.alpha.play1703errorstatealignment5060 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.10.0.pre.rc.20 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.10.0.pre.rc.19 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.10.0.pre.rc.18 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.9.0.pre.alpha.PLAY1660reactdropzone5020 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.10.0.pre.rc.17 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.10.0.pre.rc.16 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.9.0.pre.alpha.play17004992 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.9.0.pre.alpha.play1703errorstatealignment4991 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.10.0.pre.rc.15 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.9.0.pre.alpha.PLAY16264952 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.9.0.pre.alpha.PLAY1731inputmasking4927 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.9.0.pre.alpha.play1742globalheightfixes4926 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.9.0.pre.alpha.play1742globalheightfixes4925 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.10.0.pre.rc.14 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.10.0.pre.rc.13 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.9.0.pre.alpha.PBNTR746datepickerdefaultbug4903 app/pb_kits/playbook/pb_map/_map_controls.tsx