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.11.1.pre.alpha.PLAY17445539 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.11.1.pre.alpha.PBNTR798datepickerturbo5537 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.11.1.pre.alpha.pbntr703collapsiblerowsrails5536 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.11.1.pre.alpha.PLAY1751pbcontenttagpt25529 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.11.1.pre.alpha.PBNTR7495495 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.12.0.pre.rc.11 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.12.0.pre.rc.10 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.12.0.pre.rc.9 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.12.0.pre.rc.8 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.12.0.pre.rc.7 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.11.1.pre.alpha.play1724darkmodeauditmap5437 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.11.1.pre.alpha.PBNTR719listdraggablesimple5432 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.11.1.pre.alpha.PBNTR768stickyrightcolumn5431 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.12.0.pre.rc.6 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5415 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.11.1.pre.alpha.play1724darkmodeauditmap5413 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.12.0.pre.rc.5 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.11.1.pre.alpha.play1724darkmodeauditmap5409 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5400 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5392 app/pb_kits/playbook/pb_map/_map_controls.tsx