File tree Expand file tree Collapse file tree 1 file changed +6
-19
lines changed Expand file tree Collapse file tree 1 file changed +6
-19
lines changed Original file line number Diff line number Diff line change 1- import React , { useMemo } from "react" ;
2- import { FlatList , StyleSheet , Text , View } from "react-native" ;
3- import { NitroImage , useWebImage } from "react-native-nitro-image" ;
1+ import { useMemo } from "react" ;
2+ import { FlatList , Text , View } from "react-native" ;
3+ import { NitroWebImage } from "react-native-nitro-image" ;
44import { createImageURLs } from "./createImageURLs" ;
55
6- function AsyncImageImpl ( { url } : { url : string } ) : React . ReactNode {
7- const image = useWebImage ( url ) ;
8- return (
9- < NitroImage style = { styles . image } image = { image } resizeMode = "contain" />
10- ) ;
11- }
12- const AsyncImage = React . memo ( AsyncImageImpl ) ;
13-
146export function NitroImageTab ( ) {
157 const imageURLs = useMemo ( ( ) => createImageURLs ( ) , [ ] ) ;
168
@@ -21,15 +13,10 @@ export function NitroImageTab() {
2113 numColumns = { 4 }
2214 windowSize = { 3 }
2315 data = { imageURLs }
24- renderItem = { ( { item : url } ) => < AsyncImage url = { url } /> }
16+ renderItem = { ( { item : url } ) => (
17+ < NitroWebImage url = { url } resizeMode = "cover" />
18+ ) }
2519 />
2620 </ View >
2721 ) ;
2822}
29-
30- const styles = StyleSheet . create ( {
31- image : {
32- width : "25%" ,
33- aspectRatio : 1 ,
34- } ,
35- } ) ;
You can’t perform that action at this time.
0 commit comments