Skip to content

Commit 4a4b503

Browse files
committed
expo-image added
1 parent c9d77cb commit 4a4b503

6 files changed

Lines changed: 48 additions & 18 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
"expo-device": "~6.0.2",
122122
"expo-font": "~12.0.5",
123123
"expo-haptics": "~13.0.1",
124+
"expo-image": "~1.12.12",
124125
"expo-image-picker": "~15.0.5",
125126
"expo-linear-gradient": "~13.0.2",
126127
"expo-linking": "~6.3.1",

src/components/CompanyLogo.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { darkBinarLogo, darkLogoSygnet, lightBinarLogo, lightLogoSygnet } from '@baca/constants'
22
import { ColorSchemeName, useColorScheme } from '@baca/contexts'
3-
import { Image, ImageProps, ImageStyle } from 'react-native'
3+
import { Image } from 'expo-image'
4+
import { ImageProps, ImageStyle } from 'react-native'
45

56
type LogoTypes = 'binarSygnet' | 'binar'
67

@@ -26,12 +27,5 @@ export const CompanyLogo = ({
2627

2728
const source = LOGO[colorScheme][type]
2829

29-
return (
30-
<Image
31-
{...{ source }}
32-
resizeMethod="resize"
33-
resizeMode="contain"
34-
style={[{ height, maxWidth: width }, style]}
35-
/>
36-
)
30+
return <Image contentFit="scale-down" source={source} style={[{ height, width }, style]} />
3731
}

src/components/LandingHeader.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import { useFullScreenModal } from '@baca/design-system/modals/useFullScreenModa
55
import { useCallback, useMemo, useTheme, useTranslation } from '@baca/hooks'
66
import { useUniversalWidth } from '@baca/navigation/tabNavigator/hooks'
77
import { isSignedInAtom } from '@baca/store/auth'
8+
import { Image } from 'expo-image'
89
import { useRouter } from 'expo-router'
910
import { useAtomValue } from 'jotai'
10-
import { Image, StyleSheet, Platform, View } from 'react-native'
11+
import { StyleSheet, Platform, View } from 'react-native'
1112
import { useSafeAreaInsets } from 'react-native-safe-area-context'
1213

1314
export function LandingHeader() {
@@ -36,8 +37,7 @@ export function LandingHeader() {
3637
</Pressable>
3738
) : (
3839
<Image
39-
resizeMethod="resize"
40-
resizeMode="contain"
40+
contentFit="scale-down"
4141
source={colorScheme === 'light' ? lightBinarLogo : darkBinarLogo}
4242
style={jsStyles.logoWide}
4343
/>

src/components/molecules/SocialButtons/SocialButton.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import { googleIcon } from '@baca/constants'
22
import { useColorScheme } from '@baca/contexts'
33
import { Button, ButtonProps, Icon } from '@baca/design-system'
44
import i18n from '@baca/i18n'
5+
import { Image, ImageStyle } from 'expo-image'
56
import { FC, useCallback } from 'react'
6-
import { Image, ImageSourcePropType } from 'react-native'
7+
import { ImageSourcePropType } from 'react-native'
78

89
type SocialMediaType = 'apple' | 'facebook' | 'google'
910

@@ -51,7 +52,10 @@ export const SocialButton: FC<SocialButtonProps> = ({ type = 'google', ...rest }
5152
return <Icon color="#1877F2" name="facebook-circle-fill" size={24} />
5253
case 'google':
5354
return (
54-
<Image source={source?.[colorScheme] || source?.['light']} width={24} height={24} />
55+
<Image
56+
source={source?.[colorScheme] || source?.['light']}
57+
style={{ width: 24, height: 24 } as ImageStyle}
58+
/>
5559
)
5660
}
5761
},

src/components/screens/profile/ProfileEditImage.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { Box, Text, Button, Row, themeColors } from '@baca/design-system'
2+
import { Image } from 'expo-image'
23
import * as ImagePicker from 'expo-image-picker'
34
import { t } from 'i18next'
45
import { useState, useCallback } from 'react'
5-
import { Image, StyleSheet } from 'react-native'
6+
import { StyleSheet } from 'react-native'
67

78
export const ProfileEditImage: React.FC = () => {
89
const [image, setImage] = useState<string | null>(null)

yarn.lock

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6310,6 +6310,11 @@ expo-image-picker@~15.0.5:
63106310
dependencies:
63116311
expo-image-loader "~4.7.0"
63126312

6313+
expo-image@~1.12.12:
6314+
version "1.12.12"
6315+
resolved "https://registry.yarnpkg.com/expo-image/-/expo-image-1.12.12.tgz#b6422a07da0f6dddcea154d2857f617086a527cc"
6316+
integrity sha512-zZutUhKYqcqTH12o87pGCVLsuQeRK2vaNwxa8beznbDnmWevm3dmbOTCxaOhGgjyDxwcdwDa483Q4IKCXL6tBw==
6317+
63136318
expo-json-utils@~0.13.0:
63146319
version "0.13.1"
63156320
resolved "https://registry.yarnpkg.com/expo-json-utils/-/expo-json-utils-0.13.1.tgz#e49b697198e11c573d346f08ab91c467095934a9"
@@ -12157,7 +12162,16 @@ string-length@^5.0.1:
1215712162
char-regex "^2.0.0"
1215812163
strip-ansi "^7.0.1"
1215912164

12160-
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
12165+
"string-width-cjs@npm:string-width@^4.2.0":
12166+
version "4.2.3"
12167+
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
12168+
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
12169+
dependencies:
12170+
emoji-regex "^8.0.0"
12171+
is-fullwidth-code-point "^3.0.0"
12172+
strip-ansi "^6.0.1"
12173+
12174+
string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
1216112175
version "4.2.3"
1216212176
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
1216312177
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -12235,7 +12249,7 @@ string_decoder@~1.1.1:
1223512249
dependencies:
1223612250
safe-buffer "~5.1.0"
1223712251

12238-
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
12252+
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
1223912253
version "6.0.1"
1224012254
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
1224112255
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -12249,6 +12263,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.2.0:
1224912263
dependencies:
1225012264
ansi-regex "^4.1.0"
1225112265

12266+
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
12267+
version "6.0.1"
12268+
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
12269+
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
12270+
dependencies:
12271+
ansi-regex "^5.0.1"
12272+
1225212273
strip-ansi@^7.0.1:
1225312274
version "7.1.0"
1225412275
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45"
@@ -13353,7 +13374,7 @@ word-wrap@^1.2.5:
1335313374
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34"
1335413375
integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==
1335513376

13356-
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
13377+
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
1335713378
version "7.0.0"
1335813379
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
1335913380
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
@@ -13371,6 +13392,15 @@ wrap-ansi@^6.2.0:
1337113392
string-width "^4.1.0"
1337213393
strip-ansi "^6.0.0"
1337313394

13395+
wrap-ansi@^7.0.0:
13396+
version "7.0.0"
13397+
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
13398+
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
13399+
dependencies:
13400+
ansi-styles "^4.0.0"
13401+
string-width "^4.1.0"
13402+
strip-ansi "^6.0.0"
13403+
1337413404
wrap-ansi@^8.0.1, wrap-ansi@^8.1.0:
1337513405
version "8.1.0"
1337613406
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"

0 commit comments

Comments
 (0)