From 4e6b6740f7365553121eae42b347cfb557a6d5d5 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Thu, 5 Sep 2024 16:07:06 +0100 Subject: [PATCH] [Video] Enter/exit animations for video in composer (#5164) * enter/exit animations for video in composer * use zoom out animation * unify margin between different steps * skip animation when posting --- src/view/com/composer/Composer.tsx | 58 +++++++++++-------- .../com/composer/videos/SubtitleDialog.tsx | 2 +- .../videos/VideoTranscodeProgress.tsx | 1 - 3 files changed, 35 insertions(+), 26 deletions(-) diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index 6a6ac726..3ca709a1 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -24,11 +24,14 @@ import Animated, { FadeIn, FadeOut, interpolateColor, + LayoutAnimationConfig, useAnimatedStyle, useDerivedValue, useSharedValue, withRepeat, withTiming, + ZoomIn, + ZoomOut, } from 'react-native-reanimated' import {useSafeAreaInsets} from 'react-native-safe-area-context' import { @@ -84,7 +87,7 @@ import {GalleryModel} from 'state/models/media/gallery' import {State as VideoUploadState} from 'state/queries/video/video' import {ComposerOpts} from 'state/shell/composer' import {ComposerReplyTo} from 'view/com/composer/ComposerReplyTo' -import {atoms as a, useTheme} from '#/alf' +import {atoms as a, native, useTheme} from '#/alf' import {Button, ButtonIcon, ButtonText} from '#/components/Button' import {CircleInfo_Stroke2_Corner0_Rounded as CircleInfo} from '#/components/icons/CircleInfo' import {EmojiArc_Stroke2_Corner0_Rounded as EmojiSmile} from '#/components/icons/Emoji' @@ -766,29 +769,36 @@ export const ComposePost = observer(function ComposePost({ )} ) : null} - {videoUploadState.asset && - (videoUploadState.status === 'compressing' ? ( - - ) : videoUploadState.video ? ( - - ) : null)} - {(videoUploadState.asset || videoUploadState.video) && ( - - )} + + {(videoUploadState.asset || videoUploadState.video) && ( + + {videoUploadState.asset && + (videoUploadState.status === 'compressing' ? ( + + ) : videoUploadState.video ? ( + + ) : null)} + + + )} + diff --git a/src/view/com/composer/videos/SubtitleDialog.tsx b/src/view/com/composer/videos/SubtitleDialog.tsx index 9cd8eae4..a1cdb906 100644 --- a/src/view/com/composer/videos/SubtitleDialog.tsx +++ b/src/view/com/composer/videos/SubtitleDialog.tsx @@ -34,7 +34,7 @@ export function SubtitleDialogBtn(props: Props) { const {_} = useLingui() return ( - +