about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-04-22 19:08:41 -0500
committerGitHub <noreply@github.com>2023-04-22 19:08:41 -0500
commitc7600fe0c2d0b189cb1dcf9ab4d31671f01b81c9 (patch)
tree62beacd14a8013a507a0b0227e538fd3751658ad /src
parent5085861b9ac0684d8eedb2a8d54453d3f23cde46 (diff)
downloadvoidsky-c7600fe0c2d0b189cb1dcf9ab4d31671f01b81c9.tar.zst
Web fixes (#517)
* Fix scroll behaviors on web

* Remove headers on web to avoid scroll overflow

* Fix follow button press in cards
Diffstat (limited to 'src')
-rw-r--r--src/view/com/post-thread/PostLikedBy.tsx2
-rw-r--r--src/view/com/post-thread/PostRepostedBy.tsx2
-rw-r--r--src/view/com/profile/ProfileFollowers.tsx2
-rw-r--r--src/view/com/profile/ProfileFollows.tsx2
-rw-r--r--src/view/com/util/forms/Button.tsx21
-rw-r--r--src/view/screens/PostLikedBy.tsx2
-rw-r--r--src/view/screens/PostRepostedBy.tsx2
-rw-r--r--src/view/screens/ProfileFollowers.tsx2
-rw-r--r--src/view/screens/ProfileFollows.tsx2
9 files changed, 29 insertions, 8 deletions
diff --git a/src/view/com/post-thread/PostLikedBy.tsx b/src/view/com/post-thread/PostLikedBy.tsx
index 3ab9a279b..dc090e7ad 100644
--- a/src/view/com/post-thread/PostLikedBy.tsx
+++ b/src/view/com/post-thread/PostLikedBy.tsx
@@ -78,6 +78,8 @@ export const PostLikedBy = observer(function ({uri}: {uri: string}) {
         </View>
       )}
       extraData={view.isLoading}
+      // @ts-ignore our .web version only -prf
+      desktopFixedHeight
     />
   )
 })
diff --git a/src/view/com/post-thread/PostRepostedBy.tsx b/src/view/com/post-thread/PostRepostedBy.tsx
index 9874460e9..65579ae23 100644
--- a/src/view/com/post-thread/PostRepostedBy.tsx
+++ b/src/view/com/post-thread/PostRepostedBy.tsx
@@ -89,6 +89,8 @@ export const PostRepostedBy = observer(function PostRepostedBy({
         </View>
       )}
       extraData={view.isLoading}
+      // @ts-ignore our .web version only -prf
+      desktopFixedHeight
     />
   )
 })
diff --git a/src/view/com/profile/ProfileFollowers.tsx b/src/view/com/profile/ProfileFollowers.tsx
index db592075a..cba171925 100644
--- a/src/view/com/profile/ProfileFollowers.tsx
+++ b/src/view/com/profile/ProfileFollowers.tsx
@@ -92,6 +92,8 @@ export const ProfileFollowers = observer(function ProfileFollowers({
         </View>
       )}
       extraData={view.isLoading}
+      // @ts-ignore our .web version only -prf
+      desktopFixedHeight
     />
   )
 })
diff --git a/src/view/com/profile/ProfileFollows.tsx b/src/view/com/profile/ProfileFollows.tsx
index 10da79c5e..dafba62fc 100644
--- a/src/view/com/profile/ProfileFollows.tsx
+++ b/src/view/com/profile/ProfileFollows.tsx
@@ -89,6 +89,8 @@ export const ProfileFollows = observer(function ProfileFollows({
         </View>
       )}
       extraData={view.isLoading}
+      // @ts-ignore our .web version only -prf
+      desktopFixedHeight
     />
   )
 })
diff --git a/src/view/com/util/forms/Button.tsx b/src/view/com/util/forms/Button.tsx
index a634b47a9..8548860d0 100644
--- a/src/view/com/util/forms/Button.tsx
+++ b/src/view/com/util/forms/Button.tsx
@@ -1,15 +1,20 @@
 import React from 'react'
 import {
+  GestureResponderEvent,
   StyleProp,
   StyleSheet,
   TextStyle,
-  TouchableOpacity,
+  Pressable,
   ViewStyle,
 } from 'react-native'
 import {Text} from '../text/Text'
 import {useTheme} from 'lib/ThemeContext'
 import {choose} from 'lib/functions'
 
+type Event =
+  | React.MouseEvent<HTMLAnchorElement, MouseEvent>
+  | GestureResponderEvent
+
 export type ButtonType =
   | 'primary'
   | 'secondary'
@@ -114,10 +119,18 @@ export function Button({
       },
     },
   )
+  const onPressWrapped = React.useCallback(
+    (event: Event) => {
+      event.stopPropagation()
+      event.preventDefault()
+      onPress?.()
+    },
+    [onPress],
+  )
   return (
-    <TouchableOpacity
+    <Pressable
       style={[typeOuterStyle, styles.outer, style]}
-      onPress={onPress}
+      onPress={onPressWrapped}
       testID={testID}>
       {label ? (
         <Text type="button" style={[typeLabelStyle, labelStyle]}>
@@ -126,7 +139,7 @@ export function Button({
       ) : (
         children
       )}
-    </TouchableOpacity>
+    </Pressable>
   )
 }
 
diff --git a/src/view/screens/PostLikedBy.tsx b/src/view/screens/PostLikedBy.tsx
index 2e162ef0f..fb44f1f9b 100644
--- a/src/view/screens/PostLikedBy.tsx
+++ b/src/view/screens/PostLikedBy.tsx
@@ -22,7 +22,7 @@ export const PostLikedByScreen = withAuthRequired(({route}: Props) => {
 
   return (
     <View>
-      <ViewHeader title="Liked by" showOnDesktop />
+      <ViewHeader title="Liked by" />
       <PostLikedByComponent uri={uri} />
     </View>
   )
diff --git a/src/view/screens/PostRepostedBy.tsx b/src/view/screens/PostRepostedBy.tsx
index bfd827f67..19f0af18b 100644
--- a/src/view/screens/PostRepostedBy.tsx
+++ b/src/view/screens/PostRepostedBy.tsx
@@ -22,7 +22,7 @@ export const PostRepostedByScreen = withAuthRequired(({route}: Props) => {
 
   return (
     <View>
-      <ViewHeader title="Reposted by" showOnDesktop />
+      <ViewHeader title="Reposted by" />
       <PostRepostedByComponent uri={uri} />
     </View>
   )
diff --git a/src/view/screens/ProfileFollowers.tsx b/src/view/screens/ProfileFollowers.tsx
index d782cb696..e2f95fbe4 100644
--- a/src/view/screens/ProfileFollowers.tsx
+++ b/src/view/screens/ProfileFollowers.tsx
@@ -20,7 +20,7 @@ export const ProfileFollowersScreen = withAuthRequired(({route}: Props) => {
 
   return (
     <View>
-      <ViewHeader title="Followers" showOnDesktop />
+      <ViewHeader title="Followers" />
       <ProfileFollowersComponent name={name} />
     </View>
   )
diff --git a/src/view/screens/ProfileFollows.tsx b/src/view/screens/ProfileFollows.tsx
index 9c15d1d92..f70944f55 100644
--- a/src/view/screens/ProfileFollows.tsx
+++ b/src/view/screens/ProfileFollows.tsx
@@ -20,7 +20,7 @@ export const ProfileFollowsScreen = withAuthRequired(({route}: Props) => {
 
   return (
     <View>
-      <ViewHeader title="Following" showOnDesktop />
+      <ViewHeader title="Following" />
       <ProfileFollowsComponent name={name} />
     </View>
   )