DEV Community

Alain
Alain

Posted on

2 1

Zoom in Reason

ImageWithZoom Module

Pass in an image size which is passed to the uri variable. Whatever the image size it will be scaled to the width and height defined in the styles##image property.
Each time this component is called, a diffent image from https://picsum.photos/is retrieved.

let styles =
  Style.(
    StyleSheet.create({
      "image": style(~width=400.->dp, ~height=400.->dp, ()),
    })
  );

[@react.component]
let make = (~size=?) => {
  <Image
    style=styles##image
    source={Image.Source.fromUriSource(
      Image.uriSource(~uri={j|https://picsum.photos/$size/$size|j}, ()),
    )}
  />;
};

Alt Text

Resources

picsum.photos

original repo via @browniefed

See it on snack.io https://expo.io/@idkjs/zoomreason.
See the source.

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs