g-loot / react-tournament-brackets

React component library for displaying bracket leaderboards
https://sleepy-kare-d8538d.netlify.app/?path=/story/components-bracket--bracket
GNU Lesser General Public License v2.1
220 stars 69 forks source link

Feature: show react-svg-pan-zoom toolbar #22

Open hichemfantar opened 2 years ago

hichemfantar commented 2 years ago

How can I bring back the toolbar already available in react-svg-pan-zoom library?

image

Cause: svg-viewer.jsx ( customToolbar={() => <></>} ) Wouldn't it be better to make the custom Toolbar optional?

  return (
    <ReactSVGPanZoom
      detectAutoPan={false}
      ref={Viewer}
      scaleFactor={scaleFactor}
      scaleFactorMax={scaleFactorMax}
      scaleFactorMin={scaleFactorMin}
      width={Math.min(width, bracketWidth)}
      height={Math.min(height, bracketHeight)}
      tool={tool}
      onChangeTool={setTool}
      value={value}
      onChangeValue={setValue}
      onZoom={lockToBoundaries}
      onPan={lockToBoundaries}
      miniatureProps={{ position: 'right' }}
      customToolbar={() => <></>}
      {...rest}
    >
      {children}
    </ReactSVGPanZoom>
  );