From 9e761fee61abf5797bf669e09ebb8826262321f3 Mon Sep 17 00:00:00 2001 From: tarikpnr Date: Sat, 28 Oct 2023 23:01:55 +0300 Subject: [PATCH 1/6] Remove cropped area in Edit profile screen iOS --- src/view/com/modals/EditProfile.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/view/com/modals/EditProfile.tsx b/src/view/com/modals/EditProfile.tsx index 58d0857ad1..79ffa252aa 100644 --- a/src/view/com/modals/EditProfile.tsx +++ b/src/view/com/modals/EditProfile.tsx @@ -144,7 +144,7 @@ export function Component({ ]) return ( - + Edit my profile From 23f0d44bbe8b7eb61092d28f4b325527334dbcbd Mon Sep 17 00:00:00 2001 From: tarikpnr Date: Sat, 28 Oct 2023 23:55:34 +0300 Subject: [PATCH 2/6] Hide cancel button when saving changes in EditProfile --- src/view/com/modals/EditProfile.tsx | 31 ++++++++++++++++++----------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/view/com/modals/EditProfile.tsx b/src/view/com/modals/EditProfile.tsx index 79ffa252aa..3a92f065ba 100644 --- a/src/view/com/modals/EditProfile.tsx +++ b/src/view/com/modals/EditProfile.tsx @@ -25,6 +25,10 @@ import {usePalette} from 'lib/hooks/usePalette' import {useTheme} from 'lib/ThemeContext' import {useAnalytics} from 'lib/analytics/analytics' import {cleanError, isNetworkError} from 'lib/strings/errors' +import Animated, {FadeOut} from 'react-native-reanimated' + +const AnimatedTouchableOpacity = + Animated.createAnimatedComponent(TouchableOpacity) export const snapPoints = ['fullscreen'] @@ -219,18 +223,21 @@ export function Component({ )} - - - Cancel - - + {!isProcessing && ( + + + Cancel + + + )} From 1fb774baf2989399bb4d5c84c570b7c1ccae8c90 Mon Sep 17 00:00:00 2001 From: tarikpnr Date: Sun, 29 Oct 2023 00:00:07 +0300 Subject: [PATCH 3/6] Disable fadeOut animation cancel button for web in EditProfile screen Since react-native-reanimated is not configured for web support (https://docs.swmansion.com/react-native-reanimated/docs/2.x/fundamentals/web-support/), we are enabling fade out animation for iOS and android solely --- src/view/com/modals/EditProfile.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/view/com/modals/EditProfile.tsx b/src/view/com/modals/EditProfile.tsx index 3a92f065ba..dfd5305f5e 100644 --- a/src/view/com/modals/EditProfile.tsx +++ b/src/view/com/modals/EditProfile.tsx @@ -26,6 +26,7 @@ import {useTheme} from 'lib/ThemeContext' import {useAnalytics} from 'lib/analytics/analytics' import {cleanError, isNetworkError} from 'lib/strings/errors' import Animated, {FadeOut} from 'react-native-reanimated' +import {isWeb} from 'platform/detection' const AnimatedTouchableOpacity = Animated.createAnimatedComponent(TouchableOpacity) @@ -225,7 +226,7 @@ export function Component({ )} {!isProcessing && ( Date: Wed, 8 Nov 2023 02:07:44 +0300 Subject: [PATCH 4/6] Move FollowButton component to profile header - Button component with optional start/end icon elements - Suggested follows icon's dark mode color adjusted in ProfileHeader --- src/view/com/profile/FollowButton.tsx | 31 ++++++++++---- src/view/com/profile/ProfileHeader.tsx | 57 +++++++++----------------- src/view/com/util/forms/Button.tsx | 27 +++++++++--- 3 files changed, 66 insertions(+), 49 deletions(-) diff --git a/src/view/com/profile/FollowButton.tsx b/src/view/com/profile/FollowButton.tsx index adb496f6d7..569ab9612c 100644 --- a/src/view/com/profile/FollowButton.tsx +++ b/src/view/com/profile/FollowButton.tsx @@ -6,6 +6,17 @@ import {Button, ButtonType} from '../util/forms/Button' import * as Toast from '../util/Toast' import {FollowState} from 'state/models/cache/my-follows' import {useFollowProfile} from 'lib/hooks/useFollowProfile' +import {s} from '#/lib/styles' +import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' +import {usePalette} from '#/lib/hooks/usePalette' + +type Props = { + unfollowedType?: ButtonType + followedType?: ButtonType + profile: AppBskyActorDefs.ProfileViewBasic + onToggleFollow?: (v: boolean) => void + labelStyle?: StyleProp +} & React.ComponentProps export const FollowButton = observer(function FollowButtonImpl({ unfollowedType = 'inverted', @@ -13,13 +24,11 @@ export const FollowButton = observer(function FollowButtonImpl({ profile, onToggleFollow, labelStyle, -}: { - unfollowedType?: ButtonType - followedType?: ButtonType - profile: AppBskyActorDefs.ProfileViewBasic - onToggleFollow?: (v: boolean) => void - labelStyle?: StyleProp -}) { + ...rest +}: Props) { + const pal = usePalette('default') + const palInverted = usePalette('inverted') + const {state, following, toggle} = useFollowProfile(profile) const onPress = React.useCallback(async () => { @@ -37,11 +46,19 @@ export const FollowButton = observer(function FollowButtonImpl({ return (