diff --git a/components/CustomTabBar.tsx b/components/CustomTabBar.tsx index 1ff2a8b..576eeda 100644 --- a/components/CustomTabBar.tsx +++ b/components/CustomTabBar.tsx @@ -66,10 +66,10 @@ const CustomTabBar: React.FC = ({ state, descriptors, naviga onLongPress={onLongPress} style={styles.tabButton} > - + {/* Check if label is a string before rendering */} {typeof label === 'string' ? ( - + {label} ) : null} @@ -122,7 +122,7 @@ const styles = StyleSheet.create({ width: 60, height: 60, borderRadius: 30, - backgroundColor: '#673ab7', + backgroundColor: '#ff69b4', justifyContent: 'center', alignItems: 'center', shadowColor: '#000', diff --git a/components/ScannedDataBox.tsx b/components/ScannedDataBox.tsx index 57ef1a6..7fd9f92 100644 --- a/components/ScannedDataBox.tsx +++ b/components/ScannedDataBox.tsx @@ -11,24 +11,27 @@ interface ScannedDataBoxProps { const ScannedDataBox: React.FC = ({ data, scanResult, dataType }) => { const extractedData = data.split('\n')[1]?.split('Data: ')[1] || ''; - let resultText = 'SAFE'; - let resultColor = styles.safeResult; - if (scanResult) { - if (!scanResult.secureConnection || !scanResult.virusTotalCheck) { - resultText = 'DANGEROUS'; - resultColor = styles.dangerousResult; - } else if (scanResult.secureConnection && scanResult.virusTotalCheck) { - resultText = 'SAFE'; - resultColor = styles.safeResult; + const getResultText = () => { + if (!scanResult || (!scanResult.secureConnection && !scanResult.virusTotalCheck)) { + return 'DANGEROUS'; + } else if (scanResult.redirects > 0) { + return 'WARNING'; } else { - resultText = 'WARNING'; - resultColor = styles.warningResult; + return 'SAFE'; } - } else { - resultText = 'WARNING'; - resultColor = styles.warningResult; - } + }; + + const getResultColor = () => { + const result = getResultText(); + if (result === 'DANGEROUS') { + return '#ff0000'; // Red + } else if (result === 'WARNING') { + return '#ffa500'; // Orange + } else { + return '#00ff00'; // Green + } + }; return ( @@ -40,8 +43,8 @@ const ScannedDataBox: React.FC = ({ data, scanResult, dataT {new Date().toLocaleString()} - - Result: {resultText} + + Result: {getResultText()} @@ -114,15 +117,6 @@ const styles = StyleSheet.create({ marginBottom: 10, textAlign: 'center', }, - safeResult: { - color: 'green', - }, - warningResult: { - color: 'orange', - }, - dangerousResult: { - color: 'red', - }, typeText: { fontSize: 16, color: '#000', diff --git a/screens/QRScannerScreen.tsx b/screens/QRScannerScreen.tsx index 1e61245..8c3278e 100644 --- a/screens/QRScannerScreen.tsx +++ b/screens/QRScannerScreen.tsx @@ -232,7 +232,7 @@ const QRScannerScreen: React.FC = ({ clearScanData }) => { {/* Banner section */} - SafeQR v0.77 + SafeQR v0.89 {/* Welcome Text */} Welcome to SafeQR code Scanner diff --git a/screens/SettingsScreen.tsx b/screens/SettingsScreen.tsx index 8b2638b..3fe5b72 100644 --- a/screens/SettingsScreen.tsx +++ b/screens/SettingsScreen.tsx @@ -1,24 +1,42 @@ import React, { useContext } from 'react'; -import { View, Text, StyleSheet, TouchableOpacity } from 'react-native'; +import { View, Text, StyleSheet, TouchableOpacity, Linking } from 'react-native'; import { QRCodeContext } from '../types'; const SettingsScreen: React.FC = () => { const qrCodeContext = useContext(QRCodeContext); - - // Safely access setQrCodes and handle the case when the context is null const setQrCodes = qrCodeContext ? qrCodeContext.setQrCodes : () => {}; - const clearHistory = () => { setQrCodes([]); }; + const handleLinkPress = (url: string) => { + Linking.openURL(url); + }; + return ( - Settings Screen - - Clear History - + Settings + + Profile + + Log In + + + + + About Us + handleLinkPress('https://safeqr.github.io/marketing/')}> + safeqr.github.io/marketing + + handleLinkPress('https://safeqr.github.io/privacy-policy')}> + Privacy Policy + + handleLinkPress('https://safeqr.github.io/terms-of-service')}> + Terms Of Service + + + Version 1.2 ); }; @@ -29,25 +47,53 @@ const styles = StyleSheet.create({ backgroundColor: '#f8f0fc', padding: 20, }, - welcomeText: { - textAlign: 'center', - fontSize: 20, - marginVertical: 10, - color: 'black', + header: { + fontSize: 24, + fontWeight: 'bold', + color: '#ff69b4', + marginBottom: 20, }, - button: { - backgroundColor: '#333', + profileSection: { + marginBottom: 20, + }, + sectionTitle: { + fontSize: 18, + fontWeight: 'bold', + color: '#000', + marginBottom: 10, + }, + loginButton: { + backgroundColor: '#ff69b4', + paddingVertical: 8, paddingHorizontal: 20, - paddingVertical: 10, - borderRadius: 30, + borderRadius: 20, alignItems: 'center', justifyContent: 'center', - marginVertical: 10, + alignSelf: 'flex-start', }, - buttonText: { - color: 'white', + loginButtonText: { + color: '#000', fontSize: 16, }, + divider: { + height: 1, + backgroundColor: '#ccc', + marginVertical: 20, + }, + aboutUsSection: { + marginBottom: 20, + }, + linkText: { + fontSize: 16, + color: '#0000ff', + marginBottom: 10, + }, + versionText: { + textAlign: 'center', + fontSize: 14, + color: '#aaa', + marginTop: 20, + }, }); export default SettingsScreen; diff --git a/temp/Sample QR/0_safe.png b/temp/Sample QR/0_safe.png new file mode 100644 index 0000000..4b8196e Binary files /dev/null and b/temp/Sample QR/0_safe.png differ diff --git a/temp/Sample QR/1_unknown.png b/temp/Sample QR/1_unknown.png new file mode 100644 index 0000000..cfa2898 Binary files /dev/null and b/temp/Sample QR/1_unknown.png differ diff --git a/temp/Sample QR/2_Danger.png b/temp/Sample QR/2_Danger.png new file mode 100644 index 0000000..9bf21e5 Binary files /dev/null and b/temp/Sample QR/2_Danger.png differ diff --git a/temp/Sample QR/http.png b/temp/Sample QR/http.png new file mode 100644 index 0000000..ba65825 Binary files /dev/null and b/temp/Sample QR/http.png differ diff --git a/temp/Sample QR/proxy.png b/temp/Sample QR/proxy.png new file mode 100644 index 0000000..b76c14b Binary files /dev/null and b/temp/Sample QR/proxy.png differ