From 43b0b1e523659cac2907b66d38bd24ca7d66ce56 Mon Sep 17 00:00:00 2001 From: Maciej Pyrc Date: Sat, 9 Mar 2024 17:42:26 +0100 Subject: [PATCH] =?UTF-8?q?style:=20=F0=9F=92=84=20Readme=20update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 144 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 88 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index 0d1bfdd..69faafd 100644 --- a/README.md +++ b/README.md @@ -36,14 +36,27 @@

-Do you like this library? Try out other projects -**[⚡Hyper Fetch](https://github.com/BetterTyped/hyper-fetch)** - #### Sources - [Demo](https://BetterTyped.github.io/react-zoom-pan-pinch/?path=/story/examples-big-image--big-image) - [Docs](https://BetterTyped.github.io/react-zoom-pan-pinch/?path=/story/docs-props--page) +

+ + + Premium sponsor banner + + +

+ +

+ + + Premium sponsor banner + + +

+ ## Key Features - 🚀 Fast and easy to use @@ -58,6 +71,22 @@ Do you like this library? Try out other projects - [Become a Sponsor on GitHub](https://github.com/sponsors/prc5) +

+ + + Premium sponsor banner + + +

+ +

+ + + Premium sponsor banner + + +

+ --- ## Installation @@ -91,7 +120,23 @@ or ```jsx import React, { Component } from "react"; -import { TransformWrapper, TransformComponent } from "react-zoom-pan-pinch"; +import { + TransformWrapper, + TransformComponent, + useControls, +} from "react-zoom-pan-pinch"; + +const Controls = () => { + const { zoomIn, zoomOut, resetTransform } = useControls(); + + return ( +
+ + + +
+ ); +}; const Example = () => { return ( @@ -101,72 +146,59 @@ const Example = () => { initialPositionY={100} > {({ zoomIn, zoomOut, resetTransform, ...rest }) => ( - -
- - - -
+ <> + test
Example text
-
+ )} ); }; ``` -or +

+ + + Premium sponsor banner + + +

-```tsx -import React, { useRef } from "react"; -import { - TransformWrapper, - TransformComponent, - ReactZoomPanPinchRef, -} from "react-zoom-pan-pinch"; +

+ + + Premium sponsor banner + + +

-const Controls = ({ zoomIn, zoomOut, resetTransform }) => ( - <> - - - - -); +

+ + My Sponsors + +

-const Component = () => { - const transformComponentRef = useRef(null); +## License - const zoomToImage = () => { - if (transformComponentRef.current) { - const { zoomToElement } = transformComponentRef.current; - zoomToElement("imgExample"); - } - }; +MIT © [prc5](https://github.com/prc5) - return ( - - {(utils) => ( - - - - test -
Example text
-
-
- )} -
- ); -}; -``` +## Try other BetterTyped projects -## License +Do you like this library? Try out other projects +**[⚡Hyper Fetch](https://github.com/BetterTyped/hyper-fetch)** - Fetching and +realtime data exchange framework. -MIT © [prc5](https://github.com/prc5) + + Hyper Fetch + + +## 💖 Our sponsors + +

+ + My Sponsors + +