about summary refs log tree commit diff
path: root/src/view/com/auth/create/StepHeader.tsx
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2024-01-18 20:48:51 -0800
committerGitHub <noreply@github.com>2024-01-18 20:48:51 -0800
commit95f70a9a6aec3a4c1b23f837a26bc5c0d4266554 (patch)
treeab196297e879dd38bfe5bb0d73f712739cda36d1 /src/view/com/auth/create/StepHeader.tsx
parent89f4105082dde925f0c69ca86629cbe6ce3c3d7d (diff)
downloadvoidsky-95f70a9a6aec3a4c1b23f837a26bc5c0d4266554.tar.zst
Phone number verification in account creation (#2564)
* Add optional sms verification

* Add support link to account creation

* Add e2e tests

* Bump api@0.9.0

* Update lockfile

* Bump api@0.9.1

* Include the phone number in the ui

* Add phone number validation and normalization
Diffstat (limited to 'src/view/com/auth/create/StepHeader.tsx')
-rw-r--r--src/view/com/auth/create/StepHeader.tsx37
1 files changed, 26 insertions, 11 deletions
diff --git a/src/view/com/auth/create/StepHeader.tsx b/src/view/com/auth/create/StepHeader.tsx
index 41f912051..af6bf5478 100644
--- a/src/view/com/auth/create/StepHeader.tsx
+++ b/src/view/com/auth/create/StepHeader.tsx
@@ -3,27 +3,42 @@ import {StyleSheet, View} from 'react-native'
 import {Text} from 'view/com/util/text/Text'
 import {usePalette} from 'lib/hooks/usePalette'
 import {Trans} from '@lingui/macro'
+import {CreateAccountState} from './state'
 
-export function StepHeader({step, title}: {step: string; title: string}) {
+export function StepHeader({
+  uiState,
+  title,
+  children,
+}: React.PropsWithChildren<{uiState: CreateAccountState; title: string}>) {
   const pal = usePalette('default')
+  const numSteps = uiState.isPhoneVerificationRequired ? 3 : 2
   return (
     <View style={styles.container}>
-      <Text type="lg" style={[pal.textLight]}>
-        {step === '3' ? (
-          <Trans>Last step!</Trans>
-        ) : (
-          <Trans>Step {step} of 3</Trans>
-        )}
-      </Text>
-      <Text style={[pal.text]} type="title-xl">
-        {title}
-      </Text>
+      <View>
+        <Text type="lg" style={[pal.textLight]}>
+          {uiState.step === 3 ? (
+            <Trans>Last step!</Trans>
+          ) : (
+            <Trans>
+              Step {uiState.step} of {numSteps}
+            </Trans>
+          )}
+        </Text>
+
+        <Text style={[pal.text]} type="title-xl">
+          {title}
+        </Text>
+      </View>
+      {children}
     </View>
   )
 }
 
 const styles = StyleSheet.create({
   container: {
+    flexDirection: 'row',
+    justifyContent: 'space-between',
+    alignItems: 'center',
     marginBottom: 20,
   },
 })