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.alpha.play1662cssbargraph5201 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.11.0.pre.rc.9 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.10.0.pre.alpha.play1662cssbargraph5200 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.11.0.pre.rc.8 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.11.0.pre.rc.7 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.11.0.pre.rc.6 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.11.0.pre.rc.5 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.10.0.pre.alpha.play1662cssbargraph5193 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.11.0.pre.rc.4 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.11.0.pre.rc.3 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.10.0.pre.alpha.PBNTR662stickyrightcolumnreact5160 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.11.0.pre.rc.2 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.11.0.pre.rc.1 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.10.0.pre.alpha.PBNTR775formmatingmaskdefaultvalue5137 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.11.0.pre.rc.0 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.9.0.pre.alpha.PBNTR767advancedtablemultiheadercolumns5136 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.9.0.pre.alpha.PBNTR775formmatingmaskdefaultvalue5121 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.9.0.pre.alpha.PBNTR775formmatingmaskdefaultvalue5120 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.10.0 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.10.0.pre.rc.24 app/pb_kits/playbook/pb_map/_map_controls.tsx