diff --git a/assets/receive-card-icon.png b/assets/receive-card-icon.png new file mode 100644 index 00000000..b0db01a0 Binary files /dev/null and b/assets/receive-card-icon.png differ diff --git a/assets/received-cards-icon.png b/assets/received-cards-icon.png new file mode 100644 index 00000000..52afc034 Binary files /dev/null and b/assets/received-cards-icon.png differ diff --git a/components/ui/themes/DefaultTheme.ts b/components/ui/themes/DefaultTheme.ts index 31a73c79..809aaa93 100644 --- a/components/ui/themes/DefaultTheme.ts +++ b/components/ui/themes/DefaultTheme.ts @@ -46,6 +46,7 @@ export const DefaultTheme = { AddIdBtnTxt: Colors.Orange, DownloadIdBtnTxt: Colors.White, Loading: Colors.Orange, + Cursor: Colors.Orange, noUinText: Colors.Orange, IconBg: Colors.Orange, popUp: Colors.Green, @@ -196,7 +197,7 @@ export const DefaultTheme = { borderRadius: 10, margin: 5, borderWidth: 2, - borderColor: Colors.Green, + borderColor: Colors.Orange, }, labelPartContainer: { marginLeft: 16, @@ -311,6 +312,13 @@ export const DefaultTheme = { borderRadius: 10, backgroundColor: Colors.LightOrange, }, + receiveCardsContainer: { + height: Dimensions.get('window').height * 0.12, + width: Dimensions.get('window').width * 0.45, + alignItems: 'center', + padding: 15, + marginVertical: 18, + }, domainVerifiyIcon: { padding: 20, marginLeft: 120, @@ -913,6 +921,8 @@ export const DefaultTheme = { WarningLogo: require('../../../assets/warningLogo.png'), OtpLogo: require('../../../assets/otp-mobile-logo.png'), SuccessLogo: require('../../../assets/success-logo.png'), + ReceiveCardIcon: require('../../../assets/receive-card-icon.png'), + ReceivedCardsIcon: require('../../../assets/received-cards-icon.png'), DigitalIdentityLogo: require('../../../assets/digital-identity-icon.png'), InjiLogoWhite: require('../../../assets/inji-logo-white.png'), InjiProgressingLogo: require('../../../assets/progressing-logo.png'), diff --git a/locales/ara.json b/locales/ara.json index 90d9ea92..169fbcb9 100644 --- a/locales/ara.json +++ b/locales/ara.json @@ -107,6 +107,8 @@ }, "SettingScreen": { "header": "إعدادات", + "injiAsVerifierApp": " كتطبيق للتحقق إنجي", + "basicSettings": "الإعدادات الأساسية", "bioUnlock": "افتح مع القياسات الحيوية", "language": "لغة", "aboutInji": "حول إنجي", @@ -214,6 +216,8 @@ "next": "التالي" }, "ReceivedVcsTab": { + "receivedCards": "البطاقات المستلمة", + "header": "البطاقات المستلمة", "noReceivedVcsTitle": "لا يوجد {{vcLabel}} متاح حتى الآن", "noReceivedVcsText": "اضغط على الطلب أدناه لتلقي{{vcLabel}}" }, @@ -297,6 +301,7 @@ } }, "RequestScreen": { + "receiveCard": "البطاقة المستلمة", "bluetoothDenied": "الرجاء تمكين Bluetooth لتتمكن من طلب{{vcLabel}}", "showQrCode": "اعرض رمز الاستجابة السريعة هذا لطلب المقيم {{vcLabel}}", "incomingVc": "الوارد {{vcLabel}}", @@ -339,7 +344,7 @@ "header": "مسح رمز الاستجابة السريعة", "noShareableVcs": "لا تتوفر {{vcLabel}} قابلة للمشاركة.", "sharingVc": "مشاركة {{vcLabel}}", - "BluetoothStateIos": "تم إيقاف تشغيل البلوتوث ، يرجى تشغيله من مركز التحكم", + "bluetoothStateIos": "تم إيقاف تشغيل البلوتوث ، يرجى تشغيله من مركز التحكم", "bluetoothStateAndroid": "تم إيقاف تشغيل البلوتوث ، يرجى تشغيله من قائمة الإعدادات السريعة", "errors": { "locationDisabled": { diff --git a/locales/en.json b/locales/en.json index 57a1d877..fa07d16c 100644 --- a/locales/en.json +++ b/locales/en.json @@ -109,6 +109,8 @@ }, "SettingScreen": { "header": "Settings", + "injiAsVerifierApp": "Inji as Verifier App", + "basicSettings": "Basic Settings", "bioUnlock": "Unlock with Biometrics", "language": "Language", "injiTourGuide": "Inji Tour Guide", @@ -197,6 +199,8 @@ "next": "Next" }, "ReceivedVcsTab": { + "receivedCards": "Received Cards", + "header": "Received Cards", "noReceivedVcsTitle": "No {{vcLabel}} available yet", "noReceivedVcsText": "Tap on Request below to receive {{vcLabel}}" }, @@ -280,6 +284,7 @@ } }, "RequestScreen": { + "receiveCard": "Receive Card", "bluetoothDenied": "Please enable Bluetooth to be able to request {{vcLabel}}", "showQrCode": "Display this QR code to request resident {{vcLabel}}", "incomingVc": "Incoming {{vcLabel}}", @@ -322,8 +327,8 @@ "header": "Scan QR Code", "noShareableVcs": "No shareable {{vcLabel}} are available.", "sharingVc": "Sharing {{vcLabel}}", - "BluetoothStateIos": "Bluetooth is turned OFF, please turn it ON from control center", - "BluetoothStateAndroid": "Bluetooth is turned OFF, please turn it ON from Quick settings menu", + "bluetoothStateIos": "Bluetooth is turned OFF, please turn it ON from control center", + "bluetoothStateAndroid": "Bluetooth is turned OFF, please turn it ON from Quick settings menu", "errors": { "locationDisabled": { "message": "Location services must be enabled for the scanning functionality", diff --git a/locales/fil.json b/locales/fil.json index af524c78..03ff1d7a 100644 --- a/locales/fil.json +++ b/locales/fil.json @@ -103,6 +103,8 @@ }, "SettingScreen": { "header": "Mga setting", + "injiAsVerifierApp": "Inji bilang Verifier App", + "basicSettings": "Mga Pangunahing Setting", "bioUnlock": "I-unlock gamit ang Biometrics", "language": "Wika", "aboutInji": "About Inji", @@ -210,6 +212,8 @@ "next": "Susunod" }, "ReceivedVcsTab": { + "receivedCards": "Mga Natanggap na Card", + "header": "Mga Natanggap na Card", "noReceivedVcsTitle": "Wala pang {{vcLabel}}", "noReceivedVcsText": "Pindutin ang Humiling sa ibaba para makatanggap ng {{vcLabel}}" }, @@ -293,6 +297,7 @@ } }, "RequestScreen": { + "receiveCard": "Tumanggap ng Card", "bluetoothDenied": "Mangyaring paganahin ang Bluetooth upang makahiling ng {{vcLabel}}", "showQrCode": "Ipakita ang QR code na ito para humiling ng resident {{vcLabel}}", "incomingVc": "Padating na {{vcLabel}}", @@ -335,7 +340,7 @@ "header": "I-scan ang QR Code", "noShareableVcs": "Walang magagamit na maibabahaging {{vcLabel}}..", "sharingVc": "Pagbabahagi ng {{vcLabel}}", - "BluetoothStateIos": "Naka-OFF ang Bluetooth, paki-ON ito mula sa control center", + "bluetoothStateIos": "Naka-OFF ang Bluetooth, paki-ON ito mula sa control center", "bluetoothStateAndroid": "Naka-OFF ang Bluetooth, paki-ON ito mula sa control center", "errors": { "locationDisabled": { diff --git a/locales/hin.json b/locales/hin.json index bf6d4dfe..c9560e53 100644 --- a/locales/hin.json +++ b/locales/hin.json @@ -110,6 +110,8 @@ }, "SettingScreen": { "header": "समायोजन", + "injiAsVerifierApp": "सत्यापनकर्ता ऐप के रूप में इंजी", + "basicSettings": "मूल सेटिंग्स", "bioUnlock": "बायोमेट्रिक्स से अनलॉक करें", "language": "भाषा", "aboutInji": "इंजी के बारे में", @@ -222,6 +224,8 @@ "next": "अगला" }, "ReceivedVcsTab": { + "receivedCards": "प्राप्त कार्ड", + "header": "प्राप्त कार्ड", "noReceivedVcsTitle": "नहीं {{vcLabel}} अभी तक उपलब्ध नहीं है", "noReceivedVcsText": "प्राप्त करने के लिए नीचे दिए गए अनुरोध पर टैप करें {{vcLabel}}" }, @@ -305,6 +309,7 @@ } }, "RequestScreen": { + "receiveCard": "कार्ड प्राप्त करें", "bluetoothDenied": "कृपया ब्लूटूथ को सक्षम करें ताकि वह {{vcLabel}} का अनुरोध कर सके", "showQrCode": "निवासी {{vcLabel}} का अनुरोध करने के लिए यह क्यूआर कोड प्रदर्शित करें", "incomingVc": "इनकमिंग {{vcLabel}}", @@ -347,7 +352,7 @@ "header": "स्कैन क्यू आर कोड", "noShareableVcs": "कोई साझा करने योग्य {{vcLabel}} उपलब्ध नहीं है।", "sharingVc": "{{vcLabel}} साझा करना", - "BluetoothStateIos": "ब्लूटूथ बंद है, कृपया इसे नियंत्रण केंद्र से चालू करें", + "bluetoothStateIos": "ब्लूटूथ बंद है, कृपया इसे नियंत्रण केंद्र से चालू करें", "bluetoothStateAndroid": "ब्लूटूथ बंद है, कृपया इसे त्वरित सेटिंग मेनू से चालू करें", "errors": { "locationDisabled": { diff --git a/locales/kan.json b/locales/kan.json index 53b0884c..c95b0937 100644 --- a/locales/kan.json +++ b/locales/kan.json @@ -110,6 +110,8 @@ }, "SettingScreen": { "header": "ಸಂಯೋಜನೆಗಳು", + "injiAsVerifierApp": "ವೆರಿಫೈಯರ್ ಆಪ್ ಆಗಿ ಇಂಜಿ", + "basicSettings": "ಮೂಲ ಸೆಟ್ಟಿಂಗ್‌ಗಳು", "bioUnlock": "ಬಯೋಮೆಟ್ರಿಕ್ಸ್‌ನೊಂದಿಗೆ ಅನ್‌ಲಾಕ್ ಮಾಡಿ", "language": "ಭಾಷೆ", "aboutInji": "ಇಂಜಿ ಬಗ್ಗೆ", @@ -222,6 +224,8 @@ "next": "ಮುಂದೆ" }, "ReceivedVcsTab": { + "receivedCards": "ಕಾರ್ಡ್‌ಗಳನ್ನು ಸ್ವೀಕರಿಸಲಾಗಿದೆ", + "header": "ಕಾರ್ಡ್‌ಗಳನ್ನು ಸ್ವೀಕರಿಸಲಾಗಿದೆ", "noReceivedVcsTitle": "ಇನ್ನೂ ಯಾವುದೇ {{vcLabel}} ಲಭ್ಯವಿಲ್ಲ", "noReceivedVcsText": "{{vcLabel}} ಸ್ವೀಕರಿಸಲು ಕೆಳಗಿನ ವಿನಂತಿಯ ಮೇಲೆ ಟ್ಯಾಪ್ ಮಾಡಿ" }, @@ -305,6 +309,7 @@ } }, "RequestScreen": { + "receiveCard": "ಕಾರ್ಡ್ ಸ್ವೀಕರಿಸಿ", "bluetoothDenied": "ವಿನಂತಿಸಲು ಬ್ಲೂಟೂತ್ ಅನ್ನು ಸಕ್ರಿಯಗೊಳಿಸಿ{{vcLabel}}", "showQrCode": "ನಿವಾಸಿ {{vcLabel}} ಅನ್ನು ವಿನಂತಿಸಲು ಈ QR ಕೋಡ್ ಅನ್ನು ಪ್ರದರ್ಶಿಸಿ", "incomingVc": "ಒಳಬರುವ {{vcLabel}}", @@ -347,7 +352,7 @@ "header": "QR ಕೋಡ್ ಅನ್ನು ಸ್ಕ್ಯಾನ್ ಮಾಡಿ", "noShareableVcs": "ಯಾವುದೇ ಹಂಚಿಕೊಳ್ಳಬಹುದಾದ {{vcLabel}} ಲಭ್ಯವಿಲ್ಲ.", "sharingVc": "{{vcLabel}} ಹಂಚಿಕೊಳ್ಳಲಾಗುತ್ತಿದೆ", - "BluetoothStateIos": "ಬ್ಲೂಟೂತ್ ಆಫ್ ಆಗಿದೆ, ದಯವಿಟ್ಟು ಅದನ್ನು ನಿಯಂತ್ರಣ ಕೇಂದ್ರದಿಂದ ಆನ್ ಮಾಡಿ", + "bluetoothStateIos": "ಬ್ಲೂಟೂತ್ ಆಫ್ ಆಗಿದೆ, ದಯವಿಟ್ಟು ಅದನ್ನು ನಿಯಂತ್ರಣ ಕೇಂದ್ರದಿಂದ ಆನ್ ಮಾಡಿ", "bluetoothStateAndroid": "ಬ್ಲೂಟೂತ್ ಆಫ್ ಆಗಿದೆ, ದಯವಿಟ್ಟು ತ್ವರಿತ ಸೆಟ್ಟಿಂಗ್‌ಗಳ ಮೆನುವಿನಿಂದ ಅದನ್ನು ಆನ್ ಮಾಡಿ", "errors": { "locationDisabled": { diff --git a/locales/tam.json b/locales/tam.json index eb6c57c9..f253c4d6 100644 --- a/locales/tam.json +++ b/locales/tam.json @@ -108,6 +108,8 @@ }, "SettingScreen": { "header": "அமைப்புகள்", + "injiAsVerifierApp": "சரிபார்ப்பு பயன்பாடாக இன்ஜி", + "basicSettings": "அடிப்படை அமைப்புகள்", "bioUnlock": "பயோமெட்ரிக்ஸ் மூலம் திறக்கவும்", "language": "மொழி", "aboutInji": "இன்ஜி பற்றி", @@ -220,6 +222,8 @@ "next": "அடுத்தது" }, "ReceivedVcsTab": { + "receivedCards": "பெற்ற அட்டைகள்", + "header": "பெற்ற அட்டைகள்", "noReceivedVcsTitle": "இன்னும் {{vcLabel}} கிடைக்கவில்லை", "noReceivedVcsText": "{{vcLabel}} பெறுவதற்கு கீழே உள்ள கோரிக்கையைத் தட்டவும்" }, @@ -303,6 +307,7 @@ } }, "RequestScreen": { + "receiveCard": "பெற்ற அட்டை", "bluetoothDenied": "{{vcLabel}}ஐக் கோர புளூடூத்தை இயக்கவும்", "showQrCode": "குடியுரிமை {{vcLabel}}ஐக் கோர இந்த QR குறியீட்டைக் காட்டு", "incomingVc": "உள்வரும் {{vcLabel}}", @@ -345,7 +350,7 @@ "header": "QR குறியீட்டை ஸ்கேன் செய்யவும்", "noShareableVcs": "பகிரக்கூடிய {{vcLabel}} எதுவும் இல்லை.", "sharingVc": "பகிர்கிறது {{vcLabel}}", - "BluetoothStateIos": "புளூடூத் முடக்கப்பட்டுள்ளது, கட்டுப்பாட்டு மையத்திலிருந்து அதை இயக்கவும்", + "bluetoothStateIos": "புளூடூத் முடக்கப்பட்டுள்ளது, கட்டுப்பாட்டு மையத்திலிருந்து அதை இயக்கவும்", "bluetoothStateAndroid": "புளூடூத் முடக்கப்பட்டுள்ளது, விரைவு அமைப்புகள் மெனுவிலிருந்து அதை இயக்கவும்", "errors": { "locationDisabled": { diff --git a/screens/Home/ReceivedVcsTabController.ts b/screens/Home/ReceivedVcsTabController.ts index d31ea5d9..2a798aad 100644 --- a/screens/Home/ReceivedVcsTabController.ts +++ b/screens/Home/ReceivedVcsTabController.ts @@ -1,12 +1,12 @@ import { useSelector } from '@xstate/react'; -import { useContext } from 'react'; +import { useContext, useState } from 'react'; import { ActorRefFrom } from 'xstate'; import { selectVcLabel } from '../../machines/settings'; import { selectIsRefreshingReceivedVcs, selectReceivedVcs, } from '../../machines/vc'; -import { vcItemMachine } from '../../machines/vcItem'; +import { vcItemMachine } from '../../machines/vcItem'; import { GlobalContext } from '../../shared/GlobalContext'; import { HomeScreenTabProps } from './HomeScreen'; import { @@ -17,16 +17,20 @@ import { export function useReceivedVcsTab(props: HomeScreenTabProps) { const service = props.service as ActorRefFrom; const { appService } = useContext(GlobalContext); + const [isVisible, setIsVisible] = useState(false); const settingsService = appService.children.get('settings'); const vcService = appService.children.get('vc'); return { + isVisible, vcLabel: useSelector(settingsService, selectVcLabel), vcKeys: useSelector(vcService, selectReceivedVcs), isRefreshingVcs: useSelector(vcService, selectIsRefreshingReceivedVcs), - VIEW_VC: (vcItemActor: ActorRefFrom) => + TOGGLE_RECEIVED_CARDS: () => setIsVisible(!isVisible), + + VIEW_VC: (vcItemActor: ActorRefFrom) => service.send(ReceivedVcsTabEvents.VIEW_VC(vcItemActor)), REFRESH: () => service.send(ReceivedVcsTabEvents.REFRESH()), }; diff --git a/screens/Scan/ScanScreen.strings.json b/screens/Scan/ScanScreen.strings.json index 44e531a3..a3a44e50 100644 --- a/screens/Scan/ScanScreen.strings.json +++ b/screens/Scan/ScanScreen.strings.json @@ -2,8 +2,8 @@ "header": "Scan QR Code", "noShareableVcs": "No shareable {{vcLabel}} are available.", "sharingVc": "Sharing {{vcLabel}}", - "BluetoothStateIos": "Bluetooth is turned OFF, please turn it ON from Control center", - "BluetoothStateAndroid": "Bluetooth is turned OFF, please turn it ON from Quick settings menu", + "bluetoothStateIos": "Bluetooth is turned OFF, please turn it ON from Control center", + "bluetoothStateAndroid": "Bluetooth is turned OFF, please turn it ON from Quick settings menu", "errors": { "locationDisabled": { "message": "Location services must be enabled for the scanning functionality", diff --git a/screens/Settings/ReceiveCard.tsx b/screens/Settings/ReceiveCard.tsx new file mode 100644 index 00000000..476d9173 --- /dev/null +++ b/screens/Settings/ReceiveCard.tsx @@ -0,0 +1,50 @@ +import React, { useState } from 'react'; +import { TFunction, useTranslation } from 'react-i18next'; +import { Switch, Icon } from 'react-native-elements'; +import { Pressable, Platform } from 'react-native'; +import QRCode from 'react-native-qrcode-svg'; + +import { Centered, Button, Column, Row, Text } from '../../components/ui'; +import { Theme } from '../../components/ui/styleUtils'; +import { Image } from 'react-native'; +import { Modal } from '../../components/ui/Modal'; +import { useRequestScreen } from '../Request/RequestScreenController'; +import { isGoogleNearbyEnabled } from '../../lib/smartshare'; + +export const ReceiveCard: React.FC = () => { + const { t } = useTranslation('RequestScreen'); + const controller = useRequestScreen(); + const props: RequestScreenProps = { t, controller }; + + const [showReceiveCard, setShowReceiveCard] = useState(false); + + return ( + + { + setShowReceiveCard(!showReceiveCard); + }}> + + + + {t('receiveCard')} + + + + } + headerTitle={t('receiveCard')} + headerElevation={2} + onDismiss={() => setShowReceiveCard(!showReceiveCard)}> + + + + ); +}; diff --git a/screens/Settings/ReceivedCards.tsx b/screens/Settings/ReceivedCards.tsx new file mode 100644 index 00000000..7acc2e23 --- /dev/null +++ b/screens/Settings/ReceivedCards.tsx @@ -0,0 +1,81 @@ +import React, { useState } from 'react'; +import { useTranslation } from 'react-i18next'; +import { RefreshControl } from 'react-native'; +import { Pressable, TouchableOpacity } from 'react-native'; +import { Centered, Column, Row, Text } from '../../components/ui'; +import { Icon } from 'react-native-elements'; +import { Theme } from '../../components/ui/styleUtils'; +import { Image } from 'react-native'; +import { Modal } from '../../components/ui/Modal'; +import { HomeScreenTabProps } from '../Home/HomeScreen'; +import { useReceivedVcsTab } from '../Home/ReceivedVcsTabController'; +import { VcItem } from '../../components/VcItem'; + +export const ReceivedCards: React.FC = (props) => { + const { t } = useTranslation('ReceivedVcsTab'); + const controller = useReceivedVcsTab(props); + + return ( + + + + + + {t('receivedCards')} + + + + + } + headerTitle={t('header')} + headerElevation={2} + onDismiss={controller.TOGGLE_RECEIVED_CARDS}> + + }> + {controller.vcKeys.map((vcKey) => ( + + ))} + {controller.vcKeys.length === 0 && ( + + + + + {t('noReceivedVcsTitle', { + vcLabel: controller.vcLabel.plural, + })} + + + {t('noReceivedVcsText', { + vcLabel: controller.vcLabel.singular, + })} + + + + )} + + + + ); +}; diff --git a/screens/Settings/SettingScreen.tsx b/screens/Settings/SettingScreen.tsx index 8bf06345..0810b450 100644 --- a/screens/Settings/SettingScreen.tsx +++ b/screens/Settings/SettingScreen.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Linking, Pressable, View } from 'react-native'; import { Icon, ListItem, Switch } from 'react-native-elements'; -import { Column, Text } from '../../components/ui'; +import { Row, Column, Text } from '../../components/ui'; import { Theme } from '../../components/ui/styleUtils'; import { MainRouteProps } from '../../routes/main'; import { MessageOverlay } from '../../components/MessageOverlay'; @@ -13,6 +13,8 @@ import { ScrollView } from 'react-native-gesture-handler'; import { Modal } from '../../components/ui/Modal'; import getAllConfigurations from '../../shared/commonprops/commonProps'; import { AboutInji } from './AboutInji'; +import { ReceiveCard } from './ReceiveCard'; +import { ReceivedCards } from './ReceivedCards'; const LanguageSetting: React.FC = () => { const { t } = useTranslation('SettingScreen'); @@ -20,7 +22,7 @@ const LanguageSetting: React.FC = () => { return ( + = ( headerTitle={t('header')} headerElevation={2} onDismiss={controller.TOGGLE_SETTINGS}> - - + + + {t('injiAsVerifierApp')} + + + + + + + + {t('basicSettings')} + + = ( - + = ( { Linking.openURL(helpUrl); }}> @@ -120,7 +137,7 @@ export const SettingScreen: React.FC = ( - +