about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorHailey <me@haileyok.com>2024-09-07 13:29:27 -0700
committerGitHub <noreply@github.com>2024-09-07 13:29:27 -0700
commit9b8d62ca254863455b895cf016fe19825285ca70 (patch)
tree3f697dace2ff6220b3c25041d6668541397ae4d2 /src
parentf1877e44f2576e84dd0a6d817c60b8df0f2dd9bb (diff)
downloadvoidsky-9b8d62ca254863455b895cf016fe19825285ca70.tar.zst
[Video] Tweak order of elements in composer (#5213)
Diffstat (limited to 'src')
-rw-r--r--src/view/com/composer/Composer.tsx64
1 files changed, 32 insertions, 32 deletions
diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx
index 3c7868ad2..25ed6c769 100644
--- a/src/view/com/composer/Composer.tsx
+++ b/src/view/com/composer/Composer.tsx
@@ -200,6 +200,7 @@ export const ComposePost = observer(function ComposePost({
       }
     },
   })
+  const hasVideo = Boolean(videoUploadState.asset || videoUploadState.video)
 
   const [publishOnUpload, setPublishOnUpload] = useState(false)
 
@@ -730,8 +731,37 @@ export const ComposePost = observer(function ComposePost({
               />
             </View>
           )}
-
-          <View style={[a.mt_md]}>
+          <LayoutAnimationConfig skipExiting>
+            {hasVideo && (
+              <Animated.View
+                style={[a.w_full, a.mt_lg]}
+                entering={native(ZoomIn)}
+                exiting={native(ZoomOut)}>
+                {videoUploadState.asset &&
+                  (videoUploadState.status === 'compressing' ? (
+                    <VideoTranscodeProgress
+                      asset={videoUploadState.asset}
+                      progress={videoUploadState.progress}
+                      clear={clearVideo}
+                    />
+                  ) : videoUploadState.video ? (
+                    <VideoPreview
+                      asset={videoUploadState.asset}
+                      video={videoUploadState.video}
+                      setDimensions={updateVideoDimensions}
+                      clear={clearVideo}
+                    />
+                  ) : null)}
+                <SubtitleDialogBtn
+                  defaultAltText={videoAltText}
+                  saveAltText={setVideoAltText}
+                  captions={captions}
+                  setCaptions={setCaptions}
+                />
+              </Animated.View>
+            )}
+          </LayoutAnimationConfig>
+          <View style={!hasVideo ? [a.mt_md] : []}>
             {quote ? (
               <View style={[s.mt5, s.mb2, isWeb && s.mb10]}>
                 <View style={{pointerEvents: 'none'}}>
@@ -742,36 +772,6 @@ export const ComposePost = observer(function ComposePost({
                 )}
               </View>
             ) : null}
-            <LayoutAnimationConfig skipExiting>
-              {(videoUploadState.asset || videoUploadState.video) && (
-                <Animated.View
-                  style={[a.w_full, a.mt_xs]}
-                  entering={native(ZoomIn)}
-                  exiting={native(ZoomOut)}>
-                  {videoUploadState.asset &&
-                    (videoUploadState.status === 'compressing' ? (
-                      <VideoTranscodeProgress
-                        asset={videoUploadState.asset}
-                        progress={videoUploadState.progress}
-                        clear={clearVideo}
-                      />
-                    ) : videoUploadState.video ? (
-                      <VideoPreview
-                        asset={videoUploadState.asset}
-                        video={videoUploadState.video}
-                        setDimensions={updateVideoDimensions}
-                        clear={clearVideo}
-                      />
-                    ) : null)}
-                  <SubtitleDialogBtn
-                    defaultAltText={videoAltText}
-                    saveAltText={setVideoAltText}
-                    captions={captions}
-                    setCaptions={setCaptions}
-                  />
-                </Animated.View>
-              )}
-            </LayoutAnimationConfig>
           </View>
         </Animated.ScrollView>
         <SuggestedLanguage text={richtext.text} />