about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-10-05 15:55:31 -0700
committerGitHub <noreply@github.com>2023-10-05 15:55:31 -0700
commit0168aada372d6a42f8ee4557f6d6dcfa1a81ed71 (patch)
tree384ccd78ba8ec37e304df4c636427693525d29a2 /src
parent4ec5fabdd1c1b70fd8a3f5671c056bba3d38e174 (diff)
downloadvoidsky-0168aada372d6a42f8ee4557f6d6dcfa1a81ed71.tar.zst
Pull upstream bugfixes to bottom-sheet (#1606)
* Bump bottom-sheet to latest for bugfixes

* Small tweak to the account switcher
Diffstat (limited to 'src')
-rw-r--r--src/view/com/modals/SwitchAccount.tsx113
1 files changed, 54 insertions, 59 deletions
diff --git a/src/view/com/modals/SwitchAccount.tsx b/src/view/com/modals/SwitchAccount.tsx
index 51d75e3ef..d5fa32692 100644
--- a/src/view/com/modals/SwitchAccount.tsx
+++ b/src/view/com/modals/SwitchAccount.tsx
@@ -37,74 +37,69 @@ export function Component({}: {}) {
   }, [track, store])
 
   return (
-    <View style={[styles.container, pal.view]}>
+    <BottomSheetScrollView
+      style={[styles.container, pal.view]}
+      contentContainerStyle={[styles.innerContainer, pal.view]}>
       <Text type="title-xl" style={[styles.title, pal.text]}>
         Switch Account
       </Text>
-      <BottomSheetScrollView
-        style={styles.container}
-        contentContainerStyle={[styles.innerContainer, pal.view]}>
-        {isSwitching ? (
+      {isSwitching ? (
+        <View style={[pal.view, styles.linkCard]}>
+          <ActivityIndicator />
+        </View>
+      ) : (
+        <Link href={makeProfileLink(store.me)} title="Your profile" noFeedback>
           <View style={[pal.view, styles.linkCard]}>
-            <ActivityIndicator />
-          </View>
-        ) : (
-          <Link
-            href={makeProfileLink(store.me)}
-            title="Your profile"
-            noFeedback>
-            <View style={[pal.view, styles.linkCard]}>
-              <View style={styles.avi}>
-                <UserAvatar size={40} avatar={store.me.avatar} />
-              </View>
-              <View style={[s.flex1]}>
-                <Text type="md-bold" style={pal.text} numberOfLines={1}>
-                  {store.me.displayName || store.me.handle}
-                </Text>
-                <Text type="sm" style={pal.textLight} numberOfLines={1}>
-                  {store.me.handle}
-                </Text>
-              </View>
-              <TouchableOpacity
-                testID="signOutBtn"
-                onPress={isSwitching ? undefined : onPressSignout}
-                accessibilityRole="button"
-                accessibilityLabel="Sign out"
-                accessibilityHint={`Signs ${store.me.displayName} out of Bluesky`}>
-                <Text type="lg" style={pal.link}>
-                  Sign out
-                </Text>
-              </TouchableOpacity>
-            </View>
-          </Link>
-        )}
-        {store.session.switchableAccounts.map(account => (
-          <TouchableOpacity
-            testID={`switchToAccountBtn-${account.handle}`}
-            key={account.did}
-            style={[pal.view, styles.linkCard, isSwitching && styles.dimmed]}
-            onPress={
-              isSwitching ? undefined : () => onPressSwitchAccount(account)
-            }
-            accessibilityRole="button"
-            accessibilityLabel={`Switch to ${account.handle}`}
-            accessibilityHint="Switches the account you are logged in to">
             <View style={styles.avi}>
-              <UserAvatar size={40} avatar={account.aviUrl} />
+              <UserAvatar size={40} avatar={store.me.avatar} />
             </View>
             <View style={[s.flex1]}>
-              <Text type="md-bold" style={pal.text}>
-                {account.displayName || account.handle}
+              <Text type="md-bold" style={pal.text} numberOfLines={1}>
+                {store.me.displayName || store.me.handle}
               </Text>
-              <Text type="sm" style={pal.textLight}>
-                {account.handle}
+              <Text type="sm" style={pal.textLight} numberOfLines={1}>
+                {store.me.handle}
               </Text>
             </View>
-            <AccountDropdownBtn handle={account.handle} />
-          </TouchableOpacity>
-        ))}
-      </BottomSheetScrollView>
-    </View>
+            <TouchableOpacity
+              testID="signOutBtn"
+              onPress={isSwitching ? undefined : onPressSignout}
+              accessibilityRole="button"
+              accessibilityLabel="Sign out"
+              accessibilityHint={`Signs ${store.me.displayName} out of Bluesky`}>
+              <Text type="lg" style={pal.link}>
+                Sign out
+              </Text>
+            </TouchableOpacity>
+          </View>
+        </Link>
+      )}
+      {store.session.switchableAccounts.map(account => (
+        <TouchableOpacity
+          testID={`switchToAccountBtn-${account.handle}`}
+          key={account.did}
+          style={[pal.view, styles.linkCard, isSwitching && styles.dimmed]}
+          onPress={
+            isSwitching ? undefined : () => onPressSwitchAccount(account)
+          }
+          accessibilityRole="button"
+          accessibilityLabel={`Switch to ${account.handle}`}
+          accessibilityHint="Switches the account you are logged in to">
+          <View style={styles.avi}>
+            <UserAvatar size={40} avatar={account.aviUrl} />
+          </View>
+          <View style={[s.flex1]}>
+            <Text type="md-bold" style={pal.text}>
+              {account.displayName || account.handle}
+            </Text>
+            <Text type="sm" style={pal.textLight}>
+              {account.handle}
+            </Text>
+          </View>
+          <AccountDropdownBtn handle={account.handle} />
+        </TouchableOpacity>
+      ))}
+    </BottomSheetScrollView>
   )
 }
 
@@ -113,7 +108,7 @@ const styles = StyleSheet.create({
     flex: 1,
   },
   innerContainer: {
-    paddingBottom: 20,
+    paddingBottom: 40,
   },
   title: {
     textAlign: 'center',