@coorpacademy/components 10.30.2 → 10.30.4-alpha.1
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/text/index.native.d.ts +1 -0
- package/es/atom/text/index.native.d.ts.map +1 -1
- package/es/atom/text/index.native.js +4 -2
- package/es/atom/text/index.native.js.map +1 -1
- package/es/hoc/touchable/index.native.d.ts +1 -0
- package/es/hoc/touchable/index.native.d.ts.map +1 -1
- package/es/hoc/touchable/index.native.js.map +1 -1
- package/es/molecule/review-correction-popin/index.native.d.ts +5 -0
- package/es/molecule/review-correction-popin/index.native.d.ts.map +1 -0
- package/es/molecule/review-correction-popin/index.native.js +316 -0
- package/es/molecule/review-correction-popin/index.native.js.map +1 -0
- package/es/molecule/review-correction-popin/prop-types.d.ts +7 -5
- package/es/molecule/review-correction-popin/prop-types.d.ts.map +1 -1
- package/es/molecule/review-correction-popin/prop-types.js.map +1 -1
- package/es/organism/review-slide/index.native.d.ts.map +1 -1
- package/es/organism/review-slide/index.native.js +16 -15
- package/es/organism/review-slide/index.native.js.map +1 -1
- package/es/template/common/dashboard/index.d.ts +1 -0
- package/es/template/common/dashboard/index.d.ts.map +1 -1
- package/es/template/common/dashboard/index.js +13 -1
- package/es/template/common/dashboard/index.js.map +1 -1
- package/lib/atom/text/index.native.d.ts +1 -0
- package/lib/atom/text/index.native.d.ts.map +1 -1
- package/lib/atom/text/index.native.js +4 -2
- package/lib/atom/text/index.native.js.map +1 -1
- package/lib/hoc/touchable/index.native.d.ts +1 -0
- package/lib/hoc/touchable/index.native.d.ts.map +1 -1
- package/lib/hoc/touchable/index.native.js.map +1 -1
- package/lib/molecule/review-correction-popin/index.native.d.ts +5 -0
- package/lib/molecule/review-correction-popin/index.native.d.ts.map +1 -0
- package/lib/molecule/review-correction-popin/index.native.js +334 -0
- package/lib/molecule/review-correction-popin/index.native.js.map +1 -0
- package/lib/molecule/review-correction-popin/prop-types.d.ts +7 -5
- package/lib/molecule/review-correction-popin/prop-types.d.ts.map +1 -1
- package/lib/molecule/review-correction-popin/prop-types.js.map +1 -1
- package/lib/organism/review-slide/index.native.d.ts.map +1 -1
- package/lib/organism/review-slide/index.native.js +19 -16
- package/lib/organism/review-slide/index.native.js.map +1 -1
- package/lib/template/common/dashboard/index.d.ts +1 -0
- package/lib/template/common/dashboard/index.d.ts.map +1 -1
- package/lib/template/common/dashboard/index.js +13 -1
- package/lib/template/common/dashboard/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useEffect","useState","StyleSheet","useWindowDimensions","View","get","getOr","Text","Answer","useTemplateContext","Touchable","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","klf","information","label","message","next","_correctionPopinProps","onClick","console","log","type","resultLabel","toString","createQuestionStyle","theme","brandTheme","create","questionHeading","justifyContent","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","marginTop","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesContainer","flex","width","validateButton","backgroundColor","borderRadius","validateButtonText","white","Question","props","answerUI","style","setStyle","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","position","left","bottom","height","alignItems","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","Slide","slideStyle","loading","parentContentTitle"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {StyleSheet, TextStyle, useWindowDimensions, View, ViewStyle} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\n// import Loader from '../../atom/loader';\n// import ReviewCorrectionPopin from '../../molecule/review-correction-popin';\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';\nimport {ReviewCorrectionPopinProps} from '../../molecule/review-correction-popin/prop-types';\nimport {ReviewSlideProps, SlideProps} from './prop-types';\n\ntype PopinProps = {\n correctionPopinProps: ReviewCorrectionPopinProps;\n slideIndex: unknown;\n showCorrectionPopin: unknown;\n animateCorrectionPopin: unknown;\n};\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n animateCorrectionPopin\n}: PopinProps) => {\n if (!showCorrectionPopin) return null;\n\n const klf = getOr({}, 'klf', correctionPopinProps);\n const information = getOr({label: '', message: ''}, 'information', correctionPopinProps);\n const next = get('next', correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick: () => {\n // eslint-disable-next-line no-console\n console.log('Next Slide');\n },\n label: next && next.label,\n 'data-name': `next-question-button-${slideIndex}`,\n 'aria-label': next && next['aria-label']\n },\n klf,\n information,\n type: correctionPopinProps.type,\n resultLabel: correctionPopinProps.resultLabel\n };\n\n return (\n <Text>@todo ReviewCorrectionPopin {_correctionPopinProps.toString()}</Text>\n // <ReviewCorrectionPopin {..._correctionPopinProps} />\n );\n};\n\n// const ValidateButton = ({slideIndex, validateButton, primarySkinColor}) => {\n// const {label, onClick, disabled} = validateButton;\n// const validateButtonProps = {\n// type: 'primary',\n// label,\n// 'aria-label': label,\n// 'data-name': `slide-validate-button-${slideIndex}`,\n// onClick,\n// disabled,\n// customStyle: {\n// backgroundColor: primarySkinColor\n// }\n// };\n\n// return <Button title=\"validate todo\" />;\n// };\n\ntype StyleSheetType = {\n questionHeading: ViewStyle;\n questionOrigin: ViewStyle;\n questionText: TextStyle;\n questionHelp: ViewStyle;\n choicesContainer: ViewStyle;\n validateButton: ViewStyle;\n validateButtonText: ViewStyle;\n};\n\nconst createQuestionStyle = (theme: Theme, brandTheme: Brand): StyleSheetType =>\n StyleSheet.create({\n questionHeading: {\n justifyContent: 'space-between'\n },\n questionOrigin: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.text.primary,\n marginBottom: theme.spacing.tiny,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n questionText: {\n fontSize: 16,\n lineHeight: 22,\n fontWeight: '700',\n color: theme.colors.text.primary,\n textAlign: 'center'\n },\n questionHelp: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.gray.medium,\n marginBottom: 0,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n choicesContainer: {\n flex: 1,\n width: '100%',\n justifyContent: 'center'\n },\n validateButton: {\n backgroundColor: brandTheme?.colors?.primary || theme.colors.text.primary,\n borderRadius: 7,\n width: '100%'\n },\n validateButtonText: {\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 QuestionProps = {\n answerUI: SlideProps['answerUI'];\n questionText: SlideProps['questionText'];\n questionOrigin: SlideProps['parentContentTitle'];\n};\n\nconst Question = (props: QuestionProps) => {\n const {answerUI, questionText, questionOrigin} = props;\n const {theme, brandTheme} = useTemplateContext();\n const [style, setStyle] = useState<StyleSheetType>();\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme, brandTheme);\n setStyle(questionStyle);\n }, [theme, brandTheme]);\n\n if (!answerUI || !questionText || !style) return null;\n\n return (\n <>\n <View style={style.questionHeading}>\n <Text style={style.questionOrigin}>{questionOrigin}</Text>\n <Text style={style.questionText}>{questionText}</Text>\n <Text style={style.questionHelp}>{get('help', answerUI)}</Text>\n </View>\n <View style={style.choicesContainer}>\n <Answer {...answerUI} />\n </View>\n <Touchable style={style.validateButton}>\n <Text style={style.validateButtonText}>@todo validate</Text>\n </Touchable>\n </>\n );\n};\n\ntype SlideStyle = {\n slide: ViewStyle;\n};\n\nconst createSlideStyle = (num: number, screenWidth: number): SlideStyle => {\n const slideWidth = screenWidth - 40 - num * 8;\n\n return StyleSheet.create({\n slide: {\n position: 'absolute',\n left: 20 + num * 4,\n bottom: 34 + num * 5,\n backgroundColor: '#fff', // theme.colors.white\n height: '90%',\n width: slideWidth,\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 25,\n shadowColor: '#000',\n shadowOffset: {width: 0, height: -1},\n shadowOpacity: 0.05,\n shadowRadius: 16,\n elevation: 10 - num * 1,\n borderRadius: 16\n }\n });\n};\n\nconst Slide = (props: ReviewSlideProps) => {\n const {slide, correctionPopinProps, num, slideIndex = '0'} = props;\n\n const {width} = useWindowDimensions();\n const slideStyle = createSlideStyle(num, width);\n\n const {\n loading,\n parentContentTitle,\n questionText,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n return (\n <View style={slideStyle.slide}>\n {loading ? (\n // <Loader className={style.loader} theme=\"default\" aria-label={loadingAriaLabel} />\n <Text>@todo loader {num}</Text>\n ) : (\n <>\n <Question\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\n />\n {correctionPopinProps ? (\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\n key=\"correction-popin\"\n />\n ) : null}\n </>\n )}\n </View>\n );\n};\n\nexport default Slide;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,SAAf,EAA0BC,QAA1B,QAAyC,OAAzC;AACA,SAAQC,UAAR,EAA+BC,mBAA/B,EAAoDC,IAApD,QAA0E,cAA1E;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,IAAP,MAAiB,8BAAjB;AACA,OAAOC,MAAP,MAAmB,oCAAnB,C,CACA;AACA;;AACA,SAAQC,kBAAR,QAAiC,4CAAjC;AAEA,OAAOC,SAAP,MAAsB,kCAAtB;;AAYA,MAAMC,eAAe,GAAG,CAAC;EACvBC,oBADuB;EAEvBC,UAFuB;EAGvBC,mBAHuB;EAIvB;EACAC;A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KE,GAAG,EAAC;EALN,EADmB,GAQjB,IAfN,CALJ,CADF;AA0BD,CAzCD;;AA2CA,eAAemE,KAAf"}
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useEffect","useState","StyleSheet","useWindowDimensions","View","get","getOr","Text","Answer","ReviewCorrectionPopin","useTemplateContext","Touchable","styles","create","correctionPopinWrapper","position","bottom","width","CorrectionPopin","correctionPopinProps","slideIndex","klf","undefined","information","label","message","next","onClick","_correctionPopinProps","type","resultLabel","createQuestionStyle","theme","brandTheme","questionHeading","justifyContent","questionOrigin","fontSize","lineHeight","color","colors","text","primary","marginBottom","spacing","tiny","marginTop","small","textAlign","questionText","fontWeight","questionHelp","gray","medium","choicesContainer","flex","validateButton","backgroundColor","borderRadius","validateButtonText","white","Question","props","answerUI","style","setStyle","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","left","height","alignItems","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","Slide","slideStyle","loading","parentContentTitle","showCorrectionPopin","animateCorrectionPopin"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {StyleSheet, TextStyle, useWindowDimensions, View, ViewStyle} from 'react-native';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport Text from '../../atom/text/index.native';\nimport Answer from '../../molecule/answer/index.native';\nimport ReviewCorrectionPopin from '../../molecule/review-correction-popin/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';\nimport {ReviewCorrectionPopinProps} from '../../molecule/review-correction-popin/prop-types';\nimport {ReviewSlideProps, SlideProps} from './prop-types';\n\ntype PopinProps = {\n correctionPopinProps: ReviewCorrectionPopinProps;\n slideIndex: unknown;\n showCorrectionPopin: unknown;\n animateCorrectionPopin: unknown;\n};\n\nconst styles = StyleSheet.create({\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst CorrectionPopin = ({correctionPopinProps, slideIndex}: PopinProps) => {\n const klf = getOr(undefined, 'klf', correctionPopinProps);\n const information = getOr({label: '', message: ''}, 'information', correctionPopinProps);\n const next = get('next', correctionPopinProps);\n const onClick = get(['next', 'onClick'], correctionPopinProps);\n\n const _correctionPopinProps = {\n next: {\n onClick,\n label: next && next.label,\n 'data-name': `next-question-button-${slideIndex}`,\n 'aria-label': next && next['aria-label']\n },\n klf,\n information,\n type: correctionPopinProps.type,\n resultLabel: correctionPopinProps.resultLabel\n };\n\n return (\n <View style={styles.correctionPopinWrapper}>\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </View>\n );\n};\n\n// const ValidateButton = ({slideIndex, validateButton, primarySkinColor}) => {\n// const {label, onClick, disabled} = validateButton;\n// const validateButtonProps = {\n// type: 'primary',\n// label,\n// 'aria-label': label,\n// 'data-name': `slide-validate-button-${slideIndex}`,\n// onClick,\n// disabled,\n// customStyle: {\n// backgroundColor: primarySkinColor\n// }\n// };\n\n// return <Button title=\"validate todo\" />;\n// };\n\ntype StyleSheetType = {\n questionHeading: ViewStyle;\n questionOrigin: ViewStyle;\n questionText: TextStyle;\n questionHelp: ViewStyle;\n choicesContainer: ViewStyle;\n validateButton: ViewStyle;\n validateButtonText: ViewStyle;\n};\n\nconst createQuestionStyle = (theme: Theme, brandTheme: Brand): StyleSheetType =>\n StyleSheet.create({\n questionHeading: {\n justifyContent: 'space-between'\n },\n questionOrigin: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.text.primary,\n marginBottom: theme.spacing.tiny,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n questionText: {\n fontSize: 16,\n lineHeight: 22,\n fontWeight: '700',\n color: theme.colors.text.primary,\n textAlign: 'center'\n },\n questionHelp: {\n fontSize: 12,\n lineHeight: 16,\n color: theme.colors.gray.medium,\n marginBottom: 0,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n },\n choicesContainer: {\n flex: 1,\n width: '100%',\n justifyContent: 'center'\n },\n validateButton: {\n backgroundColor: brandTheme?.colors?.primary || theme.colors.text.primary,\n borderRadius: 7,\n width: '100%'\n },\n validateButtonText: {\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 QuestionProps = {\n answerUI: SlideProps['answerUI'];\n questionText: SlideProps['questionText'];\n questionOrigin: SlideProps['parentContentTitle'];\n};\n\nconst Question = (props: QuestionProps) => {\n const {answerUI, questionText, questionOrigin} = props;\n const {theme, brandTheme} = useTemplateContext();\n const [style, setStyle] = useState<StyleSheetType>();\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme, brandTheme);\n setStyle(questionStyle);\n }, [theme, brandTheme]);\n\n if (!answerUI || !questionText || !style) return null;\n\n return (\n <>\n <View style={style.questionHeading}>\n <Text style={style.questionOrigin}>{questionOrigin}</Text>\n <Text style={style.questionText}>{questionText}</Text>\n <Text style={style.questionHelp}>{get('help', answerUI)}</Text>\n </View>\n <View style={style.choicesContainer}>\n <Answer {...answerUI} />\n </View>\n <Touchable style={style.validateButton}>\n <Text style={style.validateButtonText}>@todo validate</Text>\n </Touchable>\n </>\n );\n};\n\ntype SlideStyle = {\n slide: ViewStyle;\n};\n\nconst createSlideStyle = (num: number, screenWidth: number): SlideStyle => {\n const slideWidth = screenWidth - 40 - num * 8;\n\n return StyleSheet.create({\n slide: {\n position: 'absolute',\n left: 20 + num * 4,\n bottom: 34 + num * 5,\n backgroundColor: '#fff', // theme.colors.white\n height: '90%',\n width: slideWidth,\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 25,\n shadowColor: '#000',\n shadowOffset: {width: 0, height: -1},\n shadowOpacity: 0.05,\n shadowRadius: 16,\n elevation: 10 - num * 1,\n borderRadius: 16\n }\n });\n};\n\nconst Slide = (props: ReviewSlideProps) => {\n const {slide, correctionPopinProps, num, slideIndex = '0'} = props;\n\n const {width} = useWindowDimensions();\n const slideStyle = createSlideStyle(num, width);\n\n const {\n loading,\n parentContentTitle,\n questionText,\n answerUI,\n showCorrectionPopin,\n animateCorrectionPopin\n } = slide;\n\n return (\n <View style={slideStyle.slide}>\n {loading ? (\n // <Loader className={style.loader} theme=\"default\" aria-label={loadingAriaLabel} />\n <Text>@todo loader {num}</Text>\n ) : (\n <>\n <Question\n questionOrigin={parentContentTitle}\n questionText={questionText}\n answerUI={answerUI}\n key=\"question-container\"\n />\n {correctionPopinProps ? (\n <CorrectionPopin\n correctionPopinProps={correctionPopinProps}\n slideIndex={slideIndex}\n showCorrectionPopin={showCorrectionPopin}\n animateCorrectionPopin={animateCorrectionPopin}\n key=\"correction-popin\"\n />\n ) : null}\n </>\n )}\n </View>\n );\n};\n\nexport default Slide;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,SAAf,EAA0BC,QAA1B,QAAyC,OAAzC;AACA,SAAQC,UAAR,EAA+BC,mBAA/B,EAAoDC,IAApD,QAA0E,cAA1E;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,IAAP,MAAiB,8BAAjB;AACA,OAAOC,MAAP,MAAmB,oCAAnB;AACA,OAAOC,qBAAP,MAAkC,qDAAlC;AACA,SAAQC,kBAAR,QAAiC,4CAAjC;AAEA,OAAOC,SAAP,MAAsB,kCAAtB;AAYA,MAAMC,MAAM,GAAGV,UAAU,CAACW,MAAX,CAAkB;EAC/BC,sBAAsB,EAAE;IACtBC,QAAQ,EAAE,UADY;IAEtBC,MAAM,EAAE,EAFc;IAGtBC,KAAK,EAAE;EAHe;AADO,CAAlB,CAAf;;AAQA,MAAMC,eAAe,GAAG,CAAC;EAACC,oBAAD;EAAuBC;AAAvB,CAAD,KAAoD;EAC1E,MAAMC,GAAG,GAAGf,KAAK,CAACgB,SAAD,EAAY,KAAZ,EAAmBH,oBAAnB,CAAjB;EACA,MAAMI,W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AAf"}
|
|
@@ -4,6 +4,7 @@ declare namespace Dashboard {
|
|
|
4
4
|
namespace propTypes {
|
|
5
5
|
const hero: any;
|
|
6
6
|
const welcome: any;
|
|
7
|
+
const onLoadMoreSections: PropTypes.Requireable<(...args: any[]) => any>;
|
|
7
8
|
const sections: PropTypes.Requireable<((PropTypes.InferPropsInner<Pick<any, any>> & Partial<PropTypes.InferPropsInner<Pick<any, never>>>) | null | undefined)[]>;
|
|
8
9
|
const cookie: PropTypes.Requireable<PropTypes.InferProps<{
|
|
9
10
|
content: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/dashboard/index.js"],"names":[],"mappings":";AAoBA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/dashboard/index.js"],"names":[],"mappings":";AAoBA,oDA8CC"}
|
|
@@ -26,7 +26,8 @@ const Dashboard = props => {
|
|
|
26
26
|
sections = [],
|
|
27
27
|
hero,
|
|
28
28
|
welcome,
|
|
29
|
-
cookie
|
|
29
|
+
cookie,
|
|
30
|
+
onLoadMoreSections
|
|
30
31
|
} = props;
|
|
31
32
|
|
|
32
33
|
const buildSectionComponent = section => {
|
|
@@ -71,6 +72,16 @@ const Dashboard = props => {
|
|
|
71
72
|
}, ...sections].map(section => /*#__PURE__*/React.createElement("div", {
|
|
72
73
|
key: section.key
|
|
73
74
|
}, buildSection(section)));
|
|
75
|
+
|
|
76
|
+
const handleScroll = () => {
|
|
77
|
+
if (window.innerHeight + document.documentElement.scrollTop + 1 >= document.scrollingElement.scrollHeight) {
|
|
78
|
+
onLoadMoreSections ? onLoadMoreSections() : null;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
window.addEventListener('scroll', handleScroll, true);
|
|
74
85
|
return /*#__PURE__*/React.createElement("div", {
|
|
75
86
|
className: style.wrapper,
|
|
76
87
|
"data-name": "dashboard"
|
|
@@ -80,6 +91,7 @@ const Dashboard = props => {
|
|
|
80
91
|
Dashboard.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
81
92
|
hero: Hero.propTypes.hero,
|
|
82
93
|
welcome: Hero.propTypes.welcome,
|
|
94
|
+
onLoadMoreSections: PropTypes.func,
|
|
83
95
|
sections: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape(BattleRequestList.propTypes), PropTypes.shape(CardsList.propTypes), PropTypes.shape(NewsList.propTypes), PropTypes.shape(StartBattle.propTypes)])),
|
|
84
96
|
cookie: PropTypes.shape(CMPopin.propTypes)
|
|
85
97
|
} : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","Slide","HeroCard","BattleRequestList","CardsList","NewsList","StartBattle","CMPopin","style","Hero","memo","hero","welcome","propTypes","shape","Dashboard","props","sections","cookie","buildSectionComponent","section","type","buildSection","index","sectionView","sectionsList","key","map","wrapper","arrayOf","oneOfType"],"sources":["../../../../src/template/common/dashboard/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Slide from '../../../atom/slide';\nimport HeroCard from '../../../molecule/hero';\nimport BattleRequestList from '../../../molecule/dashboard/battle-request-list';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport NewsList from '../../../molecule/dashboard/news-list';\nimport StartBattle from '../../../molecule/dashboard/start-battle';\nimport CMPopin from '../../../molecule/cm-popin';\nimport style from './style.css';\n\nconst Hero = React.memo(function Hero({hero, welcome}) {\n return <div className={style.hero}>{hero ? <HeroCard {...hero} /> : <Slide {...welcome} />}</div>;\n});\n\nHero.propTypes = {\n hero: PropTypes.shape(HeroCard.propTypes),\n welcome: PropTypes.shape(Slide.propTypes)\n};\n\nconst Dashboard = props => {\n const {sections = [], hero, welcome, cookie} = props;\n\n const buildSectionComponent = section => {\n const {type} = section;\n switch (type) {\n case 'hero':\n return <Hero hero={hero} welcome={welcome} />;\n case 'battleRequests':\n return <BattleRequestList {...section} />;\n case 'cards':\n return <CardsList {...section} />;\n case 'news':\n return <NewsList {...section} />;\n case 'battle':\n return <StartBattle {...section} />;\n default:\n return null;\n }\n };\n\n const buildSection = (section, index) => {\n const sectionView = buildSectionComponent(section);\n\n return <div key={index}>{sectionView}</div>;\n };\n\n const sectionsList = [{type: 'hero', key: 'hero'}, ...sections].map(section => (\n <div key={section.key}>{buildSection(section)}</div>\n ));\n return (\n <div className={style.wrapper} data-name=\"dashboard\">\n {sectionsList}\n {cookie ? <CMPopin {...cookie} /> : null}\n </div>\n );\n};\n\nDashboard.propTypes = {\n hero: Hero.propTypes.hero,\n welcome: Hero.propTypes.welcome,\n sections: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape(BattleRequestList.propTypes),\n PropTypes.shape(CardsList.propTypes),\n PropTypes.shape(NewsList.propTypes),\n PropTypes.shape(StartBattle.propTypes)\n ])\n ),\n cookie: PropTypes.shape(CMPopin.propTypes)\n};\nexport default Dashboard;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAAkB,qBAAlB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,iBAAP,MAA8B,iDAA9B;AACA,OAAOC,SAAP,MAAsB,wCAAtB;AACA,OAAOC,QAAP,MAAqB,uCAArB;AACA,OAAOC,WAAP,MAAwB,0CAAxB;AACA,OAAOC,OAAP,MAAoB,4BAApB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,IAAI,gBAAGV,KAAK,CAACW,IAAN,CAAW,SAASD,IAAT,CAAc;EAACE,IAAD;EAAOC;AAAP,CAAd,EAA+B;EACrD,oBAAO;IAAK,SAAS,EAAEJ,KAAK,CAACG;EAAtB,GAA6BA,IAAI,gBAAG,oBAAC,QAAD,EAAcA,IAAd,CAAH,gBAA4B,oBAAC,KAAD,EAAWC,OAAX,CAA7D,CAAP;AACD,CAFY,CAAb;AAIAH,IAAI,CAACI,SAAL,2CAAiB;EACfF,IAAI,EAAEX,SAAS,CAACc,KAAV,CAAgBZ,QAAQ,CAACW,SAAzB,CADS;EAEfD,OAAO,EAAEZ,SAAS,CAACc,KAAV,CAAgBb,KAAK,CAACY,SAAtB;AAFM,CAAjB;;AAKA,MAAME,SAAS,GAAGC,KAAK,IAAI;EACzB,MAAM;IAACC,QAAQ,GAAG,EAAZ;IAAgBN,IAAhB;IAAsBC,OAAtB;IAA+BM
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","Slide","HeroCard","BattleRequestList","CardsList","NewsList","StartBattle","CMPopin","style","Hero","memo","hero","welcome","propTypes","shape","Dashboard","props","sections","cookie","onLoadMoreSections","buildSectionComponent","section","type","buildSection","index","sectionView","sectionsList","key","map","handleScroll","window","innerHeight","document","documentElement","scrollTop","scrollingElement","scrollHeight","addEventListener","wrapper","func","arrayOf","oneOfType"],"sources":["../../../../src/template/common/dashboard/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Slide from '../../../atom/slide';\nimport HeroCard from '../../../molecule/hero';\nimport BattleRequestList from '../../../molecule/dashboard/battle-request-list';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport NewsList from '../../../molecule/dashboard/news-list';\nimport StartBattle from '../../../molecule/dashboard/start-battle';\nimport CMPopin from '../../../molecule/cm-popin';\nimport style from './style.css';\n\nconst Hero = React.memo(function Hero({hero, welcome}) {\n return <div className={style.hero}>{hero ? <HeroCard {...hero} /> : <Slide {...welcome} />}</div>;\n});\n\nHero.propTypes = {\n hero: PropTypes.shape(HeroCard.propTypes),\n welcome: PropTypes.shape(Slide.propTypes)\n};\n\nconst Dashboard = props => {\n const {sections = [], hero, welcome, cookie, onLoadMoreSections} = props;\n\n\n const buildSectionComponent = section => {\n const {type} = section;\n switch (type) {\n case 'hero':\n return <Hero hero={hero} welcome={welcome} />;\n case 'battleRequests':\n return <BattleRequestList {...section} />;\n case 'cards':\n return <CardsList {...section} />;\n case 'news':\n return <NewsList {...section} />;\n case 'battle':\n return <StartBattle {...section} />;\n default:\n return null;\n }\n };\n\n const buildSection = (section, index) => {\n const sectionView = buildSectionComponent(section);\n\n return <div key={index}>{sectionView}</div>;\n };\n \n\n const sectionsList = [{type: 'hero', key: 'hero'}, ...sections].map(section => (\n <div key={section.key}>{buildSection(section)}</div>\n ));\n\n const handleScroll = () => {\n if (window.innerHeight + document.documentElement.scrollTop + 1 >= document.scrollingElement.scrollHeight) {\n onLoadMoreSections ? onLoadMoreSections() : null;\n }\n return;\n };\n window.addEventListener('scroll', handleScroll, true)\n return (\n <div className={style.wrapper} data-name=\"dashboard\">\n {sectionsList}\n {cookie ? <CMPopin {...cookie} /> : null}\n </div>\n );\n};\n\nDashboard.propTypes = {\n hero: Hero.propTypes.hero,\n welcome: Hero.propTypes.welcome,\n onLoadMoreSections: PropTypes.func,\n sections: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape(BattleRequestList.propTypes),\n PropTypes.shape(CardsList.propTypes),\n PropTypes.shape(NewsList.propTypes),\n PropTypes.shape(StartBattle.propTypes)\n ])\n ),\n cookie: PropTypes.shape(CMPopin.propTypes)\n};\nexport default Dashboard;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAAkB,qBAAlB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,iBAAP,MAA8B,iDAA9B;AACA,OAAOC,SAAP,MAAsB,wCAAtB;AACA,OAAOC,QAAP,MAAqB,uCAArB;AACA,OAAOC,WAAP,MAAwB,0CAAxB;AACA,OAAOC,OAAP,MAAoB,4BAApB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,IAAI,gBAAGV,KAAK,CAACW,IAAN,CAAW,SAASD,IAAT,CAAc;EAACE,IAAD;EAAOC;AAAP,CAA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BK,MAAM,EAAElB,SAAS,CAACc,KAAV,CAAgBP,OAAO,CAACM,SAAxB;AAZY,CAAtB;AAcA,eAAeE,SAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/text/index.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAyC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE/E,oBAAY,KAAK,GAAG;IAElB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/text/index.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAyC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE/E,oBAAY,KAAK,GAAG;IAElB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,aAAa;;CAMzB,CAAC;AAQF,QAAA,MAAM,IAAI,UAAW,KAAK,gBAqBzB,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -31,13 +31,15 @@ const Text = props => {
|
|
|
31
31
|
style,
|
|
32
32
|
testID,
|
|
33
33
|
numberOfLines,
|
|
34
|
-
allowFontScaling = true
|
|
34
|
+
allowFontScaling = true,
|
|
35
|
+
accessibilityLabel
|
|
35
36
|
} = props;
|
|
36
37
|
return /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
37
38
|
allowFontScaling: allowFontScaling,
|
|
38
39
|
style: [styles.text, style],
|
|
39
40
|
testID: testID,
|
|
40
|
-
numberOfLines: numberOfLines
|
|
41
|
+
numberOfLines: numberOfLines,
|
|
42
|
+
accessibilityLabel: accessibilityLabel
|
|
41
43
|
}, children);
|
|
42
44
|
};
|
|
43
45
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["DEFAULT_STYLE","Platform","select","android","fontFamily","styles","StyleSheet","create","text","Text","props","children","style","testID","numberOfLines","allowFontScaling"],"sources":["../../../src/atom/text/index.native.tsx"],"sourcesContent":["import * as React from 'react';\nimport {Text as TextBase, Platform, StyleSheet, TextStyle} from 'react-native';\n\nexport type Props = {\n // copied from node_modules/react-native/Libraries/Text/TextProps.js\n children: React.ReactNode;\n style?: TextStyle | TextStyle[];\n testID?: string;\n numberOfLines?: number;\n allowFontScaling?: boolean;\n};\n\nexport const DEFAULT_STYLE = {\n ...Platform.select({\n android: {\n fontFamily: 'Roboto'\n }\n })\n};\n\nconst styles = StyleSheet.create({\n text: {\n ...DEFAULT_STYLE\n }\n});\n\nconst Text = (props: Props) => {\n const {children
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["DEFAULT_STYLE","Platform","select","android","fontFamily","styles","StyleSheet","create","text","Text","props","children","style","testID","numberOfLines","allowFontScaling","accessibilityLabel"],"sources":["../../../src/atom/text/index.native.tsx"],"sourcesContent":["import * as React from 'react';\nimport {Text as TextBase, Platform, StyleSheet, TextStyle} from 'react-native';\n\nexport type Props = {\n // copied from node_modules/react-native/Libraries/Text/TextProps.js\n children: React.ReactNode;\n style?: TextStyle | TextStyle[];\n testID?: string;\n numberOfLines?: number;\n allowFontScaling?: boolean;\n accessibilityLabel?: string;\n};\n\nexport const DEFAULT_STYLE = {\n ...Platform.select({\n android: {\n fontFamily: 'Roboto'\n }\n })\n};\n\nconst styles = StyleSheet.create({\n text: {\n ...DEFAULT_STYLE\n }\n});\n\nconst Text = (props: Props) => {\n const {\n children,\n style,\n testID,\n numberOfLines,\n allowFontScaling = true,\n accessibilityLabel\n } = props;\n\n return (\n <TextBase\n allowFontScaling={allowFontScaling}\n style={[styles.text, style]}\n testID={testID}\n numberOfLines={numberOfLines}\n accessibilityLabel={accessibilityLabel}\n >\n {children}\n </TextBase>\n );\n};\n\nexport default Text;\n"],"mappings":";;;;;AAAA;;AACA;;;;;;;;AAYO,MAAMA,aAAa,gBACrBC,qBAAA,CAASC,MAAT,CAAgB;EACjBC,OAAO,EAAE;IACPC,UAAU,EAAE;EADL;AADQ,CAAhB,CADqB,CAAnB;;;;AAQP,MAAMC,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC/BC,IAAI,eACCR,aADD;AAD2B,CAAlB,CAAf;;AAMA,MAAMS,IAAI,GAAIC,KAAD,IAAkB;EAC7B,MAAM;IACJC,QADI;IAEJC,KAFI;IAGJC,MAHI;IAIJC,aAJI;IAKJC,gBAAgB,GAAG,IALf;IAMJC;EANI,IAOFN,KAPJ;EASA,oBACE,oBAAC,iBAAD;IACE,gBAAgB,EAAEK,gBADpB;IAEE,KAAK,EAAE,CAACV,MAAM,CAACG,IAAR,EAAcI,KAAd,CAFT;IAGE,MAAM,EAAEC,MAHV;IAIE,aAAa,EAAEC,aAJjB;IAKE,kBAAkB,EAAEE;EALtB,GAOGL,QAPH,CADF;AAWD,CArBD;;eAuBeF,I"}
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { Analytics, AnalyticsEventParams } from '../../variables/analytics';
|
|
4
4
|
import { Vibration } from '../../variables/vibration';
|
|
5
5
|
export declare type Props = {
|
|
6
|
+
accessibilityLabel?: string;
|
|
6
7
|
accessible?: boolean;
|
|
7
8
|
children?: React.ReactNode;
|
|
8
9
|
delayLong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C;IAC/D,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC9C,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACrD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACjD,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACnD,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,oBAAoB,CAAC;IACvC,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAeF,QAAA,MAAM,SAAS,UAAW,KAAK,gBAkE9B,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["hitSlop","left","right","bottom","top","logEvent","eventName","analyticsID","analytics","analyticsParams","id","Touchable","props","templateContext","useTemplateContext","theme","vibration","onPress","onLongPress","isWithoutFeedback","isHighlight","activeOpacity","disabled","handlePress","useMemo","event","vibrate","ANALYTICS_EVENT_TYPE","PRESS","handleLongPress","LONG_PRESS","colors","gray","light"],"sources":["../../../src/hoc/touchable/index.native.tsx"],"sourcesContent":["import {\n TouchableOpacity,\n TouchableHighlight,\n ViewStyle,\n LayoutChangeEvent,\n NativeSyntheticEvent,\n GestureResponderEvent,\n TargetedEvent\n} from 'react-native';\n\nimport React, {useMemo} from 'react';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {ANALYTICS_EVENT_TYPE, Analytics, AnalyticsEventParams} from '../../variables/analytics';\nimport {Vibration} from '../../variables/vibration';\n\nconst hitSlop = {\n left: 12,\n right: 12,\n bottom: 12,\n top: 12\n};\n\nexport type Props = {\n accessible?: boolean;\n children?: React.ReactNode;\n delayLongPress?: number;\n delayPressIn?: number;\n delayPressOut?: number;\n disabled?: boolean;\n focusable?: boolean;\n onBlur?: (event: NativeSyntheticEvent<TargetedEvent>) => void;\n onFocus?: (event: NativeSyntheticEvent<TargetedEvent>) => void;\n onLayout?: (event: LayoutChangeEvent) => void;\n onLongPress?: (event: GestureResponderEvent) => void;\n onPress?: (event: GestureResponderEvent) => void;\n onPressIn?: (event: GestureResponderEvent) => void;\n onPressOut?: (event: GestureResponderEvent) => void;\n testID?: string;\n isHighlight?: boolean;\n isWithoutFeedback?: boolean;\n // for TouchableOpacity\n activeOpacity?: number;\n style?: ViewStyle;\n // Analytics\n analytics?: Analytics;\n analyticsID?: string;\n analyticsParams?: AnalyticsEventParams;\n vibration?: Vibration;\n};\n\nconst logEvent = (\n eventName: string,\n analyticsID: string,\n analytics: Analytics,\n analyticsParams?: AnalyticsEventParams\n) => {\n analytics &&\n analytics.logEvent(eventName, {\n ...(analyticsParams || {}),\n id: analyticsID\n });\n};\n\nconst Touchable = (props: Props) => {\n const templateContext = useTemplateContext();\n\n const {theme, vibration, analytics} = templateContext;\n\n const {\n analyticsID,\n analyticsParams,\n onPress,\n onLongPress,\n isWithoutFeedback,\n isHighlight,\n activeOpacity,\n disabled\n } = props;\n\n const handlePress = useMemo(\n () => (event: GestureResponderEvent) => {\n if (!onPress) return;\n\n vibration?.vibrate();\n\n analytics &&\n analyticsID &&\n logEvent(ANALYTICS_EVENT_TYPE.PRESS, analyticsID, analytics, analyticsParams);\n onPress(event);\n },\n [analytics, analyticsID, analyticsParams, onPress, vibration]\n );\n\n const handleLongPress = useMemo(\n () => (event: GestureResponderEvent) => {\n if (!onLongPress) return;\n\n vibration?.vibrate();\n\n analytics &&\n analyticsID &&\n logEvent(ANALYTICS_EVENT_TYPE.LONG_PRESS, analyticsID, analytics, analyticsParams);\n onLongPress(event);\n },\n [analytics, analyticsID, analyticsParams, onLongPress, vibration]\n );\n\n if (isHighlight) {\n return (\n <TouchableHighlight\n {...props}\n hitSlop={hitSlop}\n underlayColor={theme.colors.gray.light}\n onPress={handlePress}\n onLongPress={handleLongPress}\n activeOpacity={activeOpacity || (disabled ? 1 : 0.85)}\n />\n );\n }\n\n return (\n <TouchableOpacity\n {...props}\n hitSlop={hitSlop}\n onPress={handlePress}\n onLongPress={handleLongPress}\n activeOpacity={(isWithoutFeedback && 1) || activeOpacity || (disabled ? 1 : 0.2)}\n />\n );\n};\n\nexport default Touchable;\n"],"mappings":";;;;;AAAA;;AAUA;;AACA;;AACA;;;;;;;;AAGA,MAAMA,OAAO,GAAG;EACdC,IAAI,EAAE,EADQ;EAEdC,KAAK,EAAE,EAFO;EAGdC,MAAM,EAAE,EAHM;EAIdC,GAAG,EAAE;AAJS,CAAhB;;
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["hitSlop","left","right","bottom","top","logEvent","eventName","analyticsID","analytics","analyticsParams","id","Touchable","props","templateContext","useTemplateContext","theme","vibration","onPress","onLongPress","isWithoutFeedback","isHighlight","activeOpacity","disabled","handlePress","useMemo","event","vibrate","ANALYTICS_EVENT_TYPE","PRESS","handleLongPress","LONG_PRESS","colors","gray","light"],"sources":["../../../src/hoc/touchable/index.native.tsx"],"sourcesContent":["import {\n TouchableOpacity,\n TouchableHighlight,\n ViewStyle,\n LayoutChangeEvent,\n NativeSyntheticEvent,\n GestureResponderEvent,\n TargetedEvent\n} from 'react-native';\n\nimport React, {useMemo} from 'react';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {ANALYTICS_EVENT_TYPE, Analytics, AnalyticsEventParams} from '../../variables/analytics';\nimport {Vibration} from '../../variables/vibration';\n\nconst hitSlop = {\n left: 12,\n right: 12,\n bottom: 12,\n top: 12\n};\n\nexport type Props = {\n accessibilityLabel?: string;\n accessible?: boolean;\n children?: React.ReactNode;\n delayLongPress?: number;\n delayPressIn?: number;\n delayPressOut?: number;\n disabled?: boolean;\n focusable?: boolean;\n onBlur?: (event: NativeSyntheticEvent<TargetedEvent>) => void;\n onFocus?: (event: NativeSyntheticEvent<TargetedEvent>) => void;\n onLayout?: (event: LayoutChangeEvent) => void;\n onLongPress?: (event: GestureResponderEvent) => void;\n onPress?: (event: GestureResponderEvent) => void;\n onPressIn?: (event: GestureResponderEvent) => void;\n onPressOut?: (event: GestureResponderEvent) => void;\n testID?: string;\n isHighlight?: boolean;\n isWithoutFeedback?: boolean;\n // for TouchableOpacity\n activeOpacity?: number;\n style?: ViewStyle;\n // Analytics\n analytics?: Analytics;\n analyticsID?: string;\n analyticsParams?: AnalyticsEventParams;\n vibration?: Vibration;\n};\n\nconst logEvent = (\n eventName: string,\n analyticsID: string,\n analytics: Analytics,\n analyticsParams?: AnalyticsEventParams\n) => {\n analytics &&\n analytics.logEvent(eventName, {\n ...(analyticsParams || {}),\n id: analyticsID\n });\n};\n\nconst Touchable = (props: Props) => {\n const templateContext = useTemplateContext();\n\n const {theme, vibration, analytics} = templateContext;\n\n const {\n analyticsID,\n analyticsParams,\n onPress,\n onLongPress,\n isWithoutFeedback,\n isHighlight,\n activeOpacity,\n disabled\n } = props;\n\n const handlePress = useMemo(\n () => (event: GestureResponderEvent) => {\n if (!onPress) return;\n\n vibration?.vibrate();\n\n analytics &&\n analyticsID &&\n logEvent(ANALYTICS_EVENT_TYPE.PRESS, analyticsID, analytics, analyticsParams);\n onPress(event);\n },\n [analytics, analyticsID, analyticsParams, onPress, vibration]\n );\n\n const handleLongPress = useMemo(\n () => (event: GestureResponderEvent) => {\n if (!onLongPress) return;\n\n vibration?.vibrate();\n\n analytics &&\n analyticsID &&\n logEvent(ANALYTICS_EVENT_TYPE.LONG_PRESS, analyticsID, analytics, analyticsParams);\n onLongPress(event);\n },\n [analytics, analyticsID, analyticsParams, onLongPress, vibration]\n );\n\n if (isHighlight) {\n return (\n <TouchableHighlight\n {...props}\n hitSlop={hitSlop}\n underlayColor={theme.colors.gray.light}\n onPress={handlePress}\n onLongPress={handleLongPress}\n activeOpacity={activeOpacity || (disabled ? 1 : 0.85)}\n />\n );\n }\n\n return (\n <TouchableOpacity\n {...props}\n hitSlop={hitSlop}\n onPress={handlePress}\n onLongPress={handleLongPress}\n activeOpacity={(isWithoutFeedback && 1) || activeOpacity || (disabled ? 1 : 0.2)}\n />\n );\n};\n\nexport default Touchable;\n"],"mappings":";;;;;AAAA;;AAUA;;AACA;;AACA;;;;;;;;AAGA,MAAMA,OAAO,GAAG;EACdC,IAAI,EAAE,EADQ;EAEdC,KAAK,EAAE,EAFO;EAGdC,MAAM,EAAE,EAHM;EAIdC,GAAG,EAAE;AAJS,CAAhB;;AAoCA,MAAMC,QAAQ,GAAG,CACfC,SADe,EAEfC,WAFe,EAGfC,SAHe,EAIfC,eAJe,KAKZ;EACHD,SAAS,IACPA,SAAS,CAACH,QAAV,CAAmBC,SAAnB,eACMG,eAAe,IAAI,EADzB;IAEEC,EAAE,EAAEH;EAFN,GADF;AAKD,CAXD;;AAaA,MAAMI,SAAS,GAAIC,KAAD,IAAkB;EAClC,MAAMC,eAAe,GAAG,IAAAC,mCAAA,GAAxB;EAEA,MAAM;IAACC,KAAD;IAAQC,SAAR;IAAmBR;EAAnB,IAAgCK,eAAtC;EAEA,MAAM;IACJN,WADI;IAEJE,eAFI;IAGJQ,OAHI;IAIJC,WAJI;IAKJC,iBALI;IAMJC,WANI;IAOJC,aAPI;IAQJC;EARI,IASFV,KATJ;EAWA,MAAMW,WAAW,GAAG,IAAAC,cAAA,EAClB,MAAOC,KAAD,IAAkC;IACtC,IAAI,CAACR,OAAL,EAAc;IAEdD,SAAS,EAAEU,OAAX;IAEAlB,SAAS,IACPD,WADF,IAEEF,QAAQ,CAACsB,+BAAA,CAAqBC,KAAtB,EAA6BrB,WAA7B,EAA0CC,SAA1C,EAAqDC,eAArD,CAFV;IAGAQ,OAAO,CAACQ,KAAD,CAAP;EACD,CAViB,EAWlB,CAACjB,SAAD,EAAYD,WAAZ,EAAyBE,eAAzB,EAA0CQ,OAA1C,EAAmDD,SAAnD,CAXkB,CAApB;EAcA,MAAMa,eAAe,GAAG,IAAAL,cAAA,EACtB,MAAOC,KAAD,IAAkC;IACtC,IAAI,CAACP,WAAL,EAAkB;IAElBF,SAAS,EAAEU,OAAX;IAEAlB,SAAS,IACPD,WADF,IAEEF,QAAQ,CAACsB,+BAAA,CAAqBG,UAAtB,EAAkCvB,WAAlC,EAA+CC,SAA/C,EAA0DC,eAA1D,CAFV;IAGAS,WAAW,CAACO,KAAD,CAAX;EACD,CAVqB,EAWtB,CAACjB,SAAD,EAAYD,WAAZ,EAAyBE,eAAzB,EAA0CS,WAA1C,EAAuDF,SAAvD,CAXsB,CAAxB;;EAcA,IAAII,WAAJ,EAAiB;IACf,oBACE,6BAAC,+BAAD,eACMR,KADN;MAEE,OAAO,EAAEZ,OAFX;MAGE,aAAa,EAAEe,KAAK,CAACgB,MAAN,CAAaC,IAAb,CAAkBC,KAHnC;MAIE,OAAO,EAAEV,WAJX;MAKE,WAAW,EAAEM,eALf;MAME,aAAa,EAAER,aAAa,KAAKC,QAAQ,GAAG,CAAH,GAAO,IAApB;IAN9B,GADF;EAUD;;EAED,oBACE,6BAAC,6BAAD,eACMV,KADN;IAEE,OAAO,EAAEZ,OAFX;IAGE,OAAO,EAAEuB,WAHX;IAIE,WAAW,EAAEM,eAJf;IAKE,aAAa,EAAGV,iBAAiB,IAAI,CAAtB,IAA4BE,aAA5B,KAA8CC,QAAQ,GAAG,CAAH,GAAO,GAA7D;EALjB,GADF;AASD,CAlED;;eAoEeX,S"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ReviewCorrectionPopinProps } from './prop-types';
|
|
3
|
+
declare const ReviewCorrectionPopin: ({ information, klf, next, type, resultLabel }: ReviewCorrectionPopinProps) => JSX.Element | null;
|
|
4
|
+
export default ReviewCorrectionPopin;
|
|
5
|
+
//# sourceMappingURL=index.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/molecule/review-correction-popin/index.native.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAgC,0BAA0B,EAAC,MAAM,cAAc,CAAC;AA4QvF,QAAA,MAAM,qBAAqB,kDAMxB,0BAA0B,uBAiD5B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
7
|
+
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
|
|
10
|
+
var _novaIcons = require("@coorpacademy/nova-icons");
|
|
11
|
+
|
|
12
|
+
var _index = _interopRequireDefault(require("../../atom/html/index.native"));
|
|
13
|
+
|
|
14
|
+
var _index2 = _interopRequireDefault(require("../../atom/text/index.native"));
|
|
15
|
+
|
|
16
|
+
var _index3 = _interopRequireDefault(require("../../hoc/touchable/index.native"));
|
|
17
|
+
|
|
18
|
+
var _templateContext = require("../../template/app-review/template-context");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
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); }
|
|
27
|
+
|
|
28
|
+
const createStyleSheet = (theme, type) => _reactNative.StyleSheet.create({
|
|
29
|
+
wrapper: {
|
|
30
|
+
height: 'auto',
|
|
31
|
+
color: theme.colors.white,
|
|
32
|
+
display: 'flex'
|
|
33
|
+
},
|
|
34
|
+
popin: {
|
|
35
|
+
padding: theme.spacing.medium,
|
|
36
|
+
borderRadius: 16,
|
|
37
|
+
display: 'flex',
|
|
38
|
+
flexDirection: 'column',
|
|
39
|
+
alignItems: 'flex-start',
|
|
40
|
+
backgroundColor: type === 'wrong' ? theme.colors.negative : theme.colors.positive,
|
|
41
|
+
shadowColor: type === 'wrong' ? theme.colors.negative : theme.colors.positive,
|
|
42
|
+
shadowOpacity: 0.5,
|
|
43
|
+
shadowOffset: {
|
|
44
|
+
width: 0,
|
|
45
|
+
height: 0
|
|
46
|
+
},
|
|
47
|
+
shadowRadius: 15,
|
|
48
|
+
elevation: 4
|
|
49
|
+
},
|
|
50
|
+
correctionSection: {
|
|
51
|
+
flexDirection: 'row',
|
|
52
|
+
alignItems: 'center',
|
|
53
|
+
width: '80%'
|
|
54
|
+
},
|
|
55
|
+
iconCircle: {
|
|
56
|
+
width: 60,
|
|
57
|
+
height: 60,
|
|
58
|
+
alignItems: 'center',
|
|
59
|
+
justifyContent: 'center',
|
|
60
|
+
backgroundColor: theme.colors.white,
|
|
61
|
+
opacity: 0.7,
|
|
62
|
+
borderRadius: 50
|
|
63
|
+
},
|
|
64
|
+
icon: {
|
|
65
|
+
height: 30,
|
|
66
|
+
width: 30
|
|
67
|
+
},
|
|
68
|
+
resultLabel: {
|
|
69
|
+
color: theme.colors.white,
|
|
70
|
+
fontSize: 24,
|
|
71
|
+
fontWeight: '600',
|
|
72
|
+
lineHeight: 24,
|
|
73
|
+
marginLeft: 12,
|
|
74
|
+
textTransform: 'uppercase',
|
|
75
|
+
wordBreak: 'break-word'
|
|
76
|
+
},
|
|
77
|
+
feedbackSection: {
|
|
78
|
+
marginVertical: theme.spacing.medium
|
|
79
|
+
},
|
|
80
|
+
labelContainer: {
|
|
81
|
+
alignSelf: 'flex-start',
|
|
82
|
+
backgroundColor: 'rgba(255, 255, 255, 0.3)',
|
|
83
|
+
borderRadius: 56,
|
|
84
|
+
paddingHorizontal: theme.spacing.tiny,
|
|
85
|
+
paddingVertical: theme.spacing.micro,
|
|
86
|
+
marginBottom: 8
|
|
87
|
+
},
|
|
88
|
+
label: {
|
|
89
|
+
color: theme.colors.white,
|
|
90
|
+
fontSize: 14,
|
|
91
|
+
fontWeight: theme.fontWeight.extraBold,
|
|
92
|
+
lineHeight: 17,
|
|
93
|
+
wordBreak: 'break-word'
|
|
94
|
+
},
|
|
95
|
+
htmlInfoMessage: {
|
|
96
|
+
color: theme.colors.white,
|
|
97
|
+
fontSize: 16,
|
|
98
|
+
fontWeight: '600',
|
|
99
|
+
lineHeight: 19
|
|
100
|
+
},
|
|
101
|
+
button: {
|
|
102
|
+
alignSelf: 'stretch',
|
|
103
|
+
backgroundColor: theme.colors.white,
|
|
104
|
+
borderRadius: 7,
|
|
105
|
+
paddingHorizontal: theme.spacing.base,
|
|
106
|
+
paddingVertical: theme.spacing.small
|
|
107
|
+
},
|
|
108
|
+
buttonText: {
|
|
109
|
+
color: theme.colors.cta,
|
|
110
|
+
fontSize: 14,
|
|
111
|
+
fontWeight: theme.fontWeight.bold,
|
|
112
|
+
lineHeight: 20,
|
|
113
|
+
textAlign: 'center'
|
|
114
|
+
},
|
|
115
|
+
containerButtonKlf: {
|
|
116
|
+
width: '100%'
|
|
117
|
+
},
|
|
118
|
+
buttonKlf: {
|
|
119
|
+
flexDirection: 'row',
|
|
120
|
+
alignItems: 'center',
|
|
121
|
+
justifyContent: 'center',
|
|
122
|
+
backgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
123
|
+
borderRadius: 7,
|
|
124
|
+
paddingHorizontal: theme.spacing.base,
|
|
125
|
+
paddingVertical: theme.spacing.small,
|
|
126
|
+
marginBottom: theme.spacing.tiny
|
|
127
|
+
},
|
|
128
|
+
buttonKlfActive: {
|
|
129
|
+
backgroundColor: 'linear-gradient(0deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.25)), rgba(255, 255, 255, 0.1)'
|
|
130
|
+
},
|
|
131
|
+
buttonKlfText: {
|
|
132
|
+
color: 'white',
|
|
133
|
+
fontSize: 14,
|
|
134
|
+
fontWeight: theme.fontWeight.bold,
|
|
135
|
+
lineHeight: 20,
|
|
136
|
+
textAlign: 'center'
|
|
137
|
+
},
|
|
138
|
+
iconKey: {
|
|
139
|
+
width: 12,
|
|
140
|
+
height: 12,
|
|
141
|
+
marginRight: theme.spacing.tiny
|
|
142
|
+
},
|
|
143
|
+
containerTooltip: {
|
|
144
|
+
zIndex: 30,
|
|
145
|
+
position: 'relative',
|
|
146
|
+
shadowColor: theme.colors.black,
|
|
147
|
+
shadowOpacity: 0.3,
|
|
148
|
+
shadowOffset: {
|
|
149
|
+
width: 0,
|
|
150
|
+
height: 0
|
|
151
|
+
},
|
|
152
|
+
shadowRadius: 8
|
|
153
|
+
},
|
|
154
|
+
buttonTooltip: {
|
|
155
|
+
flexDirection: 'column',
|
|
156
|
+
justifyContent: 'center',
|
|
157
|
+
backgroundColor: theme.colors.white,
|
|
158
|
+
borderRadius: 15,
|
|
159
|
+
padding: theme.spacing.small,
|
|
160
|
+
width: '112%',
|
|
161
|
+
position: 'absolute',
|
|
162
|
+
bottom: 4,
|
|
163
|
+
right: -15,
|
|
164
|
+
zIndex: 20
|
|
165
|
+
},
|
|
166
|
+
htmlTooltipText: {
|
|
167
|
+
color: theme.colors.text.primary,
|
|
168
|
+
fontSize: 16,
|
|
169
|
+
fontWeight: '600',
|
|
170
|
+
lineHeight: 22,
|
|
171
|
+
textAlign: 'center'
|
|
172
|
+
},
|
|
173
|
+
triangleTooltip: {
|
|
174
|
+
width: 0,
|
|
175
|
+
height: 0,
|
|
176
|
+
backgroundColor: 'transparent',
|
|
177
|
+
borderStyle: 'solid',
|
|
178
|
+
borderLeftWidth: 13,
|
|
179
|
+
borderRightWidth: 13,
|
|
180
|
+
borderBottomWidth: 13,
|
|
181
|
+
borderTopWidth: 13,
|
|
182
|
+
borderLeftColor: 'transparent',
|
|
183
|
+
borderTopColor: 'transparent',
|
|
184
|
+
borderRightColor: theme.colors.white,
|
|
185
|
+
borderBottomColor: theme.colors.white,
|
|
186
|
+
transform: [{
|
|
187
|
+
rotate: '45deg'
|
|
188
|
+
}],
|
|
189
|
+
position: 'absolute',
|
|
190
|
+
left: 110,
|
|
191
|
+
top: -20,
|
|
192
|
+
borderRadius: 4
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
const KlfButton = ({
|
|
197
|
+
klf,
|
|
198
|
+
styleSheet
|
|
199
|
+
}) => {
|
|
200
|
+
const [displayTooltip, setDisplayTooltip] = (0, _react.useState)(false);
|
|
201
|
+
const fadeAnim = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
|
|
202
|
+
const fadeIn = (0, _react.useCallback)(() => {
|
|
203
|
+
_reactNative.Animated.timing(fadeAnim, {
|
|
204
|
+
toValue: 1,
|
|
205
|
+
duration: 1000,
|
|
206
|
+
easing: _reactNative.Easing.bezier(0.25, 1, 0.5, 1),
|
|
207
|
+
useNativeDriver: true
|
|
208
|
+
}).start();
|
|
209
|
+
}, [fadeAnim]);
|
|
210
|
+
const fadeOut = (0, _react.useCallback)(() => {
|
|
211
|
+
_reactNative.Animated.timing(fadeAnim, {
|
|
212
|
+
toValue: 0,
|
|
213
|
+
duration: 500,
|
|
214
|
+
easing: _reactNative.Easing.bezier(0.25, 1, 0.5, 1),
|
|
215
|
+
useNativeDriver: true
|
|
216
|
+
}).start();
|
|
217
|
+
}, [fadeAnim]);
|
|
218
|
+
const handlePressKey = (0, _react.useCallback)(() => {
|
|
219
|
+
setDisplayTooltip(!displayTooltip);
|
|
220
|
+
!displayTooltip ? fadeIn() : fadeOut();
|
|
221
|
+
}, [displayTooltip, fadeIn, fadeOut]);
|
|
222
|
+
const {
|
|
223
|
+
buttonKlf,
|
|
224
|
+
buttonKlfActive,
|
|
225
|
+
buttonKlfText,
|
|
226
|
+
containerButtonKlf,
|
|
227
|
+
containerTooltip,
|
|
228
|
+
buttonTooltip,
|
|
229
|
+
htmlTooltipText,
|
|
230
|
+
iconKey,
|
|
231
|
+
triangleTooltip
|
|
232
|
+
} = styleSheet;
|
|
233
|
+
const {
|
|
234
|
+
label,
|
|
235
|
+
tooltip
|
|
236
|
+
} = klf;
|
|
237
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
238
|
+
style: containerButtonKlf
|
|
239
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
240
|
+
style: [containerTooltip, {
|
|
241
|
+
opacity: fadeAnim
|
|
242
|
+
}]
|
|
243
|
+
}, /*#__PURE__*/_react.default.createElement(_index3.default, {
|
|
244
|
+
style: buttonTooltip,
|
|
245
|
+
accessibilityLabel: `aria-label-tooltip`,
|
|
246
|
+
isHighlight: true,
|
|
247
|
+
onPress: handlePressKey,
|
|
248
|
+
testID: "button-tooltip"
|
|
249
|
+
}, /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
250
|
+
style: htmlTooltipText
|
|
251
|
+
}, tooltip)), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
252
|
+
style: triangleTooltip
|
|
253
|
+
})), /*#__PURE__*/_react.default.createElement(_index3.default, {
|
|
254
|
+
style: displayTooltip ? _extends({}, buttonKlf, buttonKlfActive) : buttonKlf,
|
|
255
|
+
accessibilityLabel: `aria-label-${label}`,
|
|
256
|
+
onPress: handlePressKey,
|
|
257
|
+
testID: "button-klf"
|
|
258
|
+
}, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaLineLoginKey1, {
|
|
259
|
+
style: iconKey,
|
|
260
|
+
color: "white"
|
|
261
|
+
}), /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
262
|
+
style: buttonKlfText
|
|
263
|
+
}, label)));
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
const ICONS = {
|
|
267
|
+
right: _novaIcons.NovaCompositionCoorpacademyCheck,
|
|
268
|
+
wrong: _novaIcons.NovaSolidStatusClose
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
const ReviewCorrectionPopin = ({
|
|
272
|
+
information,
|
|
273
|
+
klf,
|
|
274
|
+
next,
|
|
275
|
+
type,
|
|
276
|
+
resultLabel
|
|
277
|
+
}) => {
|
|
278
|
+
const templateContext = (0, _templateContext.useTemplateContext)();
|
|
279
|
+
const [styleSheet, setStylesheet] = (0, _react.useState)(null);
|
|
280
|
+
const {
|
|
281
|
+
theme
|
|
282
|
+
} = templateContext;
|
|
283
|
+
const handlePressNext = next.onClick;
|
|
284
|
+
const Icon = ICONS[type];
|
|
285
|
+
(0, _react.useEffect)(() => {
|
|
286
|
+
const _stylesheet = createStyleSheet(theme, type);
|
|
287
|
+
|
|
288
|
+
setStylesheet(_stylesheet);
|
|
289
|
+
}, [theme, type]);
|
|
290
|
+
|
|
291
|
+
if (!styleSheet) {
|
|
292
|
+
return null;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
296
|
+
style: styleSheet.wrapper
|
|
297
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
298
|
+
style: styleSheet.popin
|
|
299
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
300
|
+
style: styleSheet.correctionSection
|
|
301
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
302
|
+
style: styleSheet.iconCircle
|
|
303
|
+
}, /*#__PURE__*/_react.default.createElement(Icon, {
|
|
304
|
+
style: styleSheet.icon,
|
|
305
|
+
color: type === 'wrong' ? theme.colors.negative : theme.colors.positive
|
|
306
|
+
})), /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
307
|
+
style: styleSheet.resultLabel
|
|
308
|
+
}, resultLabel)), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
309
|
+
style: styleSheet.feedbackSection,
|
|
310
|
+
accessibilityLabel: "answer-information"
|
|
311
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
312
|
+
style: styleSheet.labelContainer,
|
|
313
|
+
needsOffscreenAlphaCompositing: true
|
|
314
|
+
}, /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
315
|
+
accessibilityLabel: information.label,
|
|
316
|
+
style: styleSheet.label
|
|
317
|
+
}, information.label)), /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
318
|
+
style: styleSheet.htmlInfoMessage
|
|
319
|
+
}, information.message)), klf && type === 'wrong' ? /*#__PURE__*/_react.default.createElement(KlfButton, {
|
|
320
|
+
styleSheet: styleSheet,
|
|
321
|
+
klf: klf
|
|
322
|
+
}) : null, /*#__PURE__*/_react.default.createElement(_index3.default, {
|
|
323
|
+
style: styleSheet.button,
|
|
324
|
+
onPress: handlePressNext,
|
|
325
|
+
accessibilityLabel: next['aria-label'],
|
|
326
|
+
testID: next['data-name']
|
|
327
|
+
}, /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
328
|
+
style: styleSheet.buttonText
|
|
329
|
+
}, next.label))));
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
var _default = ReviewCorrectionPopin;
|
|
333
|
+
exports.default = _default;
|
|
334
|
+
//# sourceMappingURL=index.native.js.map
|