diff --git a/app.config.js b/app.config.js index fd754a50f7..39bcbcfa74 100644 --- a/app.config.js +++ b/app.config.js @@ -234,7 +234,6 @@ module.exports = function (config) { compileSdkVersion: 34, targetSdkVersion: 34, buildToolsVersion: '34.0.0', - kotlinVersion: '1.8.0', newArchEnabled: false, }, }, diff --git a/package.json b/package.json index 0d429d75b4..de5633baab 100644 --- a/package.json +++ b/package.json @@ -180,7 +180,7 @@ "react-native-pager-view": "6.6.0", "react-native-picker-select": "^9.3.1", "react-native-progress": "bluesky-social/react-native-progress", - "react-native-qrcode-styled": "^0.3.2", + "react-native-qrcode-styled": "^0.3.3", "react-native-reanimated": "^3.16.3", "react-native-root-siblings": "^4.1.1", "react-native-safe-area-context": "4.14.0", diff --git a/src/alf/atoms.ts b/src/alf/atoms.ts index 1f08eb7e1b..e7a1810142 100644 --- a/src/alf/atoms.ts +++ b/src/alf/atoms.ts @@ -64,6 +64,7 @@ export const atoms = { * Used for the outermost components on screens, to ensure that they can fill * the screen and extend beyond. */ + // @ts-ignore - web only minHeight string util_screen_outer: [ web({ minHeight: '100vh', diff --git a/src/components/Button.tsx b/src/components/Button.tsx index 3329dca050..871c17ed51 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -405,37 +405,47 @@ export const Button = React.forwardRef( } }, [t, variant, color, size, shape, disabled]) - const {gradientColors, gradientHoverColors, gradientLocations} = - React.useMemo(() => { - const colors: string[] = [] - const hoverColors: string[] = [] - const locations: number[] = [] - const gradient = { - primary: tokens.gradients.sky, - secondary: tokens.gradients.sky, - secondary_inverted: tokens.gradients.sky, - negative: tokens.gradients.sky, - gradient_primary: tokens.gradients.primary, - gradient_sky: tokens.gradients.sky, - gradient_midnight: tokens.gradients.midnight, - gradient_sunrise: tokens.gradients.sunrise, - gradient_sunset: tokens.gradients.sunset, - gradient_nordic: tokens.gradients.nordic, - gradient_bonfire: tokens.gradients.bonfire, - }[color || 'primary'] + const gradientValues = React.useMemo(() => { + const gradient = { + primary: tokens.gradients.sky, + secondary: tokens.gradients.sky, + secondary_inverted: tokens.gradients.sky, + negative: tokens.gradients.sky, + gradient_primary: tokens.gradients.primary, + gradient_sky: tokens.gradients.sky, + gradient_midnight: tokens.gradients.midnight, + gradient_sunrise: tokens.gradients.sunrise, + gradient_sunset: tokens.gradients.sunset, + gradient_nordic: tokens.gradients.nordic, + gradient_bonfire: tokens.gradients.bonfire, + }[color || 'primary'] - if (variant === 'gradient') { - colors.push(...gradient.values.map(([_, color]) => color)) - hoverColors.push(...gradient.values.map(_ => gradient.hover_value)) - locations.push(...gradient.values.map(([location, _]) => location)) + if (variant === 'gradient') { + if (gradient.values.length < 2) { + throw new Error( + 'Gradient buttons must have at least two colors in the gradient', + ) } return { - gradientColors: colors, - gradientHoverColors: hoverColors, - gradientLocations: locations, + colors: gradient.values.map(([_, color]) => color) as [ + string, + string, + ...string[], + ], + hoverColors: gradient.values.map(_ => gradient.hover_value) as [ + string, + string, + ...string[], + ], + locations: gradient.values.map(([location, _]) => location) as [ + number, + number, + ...number[], + ], } - }, [variant, color]) + } + }, [variant, color]) const context = React.useMemo( () => ({ @@ -458,6 +468,7 @@ export const Button = React.forwardRef( // @ts-ignore - this will always be a pressable ref={ref} aria-label={label} + aria-pressed={state.pressed} accessibilityLabel={label} disabled={disabled || false} accessibilityState={{ @@ -478,7 +489,7 @@ export const Button = React.forwardRef( onHoverOut={onHoverOut} onFocus={onFocus} onBlur={onBlur}> - {variant === 'gradient' && ( + {variant === 'gradient' && gradientValues && ( ( c[1])} - locations={gradient.values.map(c => c[0])} + colors={gradient.values.map(c => c[1]) as [string, string, ...string[]]} + locations={ + gradient.values.map(c => c[0]) as [number, number, ...number[]] + } start={{x: 0, y: 0}} end={{x: 1, y: 1}} style={[a.absolute, a.inset_0]} diff --git a/src/components/LinearGradientBackground.tsx b/src/components/LinearGradientBackground.tsx index f516b19f5f..724df43f31 100644 --- a/src/components/LinearGradientBackground.tsx +++ b/src/components/LinearGradientBackground.tsx @@ -13,7 +13,11 @@ export function LinearGradientBackground({ }) { const gradient = gradients.sky.values.map(([_, color]) => { return color - }) + }) as [string, string, ...string[]] + + if (gradient.length < 2) { + throw new Error('Gradient must have at least 2 colors') + } return ( diff --git a/src/components/StarterPack/QrCode.tsx b/src/components/StarterPack/QrCode.tsx index c6408109bb..515a9059ab 100644 --- a/src/components/StarterPack/QrCode.tsx +++ b/src/components/StarterPack/QrCode.tsx @@ -1,5 +1,6 @@ import React from 'react' import {View} from 'react-native' +// @ts-expect-error missing types import QRCode from 'react-native-qrcode-styled' import type ViewShot from 'react-native-view-shot' import {AppBskyGraphDefs, AppBskyGraphStarterpack} from '@atproto/api' diff --git a/src/view/com/composer/photos/Gallery.tsx b/src/view/com/composer/photos/Gallery.tsx index af784b4f6e..bc18c81f1e 100644 --- a/src/view/com/composer/photos/Gallery.tsx +++ b/src/view/com/composer/photos/Gallery.tsx @@ -124,7 +124,7 @@ type GalleryItemProps = { image: ComposerImage altTextControlStyle?: ViewStyle imageControlsStyle?: ViewStyle - imageStyle?: ViewStyle + imageStyle?: ImageStyle onChange: (next: ComposerImage) => void onRemove: () => void } @@ -160,7 +160,7 @@ const GalleryItem = ({ return ( ) { const {_} = useLingui() - const ref1 = useRef(null) + const ref1 = useRef(null) const ref2 = useRef(null) const onPress = (e: GestureResponderEvent) => { diff --git a/yarn.lock b/yarn.lock index 88d2efad7e..4baea9fd73 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16109,7 +16109,7 @@ react-native-progress@bluesky-social/react-native-progress: dependencies: prop-types "^15.7.2" -react-native-qrcode-styled@^0.3.2: +react-native-qrcode-styled@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/react-native-qrcode-styled/-/react-native-qrcode-styled-0.3.3.tgz#552b7fb85f8e570524ad3e89b4c0b4a8a82e0b67" integrity sha512-DjxFhFAJBY3y2FEBbWSpwtPaSjsEc5RutTHejxzfRNuyTzg1f5thplGyON8yx0kbi6h0h+57s8cH4aSFGj1mQg==