about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-03-20 15:42:39 +0000
committerSamuel Newman <mozzius@protonmail.com>2024-03-20 15:42:39 +0000
commit4c60d4d07014c4970dfdb7f6272ab2abadf035b9 (patch)
treee30e693ca42b7eb0e2a4c36a70987985cfa15c94 /src
parent09e9769eeaa89e09e3b63c48533abc46f193cbfd (diff)
downloadvoidsky-4c60d4d07014c4970dfdb7f6272ab2abadf035b9.tar.zst
remove unnecessary group component
Diffstat (limited to 'src')
-rw-r--r--src/screens/Login/ChooseAccountForm.tsx50
1 files changed, 17 insertions, 33 deletions
diff --git a/src/screens/Login/ChooseAccountForm.tsx b/src/screens/Login/ChooseAccountForm.tsx
index 6e32d472e..600a640ca 100644
--- a/src/screens/Login/ChooseAccountForm.tsx
+++ b/src/screens/Login/ChooseAccountForm.tsx
@@ -2,7 +2,6 @@ import React from 'react'
 import {View} from 'react-native'
 import {Trans, msg} from '@lingui/macro'
 import {useLingui} from '@lingui/react'
-import flattenReactChildren from 'react-keyed-flatten-children'
 
 import {useAnalytics} from 'lib/analytics/analytics'
 import {UserAvatar} from '../../view/com/util/UserAvatar'
@@ -20,30 +19,6 @@ import * as TextField from '#/components/forms/TextField'
 import {FormContainer} from './FormContainer'
 import {logEvent} from '#/lib/statsig/statsig'
 
-function Group({children}: {children: React.ReactNode}) {
-  const t = useTheme()
-  return (
-    <View
-      style={[
-        a.rounded_md,
-        a.overflow_hidden,
-        a.border,
-        t.atoms.border_contrast_low,
-      ]}>
-      {flattenReactChildren(children).map((child, i) => {
-        return React.isValidElement(child) ? (
-          <React.Fragment key={i}>
-            {i > 0 ? (
-              <View style={[a.border_b, t.atoms.border_contrast_low]} />
-            ) : null}
-            {child}
-          </React.Fragment>
-        ) : null
-      })}
-    </View>
-  )
-}
-
 function AccountItem({
   account,
   onSelect,
@@ -150,14 +125,23 @@ export const ChooseAccountForm = ({
         <TextField.Label>
           <Trans>Sign in as...</Trans>
         </TextField.Label>
-        <Group>
+        <View
+          style={[
+            a.rounded_md,
+            a.overflow_hidden,
+            a.border,
+            t.atoms.border_contrast_low,
+          ]}>
           {accounts.map(account => (
-            <AccountItem
-              key={account.did}
-              account={account}
-              onSelect={onSelect}
-              isCurrentAccount={account.did === currentAccount?.did}
-            />
+            <>
+              <AccountItem
+                key={account.did}
+                account={account}
+                onSelect={onSelect}
+                isCurrentAccount={account.did === currentAccount?.did}
+              />
+              <View style={[a.border_b, t.atoms.border_contrast_low]} />
+            </>
           ))}
           <Button
             testID="chooseNewAccountBtn"
@@ -188,7 +172,7 @@ export const ChooseAccountForm = ({
               </View>
             )}
           </Button>
-        </Group>
+        </View>
       </View>
       <View style={[a.flex_row]}>
         <Button