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.5.0.pre.alpha.PLAY1548intltelinputupdatelatest4037 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.5.0.pre.alpha.20241007playbookwebsiteaddrdbms4036 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.5.0.pre.alpha.PBNTR606multilevelselectreset4035 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.5.0.pre.alpha.PLAY1548intltelinputupdatelatest4032 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.5.0.pre.alpha.PLAY1548intltelinputupdatelatest4028 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.6.0.pre.rc.12 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.6.0.pre.rc.11 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.6.0.pre.rc.10 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.6.0.pre.rc.9 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.6.0.pre.rc.8 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.6.0.pre.rc.7 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.6.0.pre.rc.6 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.6.0.pre.rc.5 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.5.0.pre.alpha.PLAY1510railsformloading3977 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.5.0.pre.alpha.PLAY1510railsformloading3976 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.5.0.pre.alpha.PLAY1510railsformloading3975 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.6.0.pre.rc.4 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.6.0.pre.rc.3 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.6.0.pre.rc.2 app/pb_kits/playbook/pb_map/_map_controls.tsx
playbook_ui-14.5.0.pre.alpha.PLAY1486highchartscssdrivenPOC3954 app/pb_kits/playbook/pb_map/_map_controls.tsx