Bluesky app fork with some witchin' additions 💫

replace react-native-fast-image with expo-image (#452)

authored by

Paul Frazee and committed by
GitHub
a683c9e1 14c84732

+21 -21
+1 -1
package.json
··· 62 62 "expo-build-properties": "~0.5.1", 63 63 "expo-camera": "~13.2.1", 64 64 "expo-dev-client": "~2.1.1", 65 + "expo-image": "~1.0.0", 65 66 "expo-image-picker": "~14.1.1", 66 67 "expo-localization": "~14.1.1", 67 68 "expo-media-library": "~15.2.3", ··· 95 96 "react-native-appstate-hook": "^1.0.6", 96 97 "react-native-background-fetch": "^4.1.8", 97 98 "react-native-drawer-layout": "^3.2.0", 98 - "react-native-fast-image": "^8.6.3", 99 99 "react-native-fs": "^2.20.0", 100 100 "react-native-gesture-handler": "~2.9.0", 101 101 "react-native-get-random-values": "^1.8.0",
+1 -1
src/view/com/composer/photos/SelectedPhotos.tsx
··· 1 1 import React, {useCallback} from 'react' 2 2 import {StyleSheet, TouchableOpacity, View} from 'react-native' 3 3 import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' 4 - import Image from 'view/com/util/images/Image' 4 + import {Image} from 'expo-image' 5 5 import {colors} from 'lib/styles' 6 6 7 7 export const SelectedPhotos = ({
+1 -1
src/view/com/util/UserBanner.tsx
··· 2 2 import {StyleSheet, View} from 'react-native' 3 3 import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' 4 4 import {IconProp} from '@fortawesome/fontawesome-svg-core' 5 - import Image from 'view/com/util/images/Image' 5 + import {Image} from 'expo-image' 6 6 import {colors} from 'lib/styles' 7 7 import { 8 8 openCamera,
+2 -2
src/view/com/util/images/AutoSizedImage.tsx
··· 1 1 import React from 'react' 2 2 import { 3 - Image, 4 3 StyleProp, 5 4 StyleSheet, 6 5 TouchableOpacity, 7 6 View, 8 7 ViewStyle, 9 8 } from 'react-native' 9 + import {Image} from 'expo-image' 10 10 import {clamp} from 'lib/numbers' 11 11 import {useStores} from 'state/index' 12 12 import {Dim} from 'lib/media/manip' ··· 59 59 onPressIn={onPressIn} 60 60 delayPressIn={DELAY_PRESS_IN} 61 61 style={[styles.container, style]}> 62 - <Image style={[styles.image, {aspectRatio}]} source={{uri}} /> 62 + <Image style={[styles.image, {aspectRatio}]} source={uri} /> 63 63 {children} 64 64 </TouchableOpacity> 65 65 )
+7 -7
src/view/com/util/images/Image.tsx
··· 1 1 import React from 'react' 2 - import FastImage, {FastImageProps, Source} from 'react-native-fast-image' 3 - export default FastImage 4 - export type {OnLoadEvent, ImageStyle, Source} from 'react-native-fast-image' 2 + import {Image, ImageProps, ImageSource} from 'expo-image' 5 3 6 - export function HighPriorityImage({source, ...props}: FastImageProps) { 4 + interface HighPriorityImageProps extends ImageProps { 5 + source: ImageSource 6 + } 7 + export function HighPriorityImage({source, ...props}: HighPriorityImageProps) { 7 8 const updatedSource = { 8 9 uri: typeof source === 'object' && source ? source.uri : '', 9 - priority: FastImage.priority.high, 10 - } as Source 11 - return <FastImage source={updatedSource} {...props} /> 10 + } satisfies ImageSource 11 + return <Image source={updatedSource} {...props} /> 12 12 }
+1 -1
src/view/com/util/images/ImageHorzList.tsx
··· 6 6 View, 7 7 ViewStyle, 8 8 } from 'react-native' 9 - import Image from 'view/com/util/images/Image' 9 + import {Image} from 'expo-image' 10 10 11 11 export function ImageHorzList({ 12 12 uris,
+3 -3
src/view/com/util/images/ImageLayoutGrid.tsx
··· 7 7 View, 8 8 ViewStyle, 9 9 } from 'react-native' 10 - import Image, {ImageStyle} from 'view/com/util/images/Image' 10 + import {Image, ImageStyle} from 'expo-image' 11 11 12 12 export const DELAY_PRESS_IN = 500 13 13 ··· 73 73 onPressIn?: (index: number) => void 74 74 containerInfo: Dim 75 75 }) { 76 - const size1 = React.useMemo<StyleProp<ImageStyle>>(() => { 76 + const size1 = React.useMemo<ImageStyle>(() => { 77 77 if (type === 'three') { 78 78 const size = (containerInfo.width - 10) / 3 79 79 return {width: size, height: size, resizeMode: 'cover', borderRadius: 4} ··· 82 82 return {width: size, height: size, resizeMode: 'cover', borderRadius: 4} 83 83 } 84 84 }, [type, containerInfo]) 85 - const size2 = React.useMemo<StyleProp<ImageStyle>>(() => { 85 + const size2 = React.useMemo<ImageStyle>(() => { 86 86 if (type === 'three') { 87 87 const size = ((containerInfo.width - 10) / 3) * 2 + 5 88 88 return {width: size, height: size, resizeMode: 'cover', borderRadius: 4}
+5 -5
yarn.lock
··· 8333 8333 dependencies: 8334 8334 expo-image-loader "~4.1.0" 8335 8335 8336 + expo-image@~1.0.0: 8337 + version "1.0.0" 8338 + resolved "https://registry.yarnpkg.com/expo-image/-/expo-image-1.0.0.tgz#a3670d20815d99e2527307a33761c9b0088823b1" 8339 + integrity sha512-A1amVExKhBa/eRXuceauYtPkf9izeje5AbxEWL09tgK91rf3GSIZXM5PSDGlIM0s7dpCV+Iet2jhwcFUfWaZrw== 8340 + 8336 8341 expo-json-utils@~0.5.0: 8337 8342 version "0.5.1" 8338 8343 resolved "https://registry.yarnpkg.com/expo-json-utils/-/expo-json-utils-0.5.1.tgz#fcb01050b8aa66592eea2024a48979f2d090c6f9" ··· 14641 14646 integrity sha512-d/kvzeBhXjqcRGlfkTSB96ZRKH6g6YxJK+gPtUOCOCH5piHpsupgX+tLAHdM8r8NUzN6Tl9656xfJTuVb8Zrgw== 14642 14647 dependencies: 14643 14648 use-latest-callback "^0.1.5" 14644 - 14645 - react-native-fast-image@^8.6.3: 14646 - version "8.6.3" 14647 - resolved "https://registry.yarnpkg.com/react-native-fast-image/-/react-native-fast-image-8.6.3.tgz#6edc3f9190092a909d636d93eecbcc54a8822255" 14648 - integrity sha512-Sdw4ESidXCXOmQ9EcYguNY2swyoWmx53kym2zRsvi+VeFCHEdkO+WG1DK+6W81juot40bbfLNhkc63QnWtesNg== 14649 14649 14650 14650 react-native-fs@^2.20.0: 14651 14651 version "2.20.0"