11import { useAuth } from '@mezon/core' ;
22import { Icons } from '@mezon/mobile-components' ;
3- import { baseColor , size } from '@mezon/mobile-ui' ;
3+ import { baseColor , Colors , size , ThemeModeBase , useTheme } from '@mezon/mobile-ui' ;
44import { appActions } from '@mezon/store' ;
55import { getStoreAsync } from '@mezon/store-mobile' ;
66import { useNavigation } from '@react-navigation/native' ;
77import { safeJSONParse } from 'mezon-js' ;
88import React , { useEffect , useState } from 'react' ;
99import { Alert , Linking , StyleSheet , Text , TouchableOpacity , View } from 'react-native' ;
10- import FastImage from 'react-native-fast-image' ;
1110import { launchImageLibrary } from 'react-native-image-picker' ;
11+ import LinearGradient from 'react-native-linear-gradient' ;
1212import Toast from 'react-native-toast-message' ;
1313import { Camera , useCameraDevice , useCodeScanner } from 'react-native-vision-camera' ;
1414import RNQRGenerator from 'rn-qr-generator' ;
15+ import LogoMezonDark from '../../../../assets/svg/logoMezonDark.svg' ;
16+ import LogoMezonLight from '../../../../assets/svg/logoMezonLight.svg' ;
1517import { APP_SCREEN } from '../../../navigation/ScreenTypes' ;
16- import { styles } from './styles' ;
17- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
18- // @ts -expect-error
19- import ICON_LOGIN from './iconLogin.png' ;
18+ import { style } from './styles' ;
2019
2120export const QRScanner = ( ) => {
2221 const [ hasPermission , setHasPermission ] = useState ( false ) ;
@@ -25,6 +24,8 @@ export const QRScanner = () => {
2524 const [ valueCode , setValueCode ] = useState < string > ( '' ) ;
2625 const [ isSuccess , setIsSuccess ] = useState < boolean > ( false ) ;
2726 const { confirmLoginRequest } = useAuth ( ) ;
27+ const { themeValue, themeBasic } = useTheme ( ) ;
28+ const styles = style ( themeValue ) ;
2829
2930 const codeScanner = useCodeScanner ( {
3031 codeTypes : [ 'qr' ] ,
@@ -237,25 +238,34 @@ export const QRScanner = () => {
237238 </ TouchableOpacity >
238239 </ View >
239240 ) : (
240- < View style = { styles . popupLogin } >
241+ < LinearGradient
242+ start = { { x : 0 , y : 1.2 } }
243+ end = { { x : 1 , y : 0 } }
244+ colors = { [ baseColor . white , Colors . bgViolet , Colors . textLink ] }
245+ style = { styles . popupLogin }
246+ >
241247 < View style = { styles . popupLoginSub } >
242- < FastImage source = { ICON_LOGIN } style = { styles . iconLogin } />
248+ { themeBasic === ThemeModeBase . DARK ? (
249+ < LogoMezonDark width = { size . s_100 } height = { size . s_80 } />
250+ ) : (
251+ < LogoMezonLight width = { size . s_100 } height = { size . s_80 } />
252+ ) }
243253 < Text style = { styles . title } > { isSuccess ? `You're in!` : `Log in on a new device?` } </ Text >
244254 { isSuccess ? (
245255 < Text style = { styles . subTitleSuccess } > You're now logged in on desktop</ Text >
246256 ) : (
247- < Text style = { styles . subTitle } > Newer scan a lgin QR code from another user.</ Text >
257+ < Text style = { styles . subTitle } > Never scan a login QR code from another user.</ Text >
248258 ) }
249259 < TouchableOpacity style = { styles . button } onPress = { isSuccess ? onGoback : onConfirmLogin } >
250- < Text style = { styles . buttonText } > { isSuccess ? 'Start talking' : 'Log in' } </ Text >
260+ < Text style = { styles . buttonTextOutline } > { isSuccess ? 'Start talking' : 'Log in' } </ Text >
251261 </ TouchableOpacity >
252262 { ! isSuccess && (
253263 < TouchableOpacity style = { [ styles . button , { backgroundColor : 'transparent' , marginTop : size . s_10 } ] } onPress = { onGoback } >
254- < Text style = { styles . buttonText } > Cancel</ Text >
264+ < Text style = { styles . buttonTextOutline } > Cancel</ Text >
255265 </ TouchableOpacity >
256266 ) }
257267 </ View >
258- </ View >
268+ </ LinearGradient >
259269 ) }
260270 </ View >
261271 ) ;
0 commit comments