diff options
author | hailey <me@haileyok.com> | 2025-05-06 10:54:08 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-06 10:54:08 -0700 |
commit | 521ec8e044e58633530e1864e7abc6e22554d7d3 (patch) | |
tree | e57139a4cfcb9f8859f5e1af008740fc3e8306e3 /src/view/com/util/UserAvatar.tsx | |
parent | 973538d246a3f76550611e438152f1a6cad75f49 (diff) | |
download | voidsky-521ec8e044e58633530e1864e7abc6e22554d7d3.tar.zst |
swap out cropper library (#8327)
* mostly implement * type errors * unused import * rm comment * stop accidentally deleting the image while compressing * upgrade * type fixes * upgrade, remove timeout * bump * rm mock * bump --------- Co-authored-by: Samuel Newman <mozzius@protonmail.com>
Diffstat (limited to 'src/view/com/util/UserAvatar.tsx')
-rw-r--r-- | src/view/com/util/UserAvatar.tsx | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/src/view/com/util/UserAvatar.tsx b/src/view/com/util/UserAvatar.tsx index 20fc1c65d..2450c111b 100644 --- a/src/view/com/util/UserAvatar.tsx +++ b/src/view/com/util/UserAvatar.tsx @@ -2,14 +2,13 @@ import React, {memo, useMemo} from 'react' import { Image, Pressable, - StyleProp, + type StyleProp, StyleSheet, View, - ViewStyle, + type ViewStyle, } from 'react-native' -import {Image as RNImage} from 'react-native-image-crop-picker' import Svg, {Circle, Path, Rect} from 'react-native-svg' -import {ModerationUI} from '@atproto/api' +import {type ModerationUI} from '@atproto/api' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' @@ -38,8 +37,13 @@ import {Link} from '#/components/Link' import {MediaInsetBorder} from '#/components/MediaInsetBorder' import * as Menu from '#/components/Menu' import {ProfileHoverCard} from '#/components/ProfileHoverCard' -import * as bsky from '#/types/bsky' -import {openCamera, openCropper, openPicker} from '../../../lib/media/picker' +import type * as bsky from '#/types/bsky' +import { + openCamera, + openCropper, + openPicker, + type RNImage, +} from '../../../lib/media/picker' export type UserAvatarType = 'user' | 'algo' | 'list' | 'labeler' @@ -312,9 +316,7 @@ let EditableUserAvatar = ({ onSelectNewAvatar( await openCamera({ - width: 1000, - height: 1000, - cropperCircleOverlay: true, + aspect: [1, 1], }), ) }, [onSelectNewAvatar, requestCameraAccessIfNeeded]) @@ -336,15 +338,10 @@ let EditableUserAvatar = ({ try { const croppedImage = await openCropper({ - mediaType: 'photo', - cropperCircleOverlay: true, - height: 1000, - width: 1000, - path: item.path, - webAspectRatio: 1, - webCircularCrop: true, + imageUri: item.path, + shape: 'circle', + aspectRatio: 1, }) - onSelectNewAvatar(croppedImage) } catch (e: any) { // Don't log errors for cancelling selection to sentry on ios or android |