Skip to content

Commit

Permalink
orb(ignite-cli): Add support for custom headers in AutoImage (#2767 by
Browse files Browse the repository at this point in the history
…@LeXuanKhanh)

* Add support custom headers for AutoImage

* fix format code

* Add document for new header props in AutoImage

* minor fix on AutoImage document

---------

Co-authored-by: Khanh Le Xuan <[email protected]>
Co-authored-by: Frank Calise <[email protected]> (9d6eae7fc2e637249325c9bc6044ad8e19b5ae94)
  • Loading branch information
infinitered-circleci and khanhlexuan1997 committed Dec 7, 2024
1 parent 96fda72 commit 2659e81
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion docs/ignite-cli/boilerplate/app/components/AutoImage.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const { width, height } = useAutoImage(uri, maxWidth, maxHeight)

## Props

Ignite's `AutoImage` component has two props of its own: `maxWidth` and `maxHeight`.
Ignite's `AutoImage` component has these props of its own:

### `maxWidth` and `maxHeight`

Expand All @@ -37,6 +37,19 @@ These props are used to constrain the image to a specific size. Use `maxWidth` o
/>
```

### `headers`

This props let you use the image with additional headers

```tsx
<AutoImage
source={{ uri: "https://pbs.twimg.com/profile_images/845384502067159040/pqF2RQ2q_400x400.jpg" }}
headers: {
Authorization: `Bearer abc123`,
}
/>
```

## Default Image props

As `AutoImage` is a wrapper around React Native's `Image` component, it also accepts all of the props that `Image` accepts. See the [React Native Image documentation](https://reactnative.dev/docs/image) for more information.
Expand Down

0 comments on commit 2659e81

Please sign in to comment.