about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-03-19 22:06:59 +0000
committerSamuel Newman <mozzius@protonmail.com>2024-03-19 22:06:59 +0000
commit49cd7e4bcf599c17c3e466cc9f483ec063e926c1 (patch)
treec9731c536d22023d0e1d0de1540eba64ef9e252c /src
parent1f02ed5d871a4b6675f3c344a4cae2aea26896b3 (diff)
downloadvoidsky-49cd7e4bcf599c17c3e466cc9f483ec063e926c1.tar.zst
add pressed state and rm cloneElement
Diffstat (limited to 'src')
-rw-r--r--src/screens/Login/ChooseAccountForm.tsx16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/screens/Login/ChooseAccountForm.tsx b/src/screens/Login/ChooseAccountForm.tsx
index 4fcca5f52..dd807ba3a 100644
--- a/src/screens/Login/ChooseAccountForm.tsx
+++ b/src/screens/Login/ChooseAccountForm.tsx
@@ -35,13 +35,7 @@ function Group({children}: {children: React.ReactNode}) {
             {i > 0 ? (
               <View style={[a.border_b, t.atoms.border_contrast_low]} />
             ) : null}
-            {React.cloneElement(child, {
-              // @ts-ignore
-              style: {
-                borderRadius: 0,
-                borderWidth: 0,
-              },
-            })}
+            {child}
           </React.Fragment>
         ) : null
       })}
@@ -77,14 +71,14 @@ function AccountItem({
           ? _(msg`Continue as ${account.handle} (currently signed in)`)
           : _(msg`Sign in as ${account.handle}`)
       }>
-      {({hovered}) => (
+      {({hovered, pressed}) => (
         <View
           style={[
             a.flex_1,
             a.flex_row,
             a.align_center,
             {height: 48},
-            hovered && t.atoms.bg_contrast_25,
+            (hovered || pressed) && t.atoms.bg_contrast_25,
           ]}>
           <View style={a.p_md}>
             <UserAvatar avatar={profile?.avatar} size={24} />
@@ -165,7 +159,7 @@ export const ChooseAccountForm = ({
             style={[a.flex_1]}
             onPress={() => onSelectAccount(undefined)}
             label={_(msg`Login to account that is not listed`)}>
-            {({hovered}) => (
+            {({hovered, pressed}) => (
               <View
                 style={[
                   a.flex_1,
@@ -173,7 +167,7 @@ export const ChooseAccountForm = ({
                   a.flex_row,
                   a.align_center,
                   {height: 48},
-                  hovered && t.atoms.bg_contrast_25,
+                  (hovered || pressed) && t.atoms.bg_contrast_25,
                 ]}>
                 <Text
                   style={[