@coorpacademy/components 11.14.10 → 11.14.12-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/button/index.native.d.ts.map +1 -1
- package/es/atom/button/index.native.js +6 -1
- package/es/atom/button/index.native.js.map +1 -1
- package/es/atom/button-link/index.d.ts.map +1 -1
- package/es/atom/button-link/index.js +1 -2
- package/es/atom/button-link/index.js.map +1 -1
- package/es/atom/html/index.native.js +2 -2
- package/es/atom/html/index.native.js.map +1 -1
- package/es/atom/select-modal/index.native.d.ts.map +1 -1
- package/es/atom/select-modal/index.native.js +4 -5
- package/es/atom/select-modal/index.native.js.map +1 -1
- package/es/atom/text/index.native.d.ts +3 -6
- package/es/atom/text/index.native.d.ts.map +1 -1
- package/es/atom/text/index.native.js +11 -11
- package/es/atom/text/index.native.js.map +1 -1
- package/es/hoc/modal/select-item/index.native.d.ts.map +1 -1
- package/es/hoc/modal/select-item/index.native.js +4 -2
- package/es/hoc/modal/select-item/index.native.js.map +1 -1
- package/es/molecule/external-content-button/index.d.ts.map +1 -1
- package/es/molecule/external-content-button/index.js +2 -1
- package/es/molecule/external-content-button/index.js.map +1 -1
- package/es/molecule/questions/mobile/slider/index.native.d.ts.map +1 -1
- package/es/molecule/questions/mobile/slider/index.native.js +6 -4
- package/es/molecule/questions/mobile/slider/index.native.js.map +1 -1
- package/es/molecule/questions/qcm-graphic/index.d.ts.map +1 -1
- package/es/molecule/questions/qcm-graphic/index.js +1 -2
- package/es/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/es/template/mobile-login/qr-code-scanner/index.native.d.ts.map +1 -1
- package/es/template/mobile-login/qr-code-scanner/index.native.js +6 -5
- package/es/template/mobile-login/qr-code-scanner/index.native.js.map +1 -1
- package/es/template/mobile-login/receive-email/index.native.d.ts.map +1 -1
- package/es/template/mobile-login/receive-email/index.native.js +33 -21
- package/es/template/mobile-login/receive-email/index.native.js.map +1 -1
- package/es/template/mobile-login/welcome/index.native.d.ts.map +1 -1
- package/es/template/mobile-login/welcome/index.native.js +4 -3
- package/es/template/mobile-login/welcome/index.native.js.map +1 -1
- package/lib/atom/button/index.native.d.ts.map +1 -1
- package/lib/atom/button/index.native.js +6 -1
- package/lib/atom/button/index.native.js.map +1 -1
- package/lib/atom/button-link/index.d.ts.map +1 -1
- package/lib/atom/button-link/index.js.map +1 -1
- package/lib/atom/html/index.native.js +2 -2
- package/lib/atom/html/index.native.js.map +1 -1
- package/lib/atom/select-modal/index.native.d.ts.map +1 -1
- package/lib/atom/select-modal/index.native.js +4 -5
- package/lib/atom/select-modal/index.native.js.map +1 -1
- package/lib/atom/text/index.native.d.ts +3 -6
- package/lib/atom/text/index.native.d.ts.map +1 -1
- package/lib/atom/text/index.native.js +13 -17
- package/lib/atom/text/index.native.js.map +1 -1
- package/lib/hoc/modal/select-item/index.native.d.ts.map +1 -1
- package/lib/hoc/modal/select-item/index.native.js +4 -2
- package/lib/hoc/modal/select-item/index.native.js.map +1 -1
- package/lib/molecule/external-content-button/index.d.ts.map +1 -1
- package/lib/molecule/external-content-button/index.js +2 -1
- package/lib/molecule/external-content-button/index.js.map +1 -1
- package/lib/molecule/questions/mobile/slider/index.native.d.ts.map +1 -1
- package/lib/molecule/questions/mobile/slider/index.native.js +6 -4
- package/lib/molecule/questions/mobile/slider/index.native.js.map +1 -1
- package/lib/molecule/questions/qcm-graphic/index.d.ts.map +1 -1
- package/lib/molecule/questions/qcm-graphic/index.js +1 -2
- package/lib/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/lib/template/mobile-login/qr-code-scanner/index.native.d.ts.map +1 -1
- package/lib/template/mobile-login/qr-code-scanner/index.native.js +13 -11
- package/lib/template/mobile-login/qr-code-scanner/index.native.js.map +1 -1
- package/lib/template/mobile-login/receive-email/index.native.d.ts.map +1 -1
- package/lib/template/mobile-login/receive-email/index.native.js +33 -21
- package/lib/template/mobile-login/receive-email/index.native.js.map +1 -1
- package/lib/template/mobile-login/welcome/index.native.d.ts.map +1 -1
- package/lib/template/mobile-login/welcome/index.native.js +10 -8
- package/lib/template/mobile-login/welcome/index.native.js.map +1 -1
- package/package.json +2 -2
- package/locales/.mtslconfig.json +0 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef } from 'react';
|
|
2
|
-
import { Animated, Easing, StyleSheet,
|
|
2
|
+
import { Animated, Easing, StyleSheet, View } from 'react-native';
|
|
3
3
|
import QRCodeScannerBase from 'react-native-qrcode-scanner';
|
|
4
4
|
import { NovaCompositionCoorpacademyQrCode as QrCodeIcon } from '@coorpacademy/nova-icons';
|
|
5
5
|
import Touchable from '../../../hoc/touchable/index.native';
|
|
6
|
+
import Text from '../../../atom/text/index.native';
|
|
6
7
|
const HEIGHT = 280;
|
|
7
8
|
const WIDTH = 280;
|
|
8
9
|
const COLOR = '#fff';
|
|
@@ -101,13 +102,13 @@ const explanationsStyle = StyleSheet.create({
|
|
|
101
102
|
explanations: {
|
|
102
103
|
position: 'absolute',
|
|
103
104
|
width: '100%',
|
|
104
|
-
height: 260,
|
|
105
105
|
bottom: 0,
|
|
106
106
|
backgroundColor: '#fff',
|
|
107
107
|
borderTopLeftRadius: 30,
|
|
108
108
|
borderTopRightRadius: 30,
|
|
109
109
|
paddingHorizontal: 24,
|
|
110
|
-
|
|
110
|
+
paddingTop: 8,
|
|
111
|
+
paddingBottom: 30
|
|
111
112
|
},
|
|
112
113
|
titleWrapper: {
|
|
113
114
|
flexDirection: 'row',
|
|
@@ -124,9 +125,9 @@ const explanationsStyle = StyleSheet.create({
|
|
|
124
125
|
fontWeight: '600',
|
|
125
126
|
color: '#1D1D2B',
|
|
126
127
|
fontSize: 21,
|
|
127
|
-
lineHeight:
|
|
128
|
+
lineHeight: 24,
|
|
128
129
|
letterSpacing: 0.5,
|
|
129
|
-
marginLeft:
|
|
130
|
+
marginLeft: 7
|
|
130
131
|
},
|
|
131
132
|
line: {
|
|
132
133
|
flexDirection: 'row',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useCallback","useEffect","useRef","Animated","Easing","StyleSheet","Text","View","QRCodeScannerBase","NovaCompositionCoorpacademyQrCode","QrCodeIcon","Touchable","HEIGHT","WIDTH","COLOR","BORDER_RADIUS","LINE_WIDTH","styles","create","container","width","height","camera","blurs","position","opacity","blurTop","backgroundColor","transform","translateY","blurBottom","bottom","blurLeft","left","top","translateX","blurRight","right","targetStyle","target","borderRadius","overflow","square","stroke","explanationsStyle","explanations","borderTopLeftRadius","borderTopRightRadius","paddingHorizontal","paddingVertical","titleWrapper","flexDirection","alignItems","justifyContent","qrCodeIcon","fill","titleText","fontWeight","color","fontSize","lineHeight","letterSpacing","marginLeft","line","paddingRight","lineText","marginRight","help","marginTop","titleHelp","ctaHelp","textDecorationLine","Corner","props","lineLength","Target","animationRef","Value","current","interpolate","inputRange","outputRange","animation","timing","toValue","duration","delay","easing","out","sin","useNativeDriver","start","rotate","Explanations","locales","onHelpPress","animateBottom","title","explanation1","explanation2","QRCodeScanner","hasPermission","onScan","handleRead","data","undefined","blurRef","blurOpacity","captureAudio"],"sources":["../../../../src/template/mobile-login/qr-code-scanner/index.native.tsx"],"sourcesContent":["import React, {useCallback, useEffect, useRef} from 'react';\nimport {Animated, Easing, StyleSheet, Text, View, ViewStyle} from 'react-native';\n\nimport QRCodeScannerBase from 'react-native-qrcode-scanner';\nimport type {BarCodeReadEvent} from 'react-native-camera';\nimport {NovaCompositionCoorpacademyQrCode as QrCodeIcon} from '@coorpacademy/nova-icons';\nimport Touchable from '../../../hoc/touchable/index.native';\n\nexport interface Props {\n hasPermission: boolean;\n onScan: (token?: string) => void;\n onHelpPress: () => void;\n locales: {\n title: string;\n explanation1: string;\n explanation2: string;\n ctaHelp: string;\n titleHelp: string;\n };\n}\n\nconst HEIGHT = 280;\nconst WIDTH = 280;\nconst COLOR = '#fff';\nconst BORDER_RADIUS = 8;\n\nconst LINE_WIDTH = 7;\n\nconst styles = StyleSheet.create({\n container: {\n width: '100%',\n height: '100%'\n },\n camera: {\n width: '100%',\n height: '100%'\n },\n blurs: {\n position: 'absolute',\n width: '100%',\n height: '100%',\n opacity: 0.6\n },\n blurTop: {\n position: 'absolute',\n backgroundColor: '#000',\n width: '100%',\n height: '35%',\n transform: [{translateY: -HEIGHT / 2 + LINE_WIDTH / 2}]\n },\n blurBottom: {\n position: 'absolute',\n backgroundColor: '#000',\n width: '100%',\n height: '65%',\n bottom: 0,\n transform: [{translateY: HEIGHT / 2 - LINE_WIDTH / 2}]\n },\n blurLeft: {\n position: 'absolute',\n backgroundColor: '#000',\n width: '50%',\n height: HEIGHT - LINE_WIDTH,\n left: 0,\n top: '35%',\n transform: [\n {translateX: -WIDTH / 2 + LINE_WIDTH / 2},\n {translateY: -HEIGHT / 2 + LINE_WIDTH / 2}\n ]\n },\n blurRight: {\n position: 'absolute',\n backgroundColor: '#000',\n width: '50%',\n height: HEIGHT - LINE_WIDTH,\n right: 0,\n top: '35%',\n transform: [\n {translateX: WIDTH / 2 - LINE_WIDTH / 2},\n {translateY: -HEIGHT / 2 + LINE_WIDTH / 2}\n ]\n }\n});\n\nconst targetStyle = StyleSheet.create({\n target: {\n width: HEIGHT,\n height: WIDTH,\n top: '35%',\n left: '50%',\n transform: [{translateX: -WIDTH / 2}, {translateY: -HEIGHT / 2}],\n borderRadius: BORDER_RADIUS,\n position: 'absolute',\n overflow: 'hidden'\n },\n square: {\n position: 'absolute',\n width: '35%',\n height: '35%'\n },\n stroke: {\n position: 'absolute',\n top: 0,\n left: 0,\n backgroundColor: COLOR,\n borderRadius: BORDER_RADIUS\n }\n});\n\nconst explanationsStyle = StyleSheet.create({\n explanations: {\n position: 'absolute',\n width: '100%',\n height: 260,\n bottom: 0,\n backgroundColor: '#fff',\n borderTopLeftRadius: 30,\n borderTopRightRadius: 30,\n paddingHorizontal: 24,\n paddingVertical: 8\n },\n titleWrapper: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'flex-start',\n paddingVertical: 16\n },\n qrCodeIcon: {\n fill: '#000',\n height: 14,\n width: 14\n },\n titleText: {\n fontWeight: '600',\n color: '#1D1D2B',\n fontSize: 21,\n lineHeight: 30,\n letterSpacing: 0.5,\n marginLeft: 5\n },\n line: {\n flexDirection: 'row',\n paddingRight: 24,\n paddingVertical: 8\n },\n lineText: {\n fontWeight: '400',\n color: '#1D1D2B',\n fontSize: 18,\n lineHeight: 24,\n letterSpacing: 0.5,\n marginRight: 7\n },\n help: {\n flexDirection: 'row',\n marginTop: 12\n },\n titleHelp: {\n fontSize: 16,\n color: '#9999A8'\n },\n ctaHelp: {\n marginLeft: 5,\n fontSize: 16,\n letterSpacing: 0.5,\n textDecorationLine: 'underline',\n color: '#9999A8'\n }\n});\n\nconst Corner = (props: {position: ViewStyle; lineLength: Animated.AnimatedInterpolation}) => {\n const {position, lineLength} = props;\n\n return (\n <View style={[targetStyle.square, position]}>\n <Animated.View style={[targetStyle.stroke, {height: LINE_WIDTH, width: lineLength}]} />\n <Animated.View style={[targetStyle.stroke, {width: LINE_WIDTH, height: lineLength}]} />\n </View>\n );\n};\n\nconst Target = () => {\n const animationRef = useRef<Animated.Value>(new Animated.Value(0)).current;\n const lineLength = animationRef.interpolate({\n inputRange: [0, 1],\n outputRange: [0, WIDTH * 0.35]\n });\n\n useEffect(() => {\n const animation = Animated.timing(animationRef, {\n toValue: 1,\n duration: 700,\n delay: 400,\n easing: Easing.out(Easing.sin),\n useNativeDriver: false\n });\n\n animation.start();\n // on mount only\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <View style={targetStyle.target}>\n <Corner lineLength={lineLength} position={{top: 0, left: 0, transform: [{rotate: '0deg'}]}} />\n <Corner\n lineLength={lineLength}\n position={{top: 0, right: 0, transform: [{rotate: '90deg'}]}}\n />\n <Corner\n lineLength={lineLength}\n position={{bottom: 0, right: 0, transform: [{rotate: '180deg'}]}}\n />\n <Corner\n lineLength={lineLength}\n position={{bottom: 0, left: 0, transform: [{rotate: '270deg'}]}}\n />\n </View>\n );\n};\n\nconst Explanations = (props: {locales: Props['locales']; onHelpPress: Props['onHelpPress']}) => {\n const {locales, onHelpPress} = props;\n\n const animationRef = useRef<Animated.Value>(new Animated.Value(0)).current;\n const animateBottom = animationRef.interpolate({\n inputRange: [0, 1],\n outputRange: [-300, 0]\n });\n\n useEffect(() => {\n const animation = Animated.timing(animationRef, {\n toValue: 1,\n duration: 600,\n delay: 400,\n easing: Easing.out(Easing.sin),\n useNativeDriver: false\n });\n\n animation.start();\n\n // on mount only\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <Animated.View style={[explanationsStyle.explanations, {bottom: animateBottom}]}>\n <View style={explanationsStyle.titleWrapper}>\n <QrCodeIcon style={explanationsStyle.qrCodeIcon} />\n <Text style={explanationsStyle.titleText}>{locales.title}</Text>\n </View>\n <View style={explanationsStyle.line}>\n <Text style={explanationsStyle.lineText}>1.</Text>\n <Text style={explanationsStyle.lineText}>{locales.explanation1}</Text>\n </View>\n <View style={explanationsStyle.line}>\n <Text style={explanationsStyle.lineText}>2.</Text>\n <Text style={explanationsStyle.lineText}>{locales.explanation2}</Text>\n </View>\n\n <Touchable onPress={onHelpPress} style={explanationsStyle.help}>\n <Text style={explanationsStyle.titleHelp}>{locales.titleHelp}</Text>\n <Text style={explanationsStyle.ctaHelp}>{locales.ctaHelp}</Text>\n </Touchable>\n </Animated.View>\n );\n};\n\nconst QRCodeScanner = (props: Props) => {\n const {hasPermission, locales, onScan, onHelpPress} = props;\n\n const handleRead = useCallback(({data}: BarCodeReadEvent) => {\n onScan(typeof data === 'string' ? data : undefined);\n // on mount only\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const blurRef = useRef<Animated.Value>(new Animated.Value(0)).current;\n const blurOpacity = blurRef.interpolate({\n inputRange: [0, 1],\n outputRange: [0, 0.7]\n });\n\n useEffect(() => {\n const animation = Animated.timing(blurRef, {\n toValue: 1,\n duration: 800,\n delay: 600,\n easing: Easing.out(Easing.sin),\n useNativeDriver: false\n });\n\n animation.start();\n\n // on mount only\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <View style={styles.container} testID=\"qr-code-scanner\">\n {hasPermission ? (\n <QRCodeScannerBase\n fadeIn={false}\n onRead={handleRead}\n cameraStyle={styles.camera}\n cameraProps={{captureAudio: false}}\n />\n ) : null}\n <Animated.View style={[styles.blurs, {opacity: blurOpacity}]}>\n <View style={styles.blurTop} />\n <View style={styles.blurBottom} />\n <View style={styles.blurLeft} />\n <View style={styles.blurRight} />\n </Animated.View>\n <Target />\n <Explanations locales={locales} onHelpPress={onHelpPress} />\n </View>\n );\n};\n\nexport default QRCodeScanner;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,SAA5B,EAAuCC,MAAvC,QAAoD,OAApD;AACA,SAAQC,QAAR,EAAkBC,MAAlB,EAA0BC,UAA1B,EAAsCC,IAAtC,EAA4CC,IAA5C,QAAkE,cAAlE;AAEA,OAAOC,iBAAP,MAA8B,6BAA9B;AAEA,SAAQC,iCAAiC,IAAIC,UAA7C,QAA8D,0BAA9D;AACA,OAAOC,SAAP,MAAsB,qCAAtB;AAeA,MAAMC,MAAM,GAAG,GAAf;AACA,MAAMC,KAAK,GAAG,GAAd;AACA,MAAMC,KAAK,GAAG,MAAd;AACA,MAAMC,aAAa,GAAG,CAAtB;AAEA,MAAMC,UAAU,GAAG,CAAnB;AAEA,MAAMC,MAAM,GAAGZ,UAAU,CAACa,MAAX,CAAkB;EAC/BC,SAAS,EAAE;IACTC,KAAK,EAAE,MADE;IAETC,MAAM,EAAE;EAFC,CADoB;EAK/BC,MAAM,EAAE;IACNF,KAAK,EAAE,MADD;IAENC,MAAM,EAAE;EAFF,CALuB;EAS/BE,KAAK,EAAE;IACLC,QAAQ,EAAE,UADL;IAELJ,KAAK,EAAE,MAFF;IAGLC,MAAM,EAAE,MAHH;IAILI,OAAO,EAAE;EAJJ,CATw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EAAEkF;IAAV,CAAf;EAAtB,gBACE,oBAAC,IAAD;IAAM,KAAK,EAAE1F,MAAM,CAACS;EAApB,EADF,eAEE,oBAAC,IAAD;IAAM,KAAK,EAAET,MAAM,CAACa;EAApB,EAFF,eAGE,oBAAC,IAAD;IAAM,KAAK,EAAEb,MAAM,CAACe;EAApB,EAHF,eAIE,oBAAC,IAAD;IAAM,KAAK,EAAEf,MAAM,CAACmB;EAApB,EAJF,CATF,eAeE,oBAAC,MAAD,OAfF,eAgBE,oBAAC,YAAD;IAAc,OAAO,EAAE0D,OAAvB;IAAgC,WAAW,EAAEC;EAA7C,EAhBF,CADF;AAoBD,CAlDD;;AAoDA,eAAeK,aAAf"}
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useCallback","useEffect","useRef","Animated","Easing","StyleSheet","View","QRCodeScannerBase","NovaCompositionCoorpacademyQrCode","QrCodeIcon","Touchable","Text","HEIGHT","WIDTH","COLOR","BORDER_RADIUS","LINE_WIDTH","styles","create","container","width","height","camera","blurs","position","opacity","blurTop","backgroundColor","transform","translateY","blurBottom","bottom","blurLeft","left","top","translateX","blurRight","right","targetStyle","target","borderRadius","overflow","square","stroke","explanationsStyle","explanations","borderTopLeftRadius","borderTopRightRadius","paddingHorizontal","paddingTop","paddingBottom","titleWrapper","flexDirection","alignItems","justifyContent","paddingVertical","qrCodeIcon","fill","titleText","fontWeight","color","fontSize","lineHeight","letterSpacing","marginLeft","line","paddingRight","lineText","marginRight","help","marginTop","titleHelp","ctaHelp","textDecorationLine","Corner","props","lineLength","Target","animationRef","Value","current","interpolate","inputRange","outputRange","animation","timing","toValue","duration","delay","easing","out","sin","useNativeDriver","start","rotate","Explanations","locales","onHelpPress","animateBottom","title","explanation1","explanation2","QRCodeScanner","hasPermission","onScan","handleRead","data","undefined","blurRef","blurOpacity","captureAudio"],"sources":["../../../../src/template/mobile-login/qr-code-scanner/index.native.tsx"],"sourcesContent":["import React, {useCallback, useEffect, useRef} from 'react';\nimport {Animated, Easing, StyleSheet, View, ViewStyle} from 'react-native';\n\nimport QRCodeScannerBase from 'react-native-qrcode-scanner';\nimport type {BarCodeReadEvent} from 'react-native-camera';\nimport {NovaCompositionCoorpacademyQrCode as QrCodeIcon} from '@coorpacademy/nova-icons';\nimport Touchable from '../../../hoc/touchable/index.native';\nimport Text from '../../../atom/text/index.native';\n\nexport interface Props {\n hasPermission: boolean;\n onScan: (token?: string) => void;\n onHelpPress: () => void;\n locales: {\n title: string;\n explanation1: string;\n explanation2: string;\n ctaHelp: string;\n titleHelp: string;\n };\n}\n\nconst HEIGHT = 280;\nconst WIDTH = 280;\nconst COLOR = '#fff';\nconst BORDER_RADIUS = 8;\n\nconst LINE_WIDTH = 7;\n\nconst styles = StyleSheet.create({\n container: {\n width: '100%',\n height: '100%'\n },\n camera: {\n width: '100%',\n height: '100%'\n },\n blurs: {\n position: 'absolute',\n width: '100%',\n height: '100%',\n opacity: 0.6\n },\n blurTop: {\n position: 'absolute',\n backgroundColor: '#000',\n width: '100%',\n height: '35%',\n transform: [{translateY: -HEIGHT / 2 + LINE_WIDTH / 2}]\n },\n blurBottom: {\n position: 'absolute',\n backgroundColor: '#000',\n width: '100%',\n height: '65%',\n bottom: 0,\n transform: [{translateY: HEIGHT / 2 - LINE_WIDTH / 2}]\n },\n blurLeft: {\n position: 'absolute',\n backgroundColor: '#000',\n width: '50%',\n height: HEIGHT - LINE_WIDTH,\n left: 0,\n top: '35%',\n transform: [\n {translateX: -WIDTH / 2 + LINE_WIDTH / 2},\n {translateY: -HEIGHT / 2 + LINE_WIDTH / 2}\n ]\n },\n blurRight: {\n position: 'absolute',\n backgroundColor: '#000',\n width: '50%',\n height: HEIGHT - LINE_WIDTH,\n right: 0,\n top: '35%',\n transform: [\n {translateX: WIDTH / 2 - LINE_WIDTH / 2},\n {translateY: -HEIGHT / 2 + LINE_WIDTH / 2}\n ]\n }\n});\n\nconst targetStyle = StyleSheet.create({\n target: {\n width: HEIGHT,\n height: WIDTH,\n top: '35%',\n left: '50%',\n transform: [{translateX: -WIDTH / 2}, {translateY: -HEIGHT / 2}],\n borderRadius: BORDER_RADIUS,\n position: 'absolute',\n overflow: 'hidden'\n },\n square: {\n position: 'absolute',\n width: '35%',\n height: '35%'\n },\n stroke: {\n position: 'absolute',\n top: 0,\n left: 0,\n backgroundColor: COLOR,\n borderRadius: BORDER_RADIUS\n }\n});\n\nconst explanationsStyle = StyleSheet.create({\n explanations: {\n position: 'absolute',\n width: '100%',\n bottom: 0,\n backgroundColor: '#fff',\n borderTopLeftRadius: 30,\n borderTopRightRadius: 30,\n paddingHorizontal: 24,\n paddingTop: 8,\n paddingBottom: 30\n },\n titleWrapper: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'flex-start',\n paddingVertical: 16\n },\n qrCodeIcon: {\n fill: '#000',\n height: 14,\n width: 14\n },\n titleText: {\n fontWeight: '600',\n color: '#1D1D2B',\n fontSize: 21,\n lineHeight: 24,\n letterSpacing: 0.5,\n marginLeft: 7\n },\n line: {\n flexDirection: 'row',\n paddingRight: 24,\n paddingVertical: 8\n },\n lineText: {\n fontWeight: '400',\n color: '#1D1D2B',\n fontSize: 18,\n lineHeight: 24,\n letterSpacing: 0.5,\n marginRight: 7\n },\n help: {\n flexDirection: 'row',\n marginTop: 12\n },\n titleHelp: {\n fontSize: 16,\n color: '#9999A8'\n },\n ctaHelp: {\n marginLeft: 5,\n fontSize: 16,\n letterSpacing: 0.5,\n textDecorationLine: 'underline',\n color: '#9999A8'\n }\n});\n\nconst Corner = (props: {position: ViewStyle; lineLength: Animated.AnimatedInterpolation}) => {\n const {position, lineLength} = props;\n\n return (\n <View style={[targetStyle.square, position]}>\n <Animated.View style={[targetStyle.stroke, {height: LINE_WIDTH, width: lineLength}]} />\n <Animated.View style={[targetStyle.stroke, {width: LINE_WIDTH, height: lineLength}]} />\n </View>\n );\n};\n\nconst Target = () => {\n const animationRef = useRef<Animated.Value>(new Animated.Value(0)).current;\n const lineLength = animationRef.interpolate({\n inputRange: [0, 1],\n outputRange: [0, WIDTH * 0.35]\n });\n\n useEffect(() => {\n const animation = Animated.timing(animationRef, {\n toValue: 1,\n duration: 700,\n delay: 400,\n easing: Easing.out(Easing.sin),\n useNativeDriver: false\n });\n\n animation.start();\n // on mount only\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <View style={targetStyle.target}>\n <Corner lineLength={lineLength} position={{top: 0, left: 0, transform: [{rotate: '0deg'}]}} />\n <Corner\n lineLength={lineLength}\n position={{top: 0, right: 0, transform: [{rotate: '90deg'}]}}\n />\n <Corner\n lineLength={lineLength}\n position={{bottom: 0, right: 0, transform: [{rotate: '180deg'}]}}\n />\n <Corner\n lineLength={lineLength}\n position={{bottom: 0, left: 0, transform: [{rotate: '270deg'}]}}\n />\n </View>\n );\n};\n\nconst Explanations = (props: {locales: Props['locales']; onHelpPress: Props['onHelpPress']}) => {\n const {locales, onHelpPress} = props;\n\n const animationRef = useRef<Animated.Value>(new Animated.Value(0)).current;\n const animateBottom = animationRef.interpolate({\n inputRange: [0, 1],\n outputRange: [-300, 0]\n });\n\n useEffect(() => {\n const animation = Animated.timing(animationRef, {\n toValue: 1,\n duration: 600,\n delay: 400,\n easing: Easing.out(Easing.sin),\n useNativeDriver: false\n });\n\n animation.start();\n\n // on mount only\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <Animated.View style={[explanationsStyle.explanations, {bottom: animateBottom}]}>\n <View style={explanationsStyle.titleWrapper}>\n <QrCodeIcon style={explanationsStyle.qrCodeIcon} />\n <Text style={explanationsStyle.titleText}>{locales.title}</Text>\n </View>\n <View style={explanationsStyle.line}>\n <Text style={explanationsStyle.lineText}>1.</Text>\n <Text style={explanationsStyle.lineText}>{locales.explanation1}</Text>\n </View>\n <View style={explanationsStyle.line}>\n <Text style={explanationsStyle.lineText}>2.</Text>\n <Text style={explanationsStyle.lineText}>{locales.explanation2}</Text>\n </View>\n\n <Touchable onPress={onHelpPress} style={explanationsStyle.help}>\n <Text style={explanationsStyle.titleHelp}>{locales.titleHelp}</Text>\n <Text style={explanationsStyle.ctaHelp}>{locales.ctaHelp}</Text>\n </Touchable>\n </Animated.View>\n );\n};\n\nconst QRCodeScanner = (props: Props) => {\n const {hasPermission, locales, onScan, onHelpPress} = props;\n\n const handleRead = useCallback(({data}: BarCodeReadEvent) => {\n onScan(typeof data === 'string' ? data : undefined);\n // on mount only\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const blurRef = useRef<Animated.Value>(new Animated.Value(0)).current;\n const blurOpacity = blurRef.interpolate({\n inputRange: [0, 1],\n outputRange: [0, 0.7]\n });\n\n useEffect(() => {\n const animation = Animated.timing(blurRef, {\n toValue: 1,\n duration: 800,\n delay: 600,\n easing: Easing.out(Easing.sin),\n useNativeDriver: false\n });\n\n animation.start();\n\n // on mount only\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <View style={styles.container} testID=\"qr-code-scanner\">\n {hasPermission ? (\n <QRCodeScannerBase\n fadeIn={false}\n onRead={handleRead}\n cameraStyle={styles.camera}\n cameraProps={{captureAudio: false}}\n />\n ) : null}\n <Animated.View style={[styles.blurs, {opacity: blurOpacity}]}>\n <View style={styles.blurTop} />\n <View style={styles.blurBottom} />\n <View style={styles.blurLeft} />\n <View style={styles.blurRight} />\n </Animated.View>\n <Target />\n <Explanations locales={locales} onHelpPress={onHelpPress} />\n </View>\n );\n};\n\nexport default QRCodeScanner;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,SAA5B,EAAuCC,MAAvC,QAAoD,OAApD;AACA,SAAQC,QAAR,EAAkBC,MAAlB,EAA0BC,UAA1B,EAAsCC,IAAtC,QAA4D,cAA5D;AAEA,OAAOC,iBAAP,MAA8B,6BAA9B;AAEA,SAAQC,iCAAiC,IAAIC,UAA7C,QAA8D,0BAA9D;AACA,OAAOC,SAAP,MAAsB,qCAAtB;AACA,OAAOC,IAAP,MAAiB,iCAAjB;A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,eAAe,EAAE;IALwB,CAAzB,CAAlB;IAQAR,SAAS,CAACS,KAAV,GATc,CAWd;IACA;EACD,CAbQ,EAaN,EAbM,CAAT;EAeA,oBACE,oBAAC,IAAD;IAAM,KAAK,EAAE5E,MAAM,CAACE,SAApB;IAA+B,MAAM,EAAC;EAAtC,GACGoF,aAAa,gBACZ,oBAAC,iBAAD;IACE,MAAM,EAAE,KADV;IAEE,MAAM,EAAEE,UAFV;IAGE,WAAW,EAAExF,MAAM,CAACK,MAHtB;IAIE,WAAW,EAAE;MAACwF,YAAY,EAAE;IAAf;EAJf,EADY,GAOV,IARN,eASE,oBAAC,QAAD,CAAU,IAAV;IAAe,KAAK,EAAE,CAAC7F,MAAM,CAACM,KAAR,EAAe;MAACE,OAAO,EAAEoF;IAAV,CAAf;EAAtB,gBACE,oBAAC,IAAD;IAAM,KAAK,EAAE5F,MAAM,CAACS;EAApB,EADF,eAEE,oBAAC,IAAD;IAAM,KAAK,EAAET,MAAM,CAACa;EAApB,EAFF,eAGE,oBAAC,IAAD;IAAM,KAAK,EAAEb,MAAM,CAACe;EAApB,EAHF,eAIE,oBAAC,IAAD;IAAM,KAAK,EAAEf,MAAM,CAACmB;EAApB,EAJF,CATF,eAeE,oBAAC,MAAD,OAfF,eAgBE,oBAAC,YAAD;IAAc,OAAO,EAAE4D,OAAvB;IAAgC,WAAW,EAAEC;EAA7C,EAhBF,CADF;AAoBD,CAlDD;;AAoDA,eAAeK,aAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../../src/template/mobile-login/receive-email/index.native.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../../src/template/mobile-login/receive-email/index.native.tsx"],"names":[],"mappings":";AAoIA,oBAAY,KAAK,GAAG;IAClB,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,YAAY,UAAW,KAAK,gBAyEjC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
-
import { Animated, Easing, StyleSheet, Text, TextInput, View } from 'react-native';
|
|
2
|
+
import { Animated, Easing, KeyboardAvoidingView, Platform, StyleSheet, Text, TextInput, View } from 'react-native';
|
|
3
3
|
import { NovaCompositionNavigationLeftArrow as ArrowIcon, NovaCompositionCoorpacademyEmail as MailIcon, NovaCompositionCoorpacademySendEmail as SendIcon } from '@coorpacademy/nova-icons';
|
|
4
4
|
import Touchable from '../../../hoc/touchable/index.native';
|
|
5
5
|
import useMobileKeyboardVisibility from '../../../util/use-mobile-keyboard-visibility';
|
|
6
|
+
const enabledColor = '#0061ff';
|
|
7
|
+
const disabledColor = '#9999A8';
|
|
8
|
+
const emailRegex = /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
|
|
6
9
|
const styles = StyleSheet.create({
|
|
7
10
|
container: {
|
|
8
11
|
width: '100%',
|
|
9
12
|
height: '100%',
|
|
10
13
|
flex: 1,
|
|
14
|
+
justifyContent: 'space-between',
|
|
11
15
|
alignItems: 'flex-start',
|
|
12
16
|
paddingVertical: 50,
|
|
13
17
|
paddingHorizontal: 24
|
|
@@ -74,6 +78,8 @@ const styles = StyleSheet.create({
|
|
|
74
78
|
height: 48,
|
|
75
79
|
width: '100%',
|
|
76
80
|
backgroundColor: '#F4F4F5',
|
|
81
|
+
borderColor: enabledColor,
|
|
82
|
+
borderWidth: 2,
|
|
77
83
|
fontSize: 15,
|
|
78
84
|
lineHeight: 16,
|
|
79
85
|
alignContent: 'center',
|
|
@@ -82,16 +88,17 @@ const styles = StyleSheet.create({
|
|
|
82
88
|
paddingHorizontal: 40
|
|
83
89
|
},
|
|
84
90
|
ctaWrapper: {
|
|
85
|
-
width: '100%'
|
|
91
|
+
width: '100%',
|
|
92
|
+
overflow: 'hidden',
|
|
93
|
+
borderRadius: 12,
|
|
94
|
+
marginTop: 30,
|
|
95
|
+
marginBottom: 50
|
|
86
96
|
},
|
|
87
97
|
ctaButton: {
|
|
88
|
-
borderRadius: 12,
|
|
89
|
-
paddingHorizontal: 50,
|
|
90
|
-
paddingVertical: 16,
|
|
91
98
|
flexDirection: 'row',
|
|
92
99
|
justifyContent: 'center',
|
|
93
100
|
alignItems: 'center',
|
|
94
|
-
|
|
101
|
+
paddingVertical: 16
|
|
95
102
|
},
|
|
96
103
|
sendIcon: {
|
|
97
104
|
fill: '#fff',
|
|
@@ -106,9 +113,6 @@ const styles = StyleSheet.create({
|
|
|
106
113
|
lineHeight: 24
|
|
107
114
|
}
|
|
108
115
|
});
|
|
109
|
-
const enabledColor = '#0061ff';
|
|
110
|
-
const disabledColor = '#9999A8';
|
|
111
|
-
const emailRegex = /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
|
|
112
116
|
|
|
113
117
|
const ReceiveEmail = props => {
|
|
114
118
|
const {
|
|
@@ -116,14 +120,21 @@ const ReceiveEmail = props => {
|
|
|
116
120
|
onClose
|
|
117
121
|
} = props;
|
|
118
122
|
const [isValid, setValid] = useState(false);
|
|
123
|
+
const [isTextInputFocused, setTextInputFocused] = useState(false);
|
|
119
124
|
const isKeyboardVisible = useMobileKeyboardVisibility();
|
|
120
125
|
const handleChangeText = useCallback(value => {
|
|
121
126
|
setValid(emailRegex.test(value));
|
|
122
127
|
}, []);
|
|
128
|
+
const handleTextInputFocus = useCallback(() => {
|
|
129
|
+
setTextInputFocused(true);
|
|
130
|
+
}, []);
|
|
131
|
+
const handleTextInputBlur = useCallback(() => {
|
|
132
|
+
setTextInputFocused(false);
|
|
133
|
+
}, []);
|
|
123
134
|
const animationRef = useRef(new Animated.Value(0)).current;
|
|
124
|
-
const
|
|
135
|
+
const animatedColor = animationRef.interpolate({
|
|
125
136
|
inputRange: [0, 1],
|
|
126
|
-
outputRange: [
|
|
137
|
+
outputRange: [disabledColor, enabledColor]
|
|
127
138
|
});
|
|
128
139
|
useEffect(() => {
|
|
129
140
|
const animation = Animated.timing(animationRef, {
|
|
@@ -134,10 +145,9 @@ const ReceiveEmail = props => {
|
|
|
134
145
|
});
|
|
135
146
|
animation.start();
|
|
136
147
|
}, [animationRef, isValid]);
|
|
137
|
-
return /*#__PURE__*/React.createElement(
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}],
|
|
148
|
+
return /*#__PURE__*/React.createElement(KeyboardAvoidingView, {
|
|
149
|
+
behavior: Platform.OS === 'ios' ? 'padding' : 'height',
|
|
150
|
+
style: [styles.container],
|
|
141
151
|
testID: "receive-email"
|
|
142
152
|
}, /*#__PURE__*/React.createElement(View, {
|
|
143
153
|
style: styles.contentWrapper
|
|
@@ -157,21 +167,23 @@ const ReceiveEmail = props => {
|
|
|
157
167
|
}, locales.explanation), /*#__PURE__*/React.createElement(Text, {
|
|
158
168
|
style: styles.subtitle
|
|
159
169
|
}, locales.subtitle), /*#__PURE__*/React.createElement(TextInput, {
|
|
160
|
-
style: styles.textInput,
|
|
170
|
+
style: [styles.textInput, {
|
|
171
|
+
borderWidth: isTextInputFocused ? 2 : 0
|
|
172
|
+
}],
|
|
161
173
|
placeholder: "john.doe@company.com",
|
|
162
174
|
placeholderTextColor: disabledColor,
|
|
163
|
-
onChangeText: handleChangeText
|
|
175
|
+
onChangeText: handleChangeText,
|
|
176
|
+
onFocus: handleTextInputFocus,
|
|
177
|
+
onBlur: handleTextInputBlur
|
|
164
178
|
}), /*#__PURE__*/React.createElement(MailIcon, {
|
|
165
179
|
style: styles.innerMailIcon
|
|
166
180
|
})), /*#__PURE__*/React.createElement(Animated.View, {
|
|
167
181
|
style: [styles.ctaWrapper, {
|
|
168
|
-
|
|
182
|
+
backgroundColor: animatedColor
|
|
169
183
|
}]
|
|
170
184
|
}, /*#__PURE__*/React.createElement(Touchable, {
|
|
171
185
|
disabled: !isValid,
|
|
172
|
-
style: [styles.ctaButton,
|
|
173
|
-
backgroundColor: isValid ? enabledColor : disabledColor
|
|
174
|
-
}],
|
|
186
|
+
style: [styles.ctaButton],
|
|
175
187
|
onPress: onClose
|
|
176
188
|
}, /*#__PURE__*/React.createElement(SendIcon, {
|
|
177
189
|
style: styles.sendIcon
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useCallback","useEffect","useRef","useState","Animated","Easing","StyleSheet","Text","TextInput","View","NovaCompositionNavigationLeftArrow","ArrowIcon","NovaCompositionCoorpacademyEmail","MailIcon","NovaCompositionCoorpacademySendEmail","SendIcon","Touchable","useMobileKeyboardVisibility","styles","create","container","width","height","flex","alignItems","paddingVertical","paddingHorizontal","contentWrapper","backButton","arrowIcon","fill","mailIconWrapper","backgroundColor","padding","marginVertical","borderRadius","justifyContent","mailIcon","innerMailIcon","marginTop","marginLeft","title","color","fontSize","fontWeight","lineHeight","textAlign","marginBottom","explanation","letterSpacing","subtitle","textInput","alignContent","ctaWrapper","ctaButton","flexDirection","sendIcon","marginRight","ctaText","enabledColor","disabledColor","emailRegex","ReceiveEmail","props","locales","onClose","isValid","setValid","isKeyboardVisible","handleChangeText","value","test","animationRef","Value","current","animatedOpacity","interpolate","inputRange","outputRange","animation","timing","toValue","duration","easing","out","sin","useNativeDriver","start","opacity","cta"],"sources":["../../../../src/template/mobile-login/receive-email/index.native.tsx"],"sourcesContent":["import React, {useCallback, useEffect, useRef, useState} from 'react';\nimport {Animated, Easing, StyleSheet, Text, TextInput, View} from 'react-native';\nimport {\n NovaCompositionNavigationLeftArrow as ArrowIcon,\n NovaCompositionCoorpacademyEmail as MailIcon,\n NovaCompositionCoorpacademySendEmail as SendIcon\n} from '@coorpacademy/nova-icons';\n\nimport Touchable from '../../../hoc/touchable/index.native';\nimport useMobileKeyboardVisibility from '../../../util/use-mobile-keyboard-visibility';\n\nconst styles = StyleSheet.create({\n container: {\n width: '100%',\n height: '100%',\n flex: 1,\n alignItems: 'flex-start',\n paddingVertical: 50,\n paddingHorizontal: 24\n },\n contentWrapper: {\n width: '100%'\n },\n backButton: {\n paddingVertical: 20\n },\n arrowIcon: {\n fill: '#515161',\n width: 24,\n height: 15\n },\n mailIconWrapper: {\n backgroundColor: '#f1f6fe',\n width: 64,\n height: 64,\n padding: 23,\n marginVertical: 24,\n borderRadius: 16,\n justifyContent: 'center',\n alignItems: 'center'\n },\n mailIcon: {\n fill: '#0061ff',\n width: 24,\n height: 18\n },\n innerMailIcon: {\n fill: '#515161',\n width: 16,\n height: 12,\n marginTop: -30,\n marginLeft: 16\n },\n title: {\n color: '#1D1D2B',\n fontSize: 24,\n fontWeight: '600',\n lineHeight: 32,\n textAlign: 'left',\n marginBottom: 12\n },\n explanation: {\n color: '#515161',\n fontSize: 17,\n letterSpacing: 0.4,\n fontWeight: '500',\n lineHeight: 22,\n textAlign: 'left',\n marginBottom: 24\n },\n subtitle: {\n color: '#1D1D2B',\n fontSize: 15,\n fontWeight: '600',\n lineHeight: 20,\n textAlign: 'left',\n marginBottom: 8\n },\n textInput: {\n height: 48,\n width: '100%',\n backgroundColor: '#F4F4F5',\n fontSize: 15,\n lineHeight: 16,\n alignContent: 'center',\n color: '#515161',\n borderRadius: 7,\n paddingHorizontal: 40\n },\n ctaWrapper: {\n width: '100%'\n },\n ctaButton: {\n borderRadius: 12,\n paddingHorizontal: 50,\n paddingVertical: 16,\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n marginTop: 30\n },\n sendIcon: {\n fill: '#fff',\n width: 16,\n height: 16,\n marginRight: 8\n },\n ctaText: {\n color: '#fff',\n fontWeight: '700',\n fontSize: 15,\n lineHeight: 24\n }\n});\n\nconst enabledColor = '#0061ff';\nconst disabledColor = '#9999A8';\nconst emailRegex = /^\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$/;\n\nexport type Props = {\n locales: {\n title: string;\n explanation: string;\n subtitle: string;\n cta: string;\n };\n onClose: () => void;\n};\n\nconst ReceiveEmail = (props: Props) => {\n const {locales, onClose} = props;\n\n const [isValid, setValid] = useState<boolean>(false);\n const isKeyboardVisible = useMobileKeyboardVisibility();\n\n const handleChangeText = useCallback(value => {\n setValid(emailRegex.test(value));\n }, []);\n\n const animationRef = useRef<Animated.Value>(new Animated.Value(0)).current;\n const animatedOpacity = animationRef.interpolate({\n inputRange: [0, 1],\n outputRange: [0, 1]\n });\n\n useEffect(() => {\n const animation = Animated.timing(animationRef, {\n toValue: isValid ? 1 : 0,\n duration: 250,\n easing: Easing.out(Easing.sin),\n useNativeDriver: false\n });\n\n animation.start();\n }, [animationRef, isValid]);\n\n return (\n <View\n style={[\n styles.container,\n {justifyContent: isKeyboardVisible ? 'flex-start' : 'space-between'}\n ]}\n testID=\"receive-email\"\n >\n <View style={styles.contentWrapper}>\n <Touchable style={styles.backButton} onPress={onClose}>\n <ArrowIcon style={styles.arrowIcon} />\n </Touchable>\n {isKeyboardVisible ? null : (\n <View style={styles.mailIconWrapper}>\n <MailIcon style={styles.mailIcon} />\n </View>\n )}\n <Text style={styles.title}>{locales.title}</Text>\n <Text style={styles.explanation}>{locales.explanation}</Text>\n <Text style={styles.subtitle}>{locales.subtitle}</Text>\n <TextInput\n style={styles.textInput}\n placeholder=\"john.doe@company.com\"\n placeholderTextColor={disabledColor}\n onChangeText={handleChangeText}\n />\n <MailIcon style={styles.innerMailIcon} />\n </View>\n\n <Animated.View style={[styles.ctaWrapper, {opacity: animatedOpacity}]}>\n <Touchable\n disabled={!isValid}\n style={[styles.ctaButton, {backgroundColor: isValid ? enabledColor : disabledColor}]}\n onPress={onClose}\n >\n <SendIcon style={styles.sendIcon} />\n <Text style={styles.ctaText}>{locales.cta}</Text>\n </Touchable>\n </Animated.View>\n </View>\n );\n};\n\nexport default ReceiveEm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CAApB;EAAtB,gBACE,oBAAC,SAAD;IACE,QAAQ,EAAE,CAACT,OADb;IAEE,KAAK,EAAE,CAAChD,MAAM,CAACoC,SAAR,EAAmB;MAACtB,eAAe,EAAEkC,OAAO,GAAGP,YAAH,GAAkBC;IAA3C,CAAnB,CAFT;IAGE,OAAO,EAAEK;EAHX,gBAKE,oBAAC,QAAD;IAAU,KAAK,EAAE/C,MAAM,CAACsC;EAAxB,EALF,eAME,oBAAC,IAAD;IAAM,KAAK,EAAEtC,MAAM,CAACwC;EAApB,GAA8BM,OAAO,CAACyB,GAAtC,CANF,CADF,CA5BF,CADF;AAyCD,CApED;;AAsEA,eAAe3B,YAAf"}
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useCallback","useEffect","useRef","useState","Animated","Easing","KeyboardAvoidingView","Platform","StyleSheet","Text","TextInput","View","NovaCompositionNavigationLeftArrow","ArrowIcon","NovaCompositionCoorpacademyEmail","MailIcon","NovaCompositionCoorpacademySendEmail","SendIcon","Touchable","useMobileKeyboardVisibility","enabledColor","disabledColor","emailRegex","styles","create","container","width","height","flex","justifyContent","alignItems","paddingVertical","paddingHorizontal","contentWrapper","backButton","arrowIcon","fill","mailIconWrapper","backgroundColor","padding","marginVertical","borderRadius","mailIcon","innerMailIcon","marginTop","marginLeft","title","color","fontSize","fontWeight","lineHeight","textAlign","marginBottom","explanation","letterSpacing","subtitle","textInput","borderColor","borderWidth","alignContent","ctaWrapper","overflow","ctaButton","flexDirection","sendIcon","marginRight","ctaText","ReceiveEmail","props","locales","onClose","isValid","setValid","isTextInputFocused","setTextInputFocused","isKeyboardVisible","handleChangeText","value","test","handleTextInputFocus","handleTextInputBlur","animationRef","Value","current","animatedColor","interpolate","inputRange","outputRange","animation","timing","toValue","duration","easing","out","sin","useNativeDriver","start","OS","cta"],"sources":["../../../../src/template/mobile-login/receive-email/index.native.tsx"],"sourcesContent":["import React, {useCallback, useEffect, useRef, useState} from 'react';\nimport {\n Animated,\n Easing,\n KeyboardAvoidingView,\n Platform,\n StyleSheet,\n Text,\n TextInput,\n View\n} from 'react-native';\nimport {\n NovaCompositionNavigationLeftArrow as ArrowIcon,\n NovaCompositionCoorpacademyEmail as MailIcon,\n NovaCompositionCoorpacademySendEmail as SendIcon\n} from '@coorpacademy/nova-icons';\n\nimport Touchable from '../../../hoc/touchable/index.native';\nimport useMobileKeyboardVisibility from '../../../util/use-mobile-keyboard-visibility';\n\nconst enabledColor = '#0061ff';\nconst disabledColor = '#9999A8';\nconst emailRegex = /^\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$/;\n\nconst styles = StyleSheet.create({\n container: {\n width: '100%',\n height: '100%',\n flex: 1,\n justifyContent: 'space-between',\n alignItems: 'flex-start',\n paddingVertical: 50,\n paddingHorizontal: 24\n },\n contentWrapper: {\n width: '100%'\n },\n backButton: {\n paddingVertical: 20\n },\n arrowIcon: {\n fill: '#515161',\n width: 24,\n height: 15\n },\n mailIconWrapper: {\n backgroundColor: '#f1f6fe',\n width: 64,\n height: 64,\n padding: 23,\n marginVertical: 24,\n borderRadius: 16,\n justifyContent: 'center',\n alignItems: 'center'\n },\n mailIcon: {\n fill: '#0061ff',\n width: 24,\n height: 18\n },\n innerMailIcon: {\n fill: '#515161',\n width: 16,\n height: 12,\n marginTop: -30,\n marginLeft: 16\n },\n title: {\n color: '#1D1D2B',\n fontSize: 24,\n fontWeight: '600',\n lineHeight: 32,\n textAlign: 'left',\n marginBottom: 12\n },\n explanation: {\n color: '#515161',\n fontSize: 17,\n letterSpacing: 0.4,\n fontWeight: '500',\n lineHeight: 22,\n textAlign: 'left',\n marginBottom: 24\n },\n subtitle: {\n color: '#1D1D2B',\n fontSize: 15,\n fontWeight: '600',\n lineHeight: 20,\n textAlign: 'left',\n marginBottom: 8\n },\n textInput: {\n height: 48,\n width: '100%',\n backgroundColor: '#F4F4F5',\n borderColor: enabledColor,\n borderWidth: 2,\n fontSize: 15,\n lineHeight: 16,\n alignContent: 'center',\n color: '#515161',\n borderRadius: 7,\n paddingHorizontal: 40\n },\n ctaWrapper: {\n width: '100%',\n overflow: 'hidden',\n borderRadius: 12,\n marginTop: 30,\n marginBottom: 50\n },\n ctaButton: {\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n paddingVertical: 16\n },\n sendIcon: {\n fill: '#fff',\n width: 16,\n height: 16,\n marginRight: 8\n },\n ctaText: {\n color: '#fff',\n fontWeight: '700',\n fontSize: 15,\n lineHeight: 24\n }\n});\n\nexport type Props = {\n locales: {\n title: string;\n explanation: string;\n subtitle: string;\n cta: string;\n };\n onClose: () => void;\n};\n\nconst ReceiveEmail = (props: Props) => {\n const {locales, onClose} = props;\n\n const [isValid, setValid] = useState<boolean>(false);\n const [isTextInputFocused, setTextInputFocused] = useState<boolean>(false);\n const isKeyboardVisible = useMobileKeyboardVisibility();\n\n const handleChangeText = useCallback(value => {\n setValid(emailRegex.test(value));\n }, []);\n\n const handleTextInputFocus = useCallback(() => {\n setTextInputFocused(true);\n }, []);\n\n const handleTextInputBlur = useCallback(() => {\n setTextInputFocused(false);\n }, []);\n\n const animationRef = useRef<Animated.Value>(new Animated.Value(0)).current;\n const animatedColor = animationRef.interpolate({\n inputRange: [0, 1],\n outputRange: [disabledColor, enabledColor]\n });\n\n useEffect(() => {\n const animation = Animated.timing(animationRef, {\n toValue: isValid ? 1 : 0,\n duration: 250,\n easing: Easing.out(Easing.sin),\n useNativeDriver: false\n });\n\n animation.start();\n }, [animationRef, isValid]);\n\n return (\n <KeyboardAvoidingView\n behavior={Platform.OS === 'ios' ? 'padding' : 'height'}\n style={[styles.container]}\n testID=\"receive-email\"\n >\n <View style={styles.contentWrapper}>\n <Touchable style={styles.backButton} onPress={onClose}>\n <ArrowIcon style={styles.arrowIcon} />\n </Touchable>\n {isKeyboardVisible ? null : (\n <View style={styles.mailIconWrapper}>\n <MailIcon style={styles.mailIcon} />\n </View>\n )}\n <Text style={styles.title}>{locales.title}</Text>\n <Text style={styles.explanation}>{locales.explanation}</Text>\n <Text style={styles.subtitle}>{locales.subtitle}</Text>\n <TextInput\n style={[styles.textInput, {borderWidth: isTextInputFocused ? 2 : 0}]}\n placeholder=\"john.doe@company.com\"\n placeholderTextColor={disabledColor}\n onChangeText={handleChangeText}\n onFocus={handleTextInputFocus}\n onBlur={handleTextInputBlur}\n />\n <MailIcon style={styles.innerMailIcon} />\n </View>\n\n <Animated.View style={[styles.ctaWrapper, {backgroundColor: animatedColor}]}>\n <Touchable disabled={!isValid} style={[styles.ctaButton]} onPress={onClose}>\n <SendIcon style={styles.sendIcon} />\n <Text style={styles.ctaText}>{locales.cta}</Text>\n </Touchable>\n </Animated.View>\n </KeyboardAvoidingView>\n );\n};\n\nexport default ReceiveEmail;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,SAA5B,EAAuCC,MAAvC,EAA+CC,QAA/C,QAA8D,OAA9D;AACA,SACEC,QADF,EAEEC,MAFF,EAGEC,oBAHF,EAIEC,QAJF,EAKEC,UALF,EAMEC,IANF,EAOEC,SAPF,EAQEC,IARF,QASO,cATP;AAUA,SACEC,kCAAkC,IAAIC,SADxC,EAEEC,gCAAgC,IAAIC,QAFtC,EAGEC,oCAAoC,IAAIC,QAH1C,QAIO,0BAJP;AAMA,OAAOC,SAAP,MAAsB,qCAAtB;AACA,OAAOC,2BAAP,MAAwC,8CAAxC;AAEA,MAAMC,YAAY,GAAG,SAArB;AACA,MAAMC,aAAa,GAAG,SAAtB;AACA,MAAMC,UAAU,GAAG,gDAAnB;AAEA,MAAMC,MAAM,GAAGf,UAAU,CAACgB,MAAX,CAAkB;EAC/BC,SAAS,EAAE;IACTC,KAAK,EAAE,MADE;IAETC,MAAM,EAAE,MAFC;IAGTC,IAAI,EAAE,CAHG;IAITC,cAAc,EAAE,eAJP;IAKTC,UAAU,EAAE,YALH;IAMTC,eAAe,EAAE,EANR;IAOTC,iBAAiB,EAAE;EAPV,CADoB;EAU/BC,cAAc,EAAE;IACdP,KA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AE/C,MAAM,CAACyC;EAAxB,EADF,eAEE,oBAAC,IAAD;IAAM,KAAK,EAAEzC,MAAM,CAAC2C;EAApB,GAA8BG,OAAO,CAAC6B,GAAtC,CAFF,CADF,CA5BF,CADF;AAqCD,CAzED;;AA2EA,eAAe/B,YAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../../src/template/mobile-login/welcome/index.native.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../../src/template/mobile-login/welcome/index.native.tsx"],"names":[],"mappings":";AA8KA,oBAAY,KAAK,GAAG;IAClB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,yBAAyB,EAAE,MAAM,IAAI,CAAC;IACtC,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,cAAc,EAAE,MAAM,CAAC;QACvB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH,CAAC;AAEF,QAAA,MAAM,OAAO,UAAW,KAAK,uBAuI5B,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import { Animated, StyleSheet,
|
|
2
|
+
import { Animated, StyleSheet, View } from 'react-native';
|
|
3
3
|
import LinearGradient from 'react-native-linear-gradient';
|
|
4
4
|
import { NovaCompositionCoorpacademyLogoCoorp as LogoCoorp, NovaCompositionCoorpacademyQrCode as QrCodeIcon, NovaCompositionCoorpacademyEmail as MailIcon } from '@coorpacademy/nova-icons';
|
|
5
5
|
import { useAnimateProp, useTranslateY } from '@coorpacademy/react-native-animation';
|
|
6
6
|
import Touchable from '../../../hoc/touchable/index.native';
|
|
7
7
|
import { useTemplateContext } from '../../app-review/template-context';
|
|
8
|
+
import Text from '../../../atom/text/index.native';
|
|
8
9
|
|
|
9
10
|
const createStyleSheet = theme => StyleSheet.create({
|
|
10
11
|
wrapper: {
|
|
@@ -77,8 +78,8 @@ const createStyleSheet = theme => StyleSheet.create({
|
|
|
77
78
|
},
|
|
78
79
|
description: {
|
|
79
80
|
color: '#1D1D2B',
|
|
80
|
-
fontWeight: '
|
|
81
|
-
fontSize:
|
|
81
|
+
fontWeight: '400',
|
|
82
|
+
fontSize: 17,
|
|
82
83
|
lineHeight: 24,
|
|
83
84
|
paddingVertical: 8
|
|
84
85
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useEffect","useRef","useState","Animated","StyleSheet","Text","View","LinearGradient","NovaCompositionCoorpacademyLogoCoorp","LogoCoorp","NovaCompositionCoorpacademyQrCode","QrCodeIcon","NovaCompositionCoorpacademyEmail","MailIcon","useAnimateProp","useTranslateY","Touchable","useTemplateContext","createStyleSheet","theme","create","wrapper","top","bottom","left","right","flex","justifyContent","alignItems","paddingHorizontal","content","width","gradients","position","gradient","opacity","transform","rotate","gradient2","animatedLogoWrapper","animatedLogo","height","logo","padding","logoBG","backgroundColor","title","color","fontWeight","fontSize","lineHeight","paddingVertical","description","actions","buttons","button","marginVertical","flexDirection","borderRadius","overflow","ctaQrCode","colors","cta","ctaQrCodeText","marginLeft","qrCodeIcon","fill","ctaReceiveMail","ctaReceiveMailText","mailIcon","help","titleHelp","ctaHelp","textDecorationLine","Welcome","props","locales","onDemoPress","onQRCodeButtonPress","onHelpPress","onReceiveEmailButtonPress","styleSheet","setStylesheet","translateGradients","fromValue","toValue","duration","delay","translateContent","fadeInContent","property","fadeOutStartLogo","fadeInFinalLogo","scaleAnim","Value","current","interpolateScale","interpolate","inputRange","outputRange","_stylesheet","start","animatedScale","timing","useNativeDriver","animatedStyle","scale"],"sources":["../../../../src/template/mobile-login/welcome/index.native.tsx"],"sourcesContent":["import React, {useEffect, useRef, useState} from 'react';\nimport {Animated, StyleSheet, Text, TextStyle, View, ViewStyle} from 'react-native';\nimport LinearGradient from 'react-native-linear-gradient';\nimport {\n NovaCompositionCoorpacademyLogoCoorp as LogoCoorp,\n NovaCompositionCoorpacademyQrCode as QrCodeIcon,\n NovaCompositionCoorpacademyEmail as MailIcon\n} from '@coorpacademy/nova-icons';\nimport {useAnimateProp, useTranslateY} from '@coorpacademy/react-native-animation';\nimport Touchable from '../../../hoc/touchable/index.native';\nimport {useTemplateContext} from '../../app-review/template-context';\nimport {Theme} from '../../../variables/theme.native';\n\ntype StyleSheetType = {\n wrapper: ViewStyle;\n animatedLogoWrapper: ViewStyle;\n animatedLogo: ViewStyle;\n logo: ViewStyle;\n logoBG: ViewStyle;\n content: ViewStyle;\n gradients: ViewStyle;\n gradient: ViewStyle;\n gradient2: ViewStyle;\n title: TextStyle;\n description: TextStyle;\n actions: ViewStyle;\n buttons: ViewStyle;\n button: ViewStyle;\n qrCodeIcon: ViewStyle;\n mailIcon: ViewStyle;\n ctaQrCode: ViewStyle;\n ctaQrCodeText: TextStyle;\n ctaReceiveMail: ViewStyle;\n ctaReceiveMailText: TextStyle;\n help: ViewStyle;\n titleHelp: TextStyle;\n ctaHelp: ViewStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n wrapper: {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n flex: 1,\n justifyContent: 'space-around',\n alignItems: 'center',\n paddingHorizontal: 24\n },\n content: {\n width: '100%',\n alignItems: 'flex-start'\n },\n gradients: {\n position: 'absolute',\n top: 400,\n bottom: 400,\n left: 0,\n right: 0,\n flex: 1\n },\n gradient: {\n position: 'absolute',\n top: -730,\n bottom: 0,\n left: -380,\n right: -380,\n opacity: 1,\n transform: [{rotate: '35deg'}]\n },\n gradient2: {\n position: 'absolute',\n top: -630,\n bottom: -200,\n left: -300,\n right: -400,\n opacity: 0.6,\n transform: [{rotate: '-35deg'}]\n },\n animatedLogoWrapper: {\n alignItems: 'center'\n },\n animatedLogo: {\n position: 'absolute',\n width: 77,\n height: 100\n },\n logo: {\n padding: 100\n },\n logoBG: {\n backgroundColor: '#fff',\n top: 20,\n width: 60,\n height: 60\n },\n title: {\n color: '#1D1D2B',\n fontWeight: '600',\n fontSize: 28,\n lineHeight: 36,\n paddingVertical: 8\n },\n description: {\n color: '#1D1D2B',\n fontWeight: '500',\n fontSize: 18,\n lineHeight: 24,\n paddingVertical: 8\n },\n actions: {\n width: '100%'\n },\n buttons: {\n paddingVertical: 20,\n alignItems: 'center'\n },\n button: {\n paddingVertical: 12,\n marginVertical: 4,\n width: '100%',\n flexDirection: 'row',\n justifyContent: 'center',\n borderRadius: 12,\n alignItems: 'center',\n overflow: 'hidden'\n },\n ctaQrCode: {\n backgroundColor: theme.colors.cta\n },\n ctaQrCodeText: {\n marginLeft: 8,\n color: '#fff',\n fontWeight: '700',\n fontSize: 14,\n lineHeight: 24\n },\n qrCodeIcon: {\n fill: '#fff',\n height: 14,\n width: 14\n },\n ctaReceiveMail: {\n backgroundColor: '#eaeaeb'\n },\n ctaReceiveMailText: {\n marginLeft: 8,\n color: '#1D1D2B',\n fontWeight: '700',\n fontSize: 14,\n lineHeight: 24\n },\n mailIcon: {\n fill: '#1D1D2B',\n height: 12,\n width: 16\n },\n help: {\n flexDirection: 'row',\n justifyContent: 'center'\n },\n titleHelp: {\n color: '#9999A8'\n },\n ctaHelp: {\n marginLeft: 5,\n textDecorationLine: 'underline',\n color: '#9999A8'\n }\n });\n\nexport type Props = {\n onDemoPress: () => void;\n onHelpPress: () => void;\n onQRCodeButtonPress: () => void;\n onReceiveEmailButtonPress: () => void;\n locales: {\n title: string;\n description: string;\n ctaQrCode: string;\n ctaReceiveMail: string;\n titleHelp: string;\n ctaHelp: string;\n };\n};\n\nconst Welcome = (props: Props) => {\n const {locales, onDemoPress, onQRCodeButtonPress, onHelpPress, onReceiveEmailButtonPress} = props;\n const {theme} = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n\n const translateGradients = useTranslateY({\n fromValue: 0,\n toValue: -200,\n duration: 300,\n delay: 750\n });\n\n const translateContent = useTranslateY({\n fromValue: 170,\n toValue: 0,\n duration: 450,\n delay: 750\n });\n\n const fadeInContent = useAnimateProp({\n property: 'opacity',\n fromValue: 0,\n toValue: 1,\n duration: 650,\n delay: 750\n });\n\n const fadeOutStartLogo = useAnimateProp({\n property: 'opacity',\n fromValue: 1,\n toValue: 0,\n duration: 450,\n delay: 1000\n });\n\n const fadeInFinalLogo = useAnimateProp({\n property: 'opacity',\n fromValue: 0,\n toValue: 1,\n duration: 250,\n delay: 900\n });\n\n const scaleAnim = useRef<Animated.Value>(new Animated.Value(0)).current;\n const interpolateScale = scaleAnim.interpolate({\n inputRange: [0, 0.4, 0.5, 0.6, 1],\n outputRange: [1, 1.7, 1.7, 1.7, 1]\n });\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n useEffect(() => {\n fadeInContent.start();\n fadeInFinalLogo.start();\n fadeOutStartLogo.start();\n translateContent.start();\n translateGradients.start();\n\n const animatedScale = Animated.timing(scaleAnim, {\n toValue: 1,\n duration: 1000,\n useNativeDriver: true\n });\n\n animatedScale.start();\n\n // on mount only\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n if (!styleSheet) {\n return null;\n }\n return (\n <Animated.View style={[styleSheet.wrapper, translateContent.animatedStyle]} testID=\"welcome\">\n <Animated.View style={[styleSheet.gradients, translateGradients.animatedStyle]}>\n <LinearGradient\n colors={['#0061FF', '#fff']}\n locations={[0, 0.95]}\n style={styleSheet.gradient}\n />\n <LinearGradient\n colors={['#2199AB', '#fff']}\n locations={[0, 0.95]}\n style={styleSheet.gradient2}\n />\n </Animated.View>\n\n <Touchable onLongPress={onDemoPress} style={styleSheet.logo}>\n <Animated.View\n style={[styleSheet.animatedLogoWrapper, {transform: [{scale: interpolateScale}]}]}\n >\n <Animated.View style={[styleSheet.logoBG, fadeInFinalLogo.animatedStyle]} />\n <Animated.View style={[styleSheet.animatedLogo, fadeInFinalLogo.animatedStyle]}>\n <LogoCoorp fill=\"#0061FF\" />\n </Animated.View>\n <Animated.View style={[styleSheet.animatedLogo, fadeOutStartLogo.animatedStyle]}>\n <LogoCoorp fill=\"#fff\" />\n </Animated.View>\n </Animated.View>\n </Touchable>\n <Animated.View style={[styleSheet.content, fadeInContent.animatedStyle]}>\n <Text style={styleSheet.title}>{locales.title}</Text>\n <Text style={styleSheet.description}>{locales.description}</Text>\n\n <View style={styleSheet.actions}>\n <View style={styleSheet.buttons}>\n <Touchable\n style={[styleSheet.button, styleSheet.ctaQrCode]}\n onPress={onQRCodeButtonPress}\n testID=\"qr-code-button\"\n >\n <QrCodeIcon style={styleSheet.qrCodeIcon} />\n <Text style={styleSheet.ctaQrCodeText}>{locales.ctaQrCode}</Text>\n </Touchable>\n <Touchable\n style={[styleSheet.button, styleSheet.ctaReceiveMail]}\n onPress={onReceiveEmailButtonPress}\n testID=\"receive-email-button\"\n >\n <MailIcon style={styleSheet.mailIcon} />\n <Text style={styleSheet.ctaReceiveMailText}>{locales.ctaReceiveMail}</Text>\n </Touchable>\n </View>\n <Touchable onPress={onHelpPress} style={styleSheet.help}>\n <Text style={styleSheet.titleHelp}>{locales.titleHelp}</Text>\n <Text style={styleSheet.ctaHelp}>{locales.ctaHelp}</Text>\n </Touchable>\n </View>\n </Animated.View>\n </Animated.View>\n );\n};\n\nexport default Welcome;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,SAAf,EAA0BC,MAA1B,EAAkCC,QAAlC,QAAiD,OAAjD;AACA,SAAQC,QAAR,EAAkBC,UAAlB,EAA8BC,IAA9B,EAA+CC,IAA/C,QAAqE,cAArE;AACA,OAAOC,cAAP,MAA2B,8BAA3B;AACA,SACEC,oCAAoC,IAAIC,S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AAhD,CANF,CADF,eASE,oBAAC,SAAD;IACE,KAAK,EAAE,CAACqB,UAAU,CAAC1B,MAAZ,EAAoB0B,UAAU,CAACd,cAA/B,CADT;IAEE,OAAO,EAAEa,yBAFX;IAGE,MAAM,EAAC;EAHT,gBAKE,oBAAC,QAAD;IAAU,KAAK,EAAEC,UAAU,CAACZ;EAA5B,EALF,eAME,oBAAC,IAAD;IAAM,KAAK,EAAEY,UAAU,CAACb;EAAxB,GAA6CQ,OAAO,CAACT,cAArD,CANF,CATF,CADF,eAmBE,oBAAC,SAAD;IAAW,OAAO,EAAEY,WAApB;IAAiC,KAAK,EAAEE,UAAU,CAACX;EAAnD,gBACE,oBAAC,IAAD;IAAM,KAAK,EAAEW,UAAU,CAACV;EAAxB,GAAoCK,OAAO,CAACL,SAA5C,CADF,eAEE,oBAAC,IAAD;IAAM,KAAK,EAAEU,UAAU,CAACT;EAAxB,GAAkCI,OAAO,CAACJ,OAA1C,CAFF,CAnBF,CAJF,CA3BF,CADF;AA2DD,CAvID;;AAyIA,eAAeE,OAAf"}
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useEffect","useRef","useState","Animated","StyleSheet","View","LinearGradient","NovaCompositionCoorpacademyLogoCoorp","LogoCoorp","NovaCompositionCoorpacademyQrCode","QrCodeIcon","NovaCompositionCoorpacademyEmail","MailIcon","useAnimateProp","useTranslateY","Touchable","useTemplateContext","Text","createStyleSheet","theme","create","wrapper","top","bottom","left","right","flex","justifyContent","alignItems","paddingHorizontal","content","width","gradients","position","gradient","opacity","transform","rotate","gradient2","animatedLogoWrapper","animatedLogo","height","logo","padding","logoBG","backgroundColor","title","color","fontWeight","fontSize","lineHeight","paddingVertical","description","actions","buttons","button","marginVertical","flexDirection","borderRadius","overflow","ctaQrCode","colors","cta","ctaQrCodeText","marginLeft","qrCodeIcon","fill","ctaReceiveMail","ctaReceiveMailText","mailIcon","help","titleHelp","ctaHelp","textDecorationLine","Welcome","props","locales","onDemoPress","onQRCodeButtonPress","onHelpPress","onReceiveEmailButtonPress","styleSheet","setStylesheet","translateGradients","fromValue","toValue","duration","delay","translateContent","fadeInContent","property","fadeOutStartLogo","fadeInFinalLogo","scaleAnim","Value","current","interpolateScale","interpolate","inputRange","outputRange","_stylesheet","start","animatedScale","timing","useNativeDriver","animatedStyle","scale"],"sources":["../../../../src/template/mobile-login/welcome/index.native.tsx"],"sourcesContent":["import React, {useEffect, useRef, useState} from 'react';\nimport {Animated, StyleSheet, TextStyle, View, ViewStyle} from 'react-native';\nimport LinearGradient from 'react-native-linear-gradient';\nimport {\n NovaCompositionCoorpacademyLogoCoorp as LogoCoorp,\n NovaCompositionCoorpacademyQrCode as QrCodeIcon,\n NovaCompositionCoorpacademyEmail as MailIcon\n} from '@coorpacademy/nova-icons';\nimport {useAnimateProp, useTranslateY} from '@coorpacademy/react-native-animation';\nimport Touchable from '../../../hoc/touchable/index.native';\nimport {useTemplateContext} from '../../app-review/template-context';\nimport {Theme} from '../../../variables/theme.native';\nimport Text from '../../../atom/text/index.native';\n\ntype StyleSheetType = {\n wrapper: ViewStyle;\n animatedLogoWrapper: ViewStyle;\n animatedLogo: ViewStyle;\n logo: ViewStyle;\n logoBG: ViewStyle;\n content: ViewStyle;\n gradients: ViewStyle;\n gradient: ViewStyle;\n gradient2: ViewStyle;\n title: TextStyle;\n description: TextStyle;\n actions: ViewStyle;\n buttons: ViewStyle;\n button: ViewStyle;\n qrCodeIcon: ViewStyle;\n mailIcon: ViewStyle;\n ctaQrCode: ViewStyle;\n ctaQrCodeText: TextStyle;\n ctaReceiveMail: ViewStyle;\n ctaReceiveMailText: TextStyle;\n help: ViewStyle;\n titleHelp: TextStyle;\n ctaHelp: ViewStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n wrapper: {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n flex: 1,\n justifyContent: 'space-around',\n alignItems: 'center',\n paddingHorizontal: 24\n },\n content: {\n width: '100%',\n alignItems: 'flex-start'\n },\n gradients: {\n position: 'absolute',\n top: 400,\n bottom: 400,\n left: 0,\n right: 0,\n flex: 1\n },\n gradient: {\n position: 'absolute',\n top: -730,\n bottom: 0,\n left: -380,\n right: -380,\n opacity: 1,\n transform: [{rotate: '35deg'}]\n },\n gradient2: {\n position: 'absolute',\n top: -630,\n bottom: -200,\n left: -300,\n right: -400,\n opacity: 0.6,\n transform: [{rotate: '-35deg'}]\n },\n animatedLogoWrapper: {\n alignItems: 'center'\n },\n animatedLogo: {\n position: 'absolute',\n width: 77,\n height: 100\n },\n logo: {\n padding: 100\n },\n logoBG: {\n backgroundColor: '#fff',\n top: 20,\n width: 60,\n height: 60\n },\n title: {\n color: '#1D1D2B',\n fontWeight: '600',\n fontSize: 28,\n lineHeight: 36,\n paddingVertical: 8\n },\n description: {\n color: '#1D1D2B',\n fontWeight: '400',\n fontSize: 17,\n lineHeight: 24,\n paddingVertical: 8\n },\n actions: {\n width: '100%'\n },\n buttons: {\n paddingVertical: 20,\n alignItems: 'center'\n },\n button: {\n paddingVertical: 12,\n marginVertical: 4,\n width: '100%',\n flexDirection: 'row',\n justifyContent: 'center',\n borderRadius: 12,\n alignItems: 'center',\n overflow: 'hidden'\n },\n ctaQrCode: {\n backgroundColor: theme.colors.cta\n },\n ctaQrCodeText: {\n marginLeft: 8,\n color: '#fff',\n fontWeight: '700',\n fontSize: 14,\n lineHeight: 24\n },\n qrCodeIcon: {\n fill: '#fff',\n height: 14,\n width: 14\n },\n ctaReceiveMail: {\n backgroundColor: '#eaeaeb'\n },\n ctaReceiveMailText: {\n marginLeft: 8,\n color: '#1D1D2B',\n fontWeight: '700',\n fontSize: 14,\n lineHeight: 24\n },\n mailIcon: {\n fill: '#1D1D2B',\n height: 12,\n width: 16\n },\n help: {\n flexDirection: 'row',\n justifyContent: 'center'\n },\n titleHelp: {\n color: '#9999A8'\n },\n ctaHelp: {\n marginLeft: 5,\n textDecorationLine: 'underline',\n color: '#9999A8'\n }\n });\n\nexport type Props = {\n onDemoPress: () => void;\n onHelpPress: () => void;\n onQRCodeButtonPress: () => void;\n onReceiveEmailButtonPress: () => void;\n locales: {\n title: string;\n description: string;\n ctaQrCode: string;\n ctaReceiveMail: string;\n titleHelp: string;\n ctaHelp: string;\n };\n};\n\nconst Welcome = (props: Props) => {\n const {locales, onDemoPress, onQRCodeButtonPress, onHelpPress, onReceiveEmailButtonPress} = props;\n const {theme} = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n\n const translateGradients = useTranslateY({\n fromValue: 0,\n toValue: -200,\n duration: 300,\n delay: 750\n });\n\n const translateContent = useTranslateY({\n fromValue: 170,\n toValue: 0,\n duration: 450,\n delay: 750\n });\n\n const fadeInContent = useAnimateProp({\n property: 'opacity',\n fromValue: 0,\n toValue: 1,\n duration: 650,\n delay: 750\n });\n\n const fadeOutStartLogo = useAnimateProp({\n property: 'opacity',\n fromValue: 1,\n toValue: 0,\n duration: 450,\n delay: 1000\n });\n\n const fadeInFinalLogo = useAnimateProp({\n property: 'opacity',\n fromValue: 0,\n toValue: 1,\n duration: 250,\n delay: 900\n });\n\n const scaleAnim = useRef<Animated.Value>(new Animated.Value(0)).current;\n const interpolateScale = scaleAnim.interpolate({\n inputRange: [0, 0.4, 0.5, 0.6, 1],\n outputRange: [1, 1.7, 1.7, 1.7, 1]\n });\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n useEffect(() => {\n fadeInContent.start();\n fadeInFinalLogo.start();\n fadeOutStartLogo.start();\n translateContent.start();\n translateGradients.start();\n\n const animatedScale = Animated.timing(scaleAnim, {\n toValue: 1,\n duration: 1000,\n useNativeDriver: true\n });\n\n animatedScale.start();\n\n // on mount only\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n if (!styleSheet) {\n return null;\n }\n return (\n <Animated.View style={[styleSheet.wrapper, translateContent.animatedStyle]} testID=\"welcome\">\n <Animated.View style={[styleSheet.gradients, translateGradients.animatedStyle]}>\n <LinearGradient\n colors={['#0061FF', '#fff']}\n locations={[0, 0.95]}\n style={styleSheet.gradient}\n />\n <LinearGradient\n colors={['#2199AB', '#fff']}\n locations={[0, 0.95]}\n style={styleSheet.gradient2}\n />\n </Animated.View>\n\n <Touchable onLongPress={onDemoPress} style={styleSheet.logo}>\n <Animated.View\n style={[styleSheet.animatedLogoWrapper, {transform: [{scale: interpolateScale}]}]}\n >\n <Animated.View style={[styleSheet.logoBG, fadeInFinalLogo.animatedStyle]} />\n <Animated.View style={[styleSheet.animatedLogo, fadeInFinalLogo.animatedStyle]}>\n <LogoCoorp fill=\"#0061FF\" />\n </Animated.View>\n <Animated.View style={[styleSheet.animatedLogo, fadeOutStartLogo.animatedStyle]}>\n <LogoCoorp fill=\"#fff\" />\n </Animated.View>\n </Animated.View>\n </Touchable>\n <Animated.View style={[styleSheet.content, fadeInContent.animatedStyle]}>\n <Text style={styleSheet.title}>{locales.title}</Text>\n <Text style={styleSheet.description}>{locales.description}</Text>\n\n <View style={styleSheet.actions}>\n <View style={styleSheet.buttons}>\n <Touchable\n style={[styleSheet.button, styleSheet.ctaQrCode]}\n onPress={onQRCodeButtonPress}\n testID=\"qr-code-button\"\n >\n <QrCodeIcon style={styleSheet.qrCodeIcon} />\n <Text style={styleSheet.ctaQrCodeText}>{locales.ctaQrCode}</Text>\n </Touchable>\n <Touchable\n style={[styleSheet.button, styleSheet.ctaReceiveMail]}\n onPress={onReceiveEmailButtonPress}\n testID=\"receive-email-button\"\n >\n <MailIcon style={styleSheet.mailIcon} />\n <Text style={styleSheet.ctaReceiveMailText}>{locales.ctaReceiveMail}</Text>\n </Touchable>\n </View>\n <Touchable onPress={onHelpPress} style={styleSheet.help}>\n <Text style={styleSheet.titleHelp}>{locales.titleHelp}</Text>\n <Text style={styleSheet.ctaHelp}>{locales.ctaHelp}</Text>\n </Touchable>\n </View>\n </Animated.View>\n </Animated.View>\n );\n};\n\nexport default Welcome;\n"],"mappings":"AAAA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EAAoB0B,UAAU,CAACrB,SAA/B,CADT;IAEE,OAAO,EAAEkB,mBAFX;IAGE,MAAM,EAAC;EAHT,gBAKE,oBAAC,UAAD;IAAY,KAAK,EAAEG,UAAU,CAAChB;EAA9B,EALF,eAME,oBAAC,IAAD;IAAM,KAAK,EAAEgB,UAAU,CAAClB;EAAxB,GAAwCa,OAAO,CAAChB,SAAhD,CANF,CADF,eASE,oBAAC,SAAD;IACE,KAAK,EAAE,CAACqB,UAAU,CAAC1B,MAAZ,EAAoB0B,UAAU,CAACd,cAA/B,CADT;IAEE,OAAO,EAAEa,yBAFX;IAGE,MAAM,EAAC;EAHT,gBAKE,oBAAC,QAAD;IAAU,KAAK,EAAEC,UAAU,CAACZ;EAA5B,EALF,eAME,oBAAC,IAAD;IAAM,KAAK,EAAEY,UAAU,CAACb;EAAxB,GAA6CQ,OAAO,CAACT,cAArD,CANF,CATF,CADF,eAmBE,oBAAC,SAAD;IAAW,OAAO,EAAEY,WAApB;IAAiC,KAAK,EAAEE,UAAU,CAACX;EAAnD,gBACE,oBAAC,IAAD;IAAM,KAAK,EAAEW,UAAU,CAACV;EAAxB,GAAoCK,OAAO,CAACL,SAA5C,CADF,eAEE,oBAAC,IAAD;IAAM,KAAK,EAAEU,UAAU,CAACT;EAAxB,GAAkCI,OAAO,CAACJ,OAA1C,CAFF,CAnBF,CAJF,CA3BF,CADF;AA2DD,CAvID;;AAyIA,eAAeE,OAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/button/index.native.tsx"],"names":[],"mappings":";AACA,OAAO,EAAa,SAAS,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AA8B9D,aAAK,WAAW,GAAG;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,QAAA,MAAM,MAAM,UAAW,WAAW,
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/button/index.native.tsx"],"names":[],"mappings":";AACA,OAAO,EAAa,SAAS,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AA8B9D,aAAK,WAAW,GAAG;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,QAAA,MAAM,MAAM,UAAW,WAAW,uBA4BjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -19,6 +19,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
21
|
|
|
22
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
23
|
+
|
|
22
24
|
const createStyle = (theme, brandTheme) => _reactNative.StyleSheet.create({
|
|
23
25
|
wrapper: {
|
|
24
26
|
backgroundColor: brandTheme?.colors?.primary || theme.colors.text.primary,
|
|
@@ -57,6 +59,9 @@ const Button = props => {
|
|
|
57
59
|
setStylesheet(_style);
|
|
58
60
|
}, [theme, brandTheme]);
|
|
59
61
|
if (!styleSheet) return null;
|
|
62
|
+
|
|
63
|
+
const _textStyle = _extends({}, styleSheet.text, textStyle);
|
|
64
|
+
|
|
60
65
|
return /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
61
66
|
testID: testID,
|
|
62
67
|
onPress: onPress,
|
|
@@ -64,7 +69,7 @@ const Button = props => {
|
|
|
64
69
|
accessibilityLabel: accessibilityLabel,
|
|
65
70
|
style: [styleSheet.wrapper, style]
|
|
66
71
|
}, /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
67
|
-
style:
|
|
72
|
+
style: _textStyle
|
|
68
73
|
}, submitValue));
|
|
69
74
|
};
|
|
70
75
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["createStyle","theme","brandTheme","StyleSheet","create","wrapper","backgroundColor","colors","primary","text","borderRadius","width","fontSize","lineHeight","fontWeight","color","white","marginBottom","marginTop","textAlign","Button","props","accessibilityLabel","disabled","onPress","style","submitValue","testID","textStyle","useTemplateContext","styleSheet","setStylesheet","useState","useEffect","_style"],"sources":["../../../src/atom/button/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {StyleSheet, TextStyle, ViewStyle} from 'react-native';\nimport Text from '../text/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {Brand} from '../../variables/brand.native';\n\ntype StyleSheetType = {\n wrapper: ViewStyle;\n text:
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["createStyle","theme","brandTheme","StyleSheet","create","wrapper","backgroundColor","colors","primary","text","borderRadius","width","fontSize","lineHeight","fontWeight","color","white","marginBottom","marginTop","textAlign","Button","props","accessibilityLabel","disabled","onPress","style","submitValue","testID","textStyle","useTemplateContext","styleSheet","setStylesheet","useState","useEffect","_style","_textStyle"],"sources":["../../../src/atom/button/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {StyleSheet, TextStyle, ViewStyle} from 'react-native';\nimport Text from '../text/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {Brand} from '../../variables/brand.native';\n\ntype StyleSheetType = {\n wrapper: ViewStyle;\n text: TextStyle;\n};\n\nconst createStyle = (theme: Theme, brandTheme: Brand): StyleSheetType =>\n StyleSheet.create({\n wrapper: {\n backgroundColor: brandTheme?.colors?.primary || theme.colors.text.primary,\n borderRadius: 7,\n width: '100%'\n },\n text: {\n fontSize: 14,\n lineHeight: 20,\n fontWeight: '700',\n color: theme.colors.white,\n marginBottom: 16,\n marginTop: 16,\n textAlign: 'center'\n }\n });\n\ntype ButtonProps = {\n accessibilityLabel?: string;\n disabled?: boolean;\n onPress: () => void;\n style?: ViewStyle;\n submitValue: string;\n testID?: string;\n textStyle?: TextStyle;\n};\n\nconst Button = (props: ButtonProps) => {\n const {accessibilityLabel, disabled, onPress, style, submitValue, testID, textStyle} = props;\n const {theme, brandTheme} = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType>();\n\n useEffect(() => {\n const _style = createStyle(theme, brandTheme);\n setStylesheet(_style);\n }, [theme, brandTheme]);\n\n if (!styleSheet) return null;\n\n const _textStyle = {\n ...styleSheet.text,\n ...textStyle\n };\n\n return (\n <Touchable\n testID={testID}\n onPress={onPress}\n disabled={disabled}\n accessibilityLabel={accessibilityLabel}\n style={[styleSheet.wrapper, style]}\n >\n <Text style={_textStyle}>{submitValue}</Text>\n </Touchable>\n );\n};\n\nexport default Button;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;AAQA,MAAMA,WAAW,GAAG,CAACC,KAAD,EAAeC,UAAf,KAClBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,OAAO,EAAE;IACPC,eAAe,EAAEJ,UAAU,EAAEK,MAAZ,EAAoBC,OAApB,IAA+BP,KAAK,CAACM,MAAN,CAAaE,IAAb,CAAkBD,OAD3D;IAEPE,YAAY,EAAE,CAFP;IAGPC,KAAK,EAAE;EAHA,CADO;EAMhBF,IAAI,EAAE;IACJG,QAAQ,EAAE,EADN;IAEJC,UAAU,EAAE,EAFR;IAGJC,UAAU,EAAE,KAHR;IAIJC,KAAK,EAAEd,KAAK,CAACM,MAAN,CAAaS,KAJhB;IAKJC,YAAY,EAAE,EALV;IAMJC,SAAS,EAAE,EANP;IAOJC,SAAS,EAAE;EAPP;AANU,CAAlB,CADF;;AA4BA,MAAMC,MAAM,GAAIC,KAAD,IAAwB;EACrC,MAAM;IAACC,kBAAD;IAAqBC,QAArB;IAA+BC,OAA/B;IAAwCC,KAAxC;IAA+CC,WAA/C;IAA4DC,MAA5D;IAAoEC;EAApE,IAAiFP,KAAvF;EACA,MAAM;IAACpB,KAAD;IAAQC;EAAR,IAAsB,IAAA2B,mCAAA,GAA5B;EACA,MAAM,CAACC,UAAD,EAAaC,aAAb,IAA8B,IAAAC,eAAA,GAApC;EAEA,IAAAC,gBAAA,EAAU,MAAM;IACd,MAAMC,MAAM,GAAGlC,WAAW,CAACC,KAAD,EAAQC,UAAR,CAA1B;;IACA6B,aAAa,CAACG,MAAD,CAAb;EACD,CAHD,EAGG,CAACjC,KAAD,EAAQC,UAAR,CAHH;EAKA,IAAI,CAAC4B,UAAL,EAAiB,OAAO,IAAP;;EAEjB,MAAMK,UAAU,gBACXL,UAAU,CAACrB,IADA,EAEXmB,SAFW,CAAhB;;EAKA,oBACE,6BAAC,eAAD;IACE,MAAM,EAAED,MADV;IAEE,OAAO,EAAEH,OAFX;IAGE,QAAQ,EAAED,QAHZ;IAIE,kBAAkB,EAAED,kBAJtB;IAKE,KAAK,EAAE,CAACQ,UAAU,CAACzB,OAAZ,EAAqBoB,KAArB;EALT,gBAOE,6BAAC,cAAD;IAAM,KAAK,EAAEU;EAAb,GAA0BT,WAA1B,CAPF,CADF;AAWD,CA5BD;;eA8BeN,M"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link/index.tsx"],"names":[],"mappings":";AAKA,OAAkB,EAAC,eAAe,EAAW,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link/index.tsx"],"names":[],"mappings":";AAKA,OAAkB,EAAC,eAAe,EAAW,MAAM,SAAS,CAAC;AAwB7D,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;;;;;;;;;;;;;;;CAqEzC,CAAC;AAIF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["getButtonContent","icon","label","type","position","Icon","ICONS","style","buttonContent","ButtonLink","props","disabled","dataName","dataTestId","ariaLabel","link","onClick","onKeyDown","className","customStyle","useTitle","contentView","styleButton","classnames","button","primary","secondary","tertiary","text","dangerous","handleOnClick","useCallback","handleOnKeyDown","event","title","propTypes"],"sources":["../../../src/atom/button-link/index.tsx"],"sourcesContent":["import React, {useCallback} from 'react';\nimport {noop} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Link from '../link';\nimport {ICONS} from '../../util/button-icons';\nimport propTypes, {ButtonLinkProps, IconType} from './types';\
|
|
1
|
+
{"version":3,"file":"index.js","names":["getButtonContent","icon","label","type","position","Icon","ICONS","style","buttonContent","ButtonLink","props","disabled","dataName","dataTestId","ariaLabel","link","onClick","onKeyDown","className","customStyle","useTitle","contentView","styleButton","classnames","button","primary","secondary","tertiary","text","dangerous","handleOnClick","useCallback","handleOnKeyDown","event","title","propTypes"],"sources":["../../../src/atom/button-link/index.tsx"],"sourcesContent":["import React, {useCallback} from 'react';\nimport {noop} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Link from '../link';\nimport {ICONS} from '../../util/button-icons';\nimport propTypes, {ButtonLinkProps, IconType} from './types';\nimport style from './style.css';\n\nconst getButtonContent = (icon?: IconType, label?: string) => {\n const {type, position} = icon || {type: '', position: ''};\n const Icon = type && ICONS[type];\n\n if (!Icon) {\n return (\n <div className={style.buttonContent}>\n <span className={style.label}>{label}</span>\n </div>\n );\n }\n\n return (\n <div className={style.buttonContent}>\n {position === 'left' ? <Icon className={style.icon} /> : null}\n <span className={style.label}>{label}</span>\n {position === 'right' ? <Icon className={style.icon} /> : null}\n </div>\n );\n};\n\nconst ButtonLink = (props: ButtonLinkProps) => {\n const {\n type,\n label,\n disabled,\n icon,\n 'data-name': dataName,\n 'data-testid': dataTestId = 'button-link',\n 'aria-label': ariaLabel,\n link,\n onClick = noop,\n onKeyDown = noop,\n className,\n customStyle,\n useTitle = true\n } = props;\n const contentView = getButtonContent(icon, label);\n const styleButton = classnames(\n className,\n style.button,\n type === 'primary' && style.primary,\n type === 'secondary' && style.secondary,\n type === 'tertiary' && style.tertiary,\n type === 'text' && style.text,\n type === 'dangerous' && style.dangerous,\n link && style.link,\n disabled && style.disabled\n );\n\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n\n const handleOnKeyDown = useCallback(event => onKeyDown(event), [onKeyDown]);\n\n if (link) {\n return (\n <Link\n {...link}\n {...(useTitle && {\n title: ariaLabel || label\n })}\n style={customStyle}\n className={styleButton}\n data-name={dataName}\n data-testid={dataTestId}\n aria-label={ariaLabel || label}\n >\n {contentView}\n </Link>\n );\n }\n\n return (\n <button\n {...(useTitle && {\n title: ariaLabel || label\n })}\n type=\"button\"\n aria-label={ariaLabel || label}\n data-name={dataName}\n data-testid={dataTestId}\n style={customStyle}\n className={styleButton}\n onClick={handleOnClick}\n onKeyDown={handleOnKeyDown}\n tabIndex={0}\n >\n {contentView}\n </button>\n );\n};\n\nButtonLink.propTypes = propTypes;\n\nexport default ButtonLink;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,gBAAgB,GAAG,CAACC,IAAD,EAAkBC,KAAlB,KAAqC;EAC5D,MAAM;IAACC,IAAD;IAAOC;EAAP,IAAmBH,IAAI,IAAI;IAACE,IAAI,EAAE,EAAP;IAAWC,QAAQ,EAAE;EAArB,CAAjC;EACA,MAAMC,IAAI,GAAGF,IAAI,IAAIG,kBAAA,CAAMH,IAAN,CAArB;;EAEA,IAAI,CAACE,IAAL,EAAW;IACT,oBACE;MAAK,SAAS,EAAEE,cAAA,CAAMC;IAAtB,gBACE;MAAM,SAAS,EAAED,cAAA,CAAML;IAAvB,GAA+BA,KAA/B,CADF,CADF;EAKD;;EAED,oBACE;IAAK,SAAS,EAAEK,cAAA,CAAMC;EAAtB,GACGJ,QAAQ,KAAK,MAAb,gBAAsB,6BAAC,IAAD;IAAM,SAAS,EAAEG,cAAA,CAAMN;EAAvB,EAAtB,GAAwD,IAD3D,eAEE;IAAM,SAAS,EAAEM,cAAA,CAAML;EAAvB,GAA+BA,KAA/B,CAFF,EAGGE,QAAQ,KAAK,OAAb,gBAAuB,6BAAC,IAAD;IAAM,SAAS,EAAEG,cAAA,CAAMN;EAAvB,EAAvB,GAAyD,IAH5D,CADF;AAOD,CAnBD;;AAqBA,MAAMQ,UAAU,GAAIC,KAAD,IAA4B;EAC7C,MAAM;IACJP,IADI;IAEJD,KAFI;IAGJS,QAHI;IAIJV,IAJI;IAKJ,aAAaW,QALT;IAMJ,eAAeC,UAAU,GAAG,aANxB;IAOJ,cAAcC,SAPV;IAQJC,IARI;IASJC,OA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SAAS,IAAIZ,KAL3B;IAME,aAAWU,QANb;IAOE,eAAaC,UAPf;IAQE,KAAK,EAAEM,WART;IASE,SAAS,EAAEG,WATb;IAUE,OAAO,EAAEQ,aAVX;IAWE,SAAS,EAAEE,eAXb;IAYE,QAAQ,EAAE;EAZZ,IAcGX,WAdH,CADF;AAkBD,CArED;;AAuEAZ,UAAU,CAAC0B,SAAX,2CAAuBA,cAAvB;eAEe1B,U"}
|
|
@@ -13,7 +13,7 @@ var _theme = require("../../variables/theme.native");
|
|
|
13
13
|
|
|
14
14
|
var _templateContext = require("../../template/app-review/template-context");
|
|
15
15
|
|
|
16
|
-
var _index =
|
|
16
|
+
var _index = _interopRequireDefault(require("../text/index.native"));
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
@@ -89,7 +89,7 @@ const Html = props => {
|
|
|
89
89
|
img: imageStyle || {}
|
|
90
90
|
});
|
|
91
91
|
|
|
92
|
-
let baseFontStyle = (0, _react.useMemo)(() =>
|
|
92
|
+
let baseFontStyle = (0, _react.useMemo)(() => ({
|
|
93
93
|
fontSize,
|
|
94
94
|
color: theme.colors.black
|
|
95
95
|
}), [fontSize, theme]);
|