From ddac198ea782dbf61edeec95b1ea6b78ec46e604 Mon Sep 17 00:00:00 2001 From: Abin Toppo Date: Fri, 25 Sep 2026 16:02:02 +0530 Subject: [PATCH] Show a SIM icon beside the mobile number on the login screen Co-Authored-By: Claude Opus 5.5 --- src/modules/auth/components/SimIcon.tsx | 28 ++++++++++++++++++++++++ src/modules/auth/screens/LoginScreen.tsx | 28 +++++++++++++++--------- 2 files changed, 46 insertions(+), 10 deletions(-) create mode 100644 src/modules/auth/components/SimIcon.tsx diff --git a/src/modules/auth/components/SimIcon.tsx b/src/modules/auth/components/SimIcon.tsx new file mode 100644 index 0000000..c93ee42 --- /dev/null +++ b/src/modules/auth/components/SimIcon.tsx @@ -0,0 +1,28 @@ +import React, { memo } from 'react'; +import Svg, { Path, Rect } from 'react-native-svg'; + +/** + * A SIM card glyph, drawn in the same language as SimChooser's cards: the + * chamfered top-right corner and the contact chip. Ionicons has no SIM icon, + * and a phone or signal glyph says "device" rather than "the line your bank + * knows you by". + */ +type Props = { + size?: number; + color: string; +}; + +const SimIconComponent = ({ size = 16, color }: Props) => ( + + + + + +); + +export const SimIcon = memo(SimIconComponent); diff --git a/src/modules/auth/screens/LoginScreen.tsx b/src/modules/auth/screens/LoginScreen.tsx index 8252eae..8f4d76e 100644 --- a/src/modules/auth/screens/LoginScreen.tsx +++ b/src/modules/auth/screens/LoginScreen.tsx @@ -44,6 +44,7 @@ import { BiometricNode } from '../components/BiometricNode'; import { CodeInput } from '../components/CodeInput'; import { PreLoginActions } from '../components/PreLoginActions'; import { LoginFooter } from '../components/LoginFooter'; +import { SimIcon } from '../components/SimIcon'; import { useBiometricPrompt } from '../hooks/useBiometricPrompt'; import type { AuthStackParamList } from '../../../navigation/types'; import type { LoginRole } from '../../../types/app'; @@ -301,6 +302,15 @@ export default function LoginScreen({ navigation }: Props) { ? `+91 ••••• •${lastProfile.mobileNumber.slice(-4)}` : undefined; + const maskedMobileRow = maskedMobile ? ( + + + + {maskedMobile} + + + ) : null; + const gradient = ( <> {lastProfile.fullName} - {maskedMobile ? ( - - {maskedMobile} - - ) : null} + {maskedMobileRow} ) : ( <> @@ -392,11 +398,7 @@ export default function LoginScreen({ navigation }: Props) { no name, because it does not return one — so without this the screen asks for an MPIN and names nothing at all. */} - {maskedMobile ? ( - - {maskedMobile} - - ) : null} + {maskedMobileRow} )} @@ -418,6 +420,7 @@ export default function LoginScreen({ navigation }: Props) { {!isReturningCustomer ? ( } prefix="+91" keyboardType="number-pad" maxLength={10} @@ -588,6 +591,11 @@ const styles = StyleSheet.create({ alignItems: 'center', gap: 4, }, + mobileRow: { + flexDirection: 'row', + alignItems: 'center', + gap: 6, + }, heroBlock: { alignItems: 'center', paddingVertical: 4,