@coorpacademy/components 10.30.4-alpha.2 → 10.30.5-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/choice/index.native.js +2 -4
- package/es/atom/choice/index.native.js.map +1 -1
- package/es/atom/html/index.native.js +1 -3
- package/es/atom/html/index.native.js.map +1 -1
- package/es/atom/review-presentation/index.native.js +56 -60
- package/es/atom/review-presentation/index.native.js.map +1 -1
- package/es/hoc/modal/select/index.native.js +3 -3
- package/es/hoc/modal/select/index.native.js.map +1 -1
- package/es/hoc/modal/select-item/index.native.js +13 -17
- package/es/hoc/modal/select-item/index.native.js.map +1 -1
- package/es/hoc/touchable/index.native.js +2 -2
- package/es/hoc/touchable/index.native.js.map +1 -1
- package/es/molecule/dashboard/cards-list/index.js +3 -7
- package/es/molecule/dashboard/cards-list/index.js.map +1 -1
- package/es/molecule/questions/free-text/index.native.js +26 -30
- package/es/molecule/questions/free-text/index.native.js.map +1 -1
- package/es/molecule/questions/mobile/slider/index.native.js +3 -5
- package/es/molecule/questions/mobile/slider/index.native.js.map +1 -1
- package/es/molecule/questions/mobile/template/index.native.js +1 -3
- package/es/molecule/questions/mobile/template/index.native.js.map +1 -1
- package/es/organism/mooc-header/index.d.ts +2 -2
- package/es/organism/mooc-header/index.d.ts.map +1 -1
- package/es/organism/mooc-header/index.js +6 -2
- package/es/organism/mooc-header/index.js.map +1 -1
- package/es/organism/review-congrats/index.js +1 -3
- package/es/organism/review-congrats/index.js.map +1 -1
- package/es/organism/review-slide/index.d.ts.map +1 -1
- package/es/organism/review-slide/index.js +6 -2
- package/es/organism/review-slide/index.js.map +1 -1
- package/es/organism/review-slide/index.native.d.ts.map +1 -1
- package/es/organism/review-slide/index.native.js +116 -79
- package/es/organism/review-slide/index.native.js.map +1 -1
- package/es/organism/review-slide/prop-types.d.ts +11 -0
- package/es/organism/review-slide/prop-types.d.ts.map +1 -1
- package/es/organism/review-slide/prop-types.js.map +1 -1
- package/es/template/common/dashboard/index.d.ts +0 -1
- package/es/template/common/dashboard/index.d.ts.map +1 -1
- package/es/template/common/dashboard/index.js +3 -26
- package/es/template/common/dashboard/index.js.map +1 -1
- package/lib/atom/choice/index.native.js +2 -4
- package/lib/atom/choice/index.native.js.map +1 -1
- package/lib/atom/html/index.native.js +1 -3
- package/lib/atom/html/index.native.js.map +1 -1
- package/lib/atom/review-presentation/index.native.js +56 -60
- package/lib/atom/review-presentation/index.native.js.map +1 -1
- package/lib/hoc/modal/select/index.native.js +3 -3
- package/lib/hoc/modal/select/index.native.js.map +1 -1
- package/lib/hoc/modal/select-item/index.native.js +13 -17
- package/lib/hoc/modal/select-item/index.native.js.map +1 -1
- package/lib/hoc/touchable/index.native.js +2 -2
- package/lib/hoc/touchable/index.native.js.map +1 -1
- package/lib/molecule/dashboard/cards-list/index.js +3 -7
- package/lib/molecule/dashboard/cards-list/index.js.map +1 -1
- package/lib/molecule/questions/free-text/index.native.js +26 -30
- package/lib/molecule/questions/free-text/index.native.js.map +1 -1
- package/lib/molecule/questions/mobile/slider/index.native.js +3 -5
- package/lib/molecule/questions/mobile/slider/index.native.js.map +1 -1
- package/lib/molecule/questions/mobile/template/index.native.js +1 -3
- package/lib/molecule/questions/mobile/template/index.native.js.map +1 -1
- package/lib/organism/mooc-header/index.d.ts +2 -2
- package/lib/organism/mooc-header/index.d.ts.map +1 -1
- package/lib/organism/mooc-header/index.js +6 -2
- package/lib/organism/mooc-header/index.js.map +1 -1
- package/lib/organism/review-congrats/index.js +1 -3
- package/lib/organism/review-congrats/index.js.map +1 -1
- package/lib/organism/review-slide/index.d.ts.map +1 -1
- package/lib/organism/review-slide/index.js +6 -2
- package/lib/organism/review-slide/index.js.map +1 -1
- package/lib/organism/review-slide/index.native.d.ts.map +1 -1
- package/lib/organism/review-slide/index.native.js +115 -78
- package/lib/organism/review-slide/index.native.js.map +1 -1
- package/lib/organism/review-slide/prop-types.d.ts +11 -0
- package/lib/organism/review-slide/prop-types.d.ts.map +1 -1
- package/lib/organism/review-slide/prop-types.js.map +1 -1
- package/lib/template/common/dashboard/index.d.ts +0 -1
- package/lib/template/common/dashboard/index.d.ts.map +1 -1
- package/lib/template/common/dashboard/index.js +3 -30
- 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":["styles","StyleSheet","create","correctionPopinWrapper","position","bottom","width","CorrectionPopin","correctionPopinProps","slideIndex","klf","getOr","undefined","information","label","message","next","get","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","useTemplateContext","style","setStyle","useState","useEffect","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","left","height","alignItems","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","Slide","useWindowDimensions","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;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;AAYA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,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,GAAG,IAAAC,cAAA,EAAMC,SAAN,EAAiB,KAAjB,EAAwBJ,oBAAxB,CAAZ;EACA,MAAMK,WAAW,GAAG,IAAAF,cAAA,EAAM;IAACG,KAAK,EAAE,EAAR;IAAYC,OAAO,EAAE;EAArB,CAAN,EAAgC,aAAhC,EAA+CP,oBAA/C,CAApB;EACA,MAAMQ,IAAI,GAAG,IAAAC,YAAA,EAAI,MAAJ,EAAYT,oBAAZ,CAAb;EACA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C,WAAW,EAAE,MAVR;MAWLC,YAAY,EAAE;QAACjE,KAAK,EAAE,CAAR;QAAW6D,MAAM,EAAE,CAAC;MAApB,CAXT;MAYLK,aAAa,EAAE,IAZV;MAaLC,YAAY,EAAE,EAbT;MAcLC,SAAS,EAAE,KAAKZ,GAAG,GAAG,CAdjB;MAeLb,YAAY,EAAE;IAfT;EADgB,CAAlB,CAAP;AAmBD,CAtBD;;AAwBA,MAAM0B,KAAK,GAAItB,KAAD,IAA6B;EACzC,MAAM;IAACY,KAAD;IAAQzD,oBAAR;IAA8BsD,GAA9B;IAAmCrD,UAAU,GAAG;EAAhD,IAAuD4C,KAA7D;EAEA,MAAM;IAAC/C;EAAD,IAAU,IAAAsE,gCAAA,GAAhB;EACA,MAAMC,UAAU,GAAGhB,gBAAgB,CAACC,GAAD,EAAMxD,KAAN,CAAnC;EAEA,MAAM;IACJwE,OADI;IAEJC,kBAFI;IAGJvC,YAHI;IAIJc,QAJI;IAKJ0B,mBALI;IAMJC;EANI,IAOFhB,KAPJ;EASA,oBACE,6BAAC,iBAAD;IAAM,KAAK,EAAEY,UAAU,CAACZ;EAAxB,GACGa,OAAO;EAAA;EACN;EACA,6BAAC,cAAD,yBAAoBhB,GAApB,CAFM,gBAIN,yEACE,6BAAC,QAAD;IACE,cAAc,EAAEiB,kBADlB;IAEE,YAAY,EAAEvC,YAFhB;IAGE,QAAQ,EAAEc,QAHZ;IAIE,GAAG,EAAC;EAJN,EADF,EAOG9C,oBAAoB,gBACnB,6BAAC,eAAD;IACE,oBAAoB,EAAEA,oBADxB;IAEE,UAAU,EAAEC,UAFd;IAGE,mBAAmB,EAAEuE,mBAHvB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EADmB,GAQjB,IAfN,CALJ,CADF;AA0BD,CAzCD;;eA2CeN,K"}
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["styles","StyleSheet","create","correctionPopinWrapper","position","bottom","width","CorrectionPopin","correctionPopinProps","slideIndex","showCorrectionPopin","animateCorrectionPopin","translateAnim","useRef","Animated","Value","current","translateYAnim","useCallback","timing","toValue","duration","easing","Easing","bezier","useNativeDriver","start","klf","getOr","undefined","information","label","message","next","get","onClick","_correctionPopinProps","type","resultLabel","transform","translateY","createValidateButtonStyle","theme","brandTheme","validateButton","backgroundColor","colors","primary","text","borderRadius","validateButtonText","fontSize","lineHeight","fontWeight","bold","color","white","marginBottom","spacing","small","marginTop","textAlign","ValidateButton","disabled","useTemplateContext","style","setStyle","useState","useEffect","buttonStyle","createQuestionStyle","questionHeading","justifyContent","questionOrigin","tiny","questionText","questionHelp","gray","medium","choicesContainer","flex","Question","props","answerUI","questionStyle","createSlideStyle","num","screenWidth","slideWidth","slide","left","height","alignItems","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","Slide","useWindowDimensions","slideStyle","loading","parentContentTitle"],"sources":["../../../src/organism/review-slide/index.native.tsx"],"sourcesContent":["import React, {useCallback, useEffect, useState, useRef} from 'react';\nimport {\n Animated,\n Easing,\n StyleSheet,\n TextStyle,\n useWindowDimensions,\n View,\n ViewStyle\n} 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 {PopinProps, ReviewSlideProps, SlideProps, ValidateButtonProps} from './prop-types';\n\nconst styles = StyleSheet.create({\n correctionPopinWrapper: {\n position: 'absolute',\n bottom: 16,\n width: '105%'\n }\n});\n\nconst CorrectionPopin = ({\n correctionPopinProps,\n slideIndex,\n showCorrectionPopin,\n animateCorrectionPopin\n}: PopinProps) => {\n const translateAnim = useRef(new Animated.Value(1000)).current;\n\n const translateYAnim = useCallback(() => {\n Animated.timing(translateAnim, {\n toValue: 0,\n duration: 800,\n easing: Easing.bezier(0.37, 0, 0.63, 1),\n useNativeDriver: true\n }).start();\n }, [translateAnim]);\n\n if (animateCorrectionPopin) {\n translateYAnim();\n }\n\n if (!showCorrectionPopin) return null;\n\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 <Animated.View\n style={{\n ...styles.correctionPopinWrapper,\n transform: [\n {\n translateY: translateAnim\n }\n ]\n }}\n >\n <ReviewCorrectionPopin {..._correctionPopinProps} />\n </Animated.View>\n );\n};\n\ntype StyleValidateButtonType = {\n validateButton: ViewStyle;\n validateButtonText: ViewStyle;\n};\n\nconst createValidateButtonStyle = (theme: Theme, brandTheme: Brand): StyleValidateButtonType =>\n StyleSheet.create({\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: theme.fontWeight.bold,\n color: theme.colors.white,\n marginBottom: theme.spacing.small,\n marginTop: theme.spacing.small,\n textAlign: 'center'\n }\n });\n\nconst ValidateButton = ({slideIndex, validateButton}: ValidateButtonProps) => {\n const {label, onClick, disabled} = validateButton;\n const {theme, brandTheme} = useTemplateContext();\n const [style, setStyle] = useState<StyleValidateButtonType>();\n\n useEffect(() => {\n const buttonStyle = createValidateButtonStyle(theme, brandTheme);\n setStyle(buttonStyle);\n }, [theme, brandTheme]);\n\n if (!style) return null;\n\n return (\n <Touchable\n style={style.validateButton}\n onPress={onClick}\n disabled={disabled}\n accessibilityLabel={label}\n testID={`slide-validate-button-${slideIndex}`}\n >\n <Text style={style.validateButtonText}>{label}</Text>\n </Touchable>\n );\n};\n\ntype StyleSheetType = {\n questionHeading: ViewStyle;\n questionOrigin: ViewStyle;\n questionText: TextStyle;\n questionHelp: ViewStyle;\n choicesContainer: ViewStyle;\n};\n\nconst createQuestionStyle = (theme: Theme): 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 });\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} = useTemplateContext();\n const [style, setStyle] = useState<StyleSheetType>();\n\n useEffect(() => {\n const questionStyle = createQuestionStyle(theme);\n setStyle(questionStyle);\n }, [theme]);\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 </>\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, validateButton, 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 <ValidateButton\n slideIndex={slideIndex}\n validateButton={validateButton}\n key=\"validate-button\"\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;;AACA;;AASA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;AAIA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,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;EACvBC,oBADuB;EAEvBC,UAFuB;EAGvBC,mBAHuB;EAIvBC;AAJuB,CAA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AAE5B,YAFhB;IAGE,QAAQ,EAAEQ,QAHZ;IAIE,GAAG,EAAC;EAJN,EADF,eAOE,6BAAC,cAAD;IACE,UAAU,EAAE1E,UADd;IAEE,cAAc,EAAEmC,cAFlB;IAGE,GAAG,EAAC;EAHN,EAPF,EAYGpC,oBAAoB,gBACnB,6BAAC,eAAD;IACE,oBAAoB,EAAEA,oBADxB;IAEE,UAAU,EAAEC,UAFd;IAGE,mBAAmB,EAAEC,mBAHvB;IAIE,sBAAsB,EAAEC,sBAJ1B;IAKE,GAAG,EAAC;EALN,EADmB,GAQjB,IApBN,CALJ,CADF;AA+BD,CA9CD;;eAgDewF,K"}
|
|
@@ -176,6 +176,17 @@ declare const propTypes: {
|
|
|
176
176
|
}>>;
|
|
177
177
|
};
|
|
178
178
|
export default propTypes;
|
|
179
|
+
export declare type PopinProps = {
|
|
180
|
+
correctionPopinProps: ReviewCorrectionPopinProps;
|
|
181
|
+
slideIndex: string;
|
|
182
|
+
showCorrectionPopin?: boolean;
|
|
183
|
+
animateCorrectionPopin?: boolean;
|
|
184
|
+
};
|
|
185
|
+
export declare type ValidateButtonProps = {
|
|
186
|
+
slideIndex: string;
|
|
187
|
+
validateButton: ReviewSlideProps['validateButton'];
|
|
188
|
+
primarySkinColor?: string;
|
|
189
|
+
};
|
|
179
190
|
export declare type SlideProps = {
|
|
180
191
|
position: number;
|
|
181
192
|
loading: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/organism/review-slide/prop-types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAuC,EACrC,0BAA0B,EAC3B,MAAM,mDAAmD,CAAC;AAC3D,OAAwB,EAAC,WAAW,EAAC,MAAM,kCAAkC,CAAC;AAE9E,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,EAAE,OAAO,CAAC;KACnB,CAAC;CACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.js","names":["SlidePropsTypes","PropTypes","shape","position","number","loading","bool","loadingAriaLabel","string","animationType","isCorrect","animateCorrectionPopin","showCorrectionPopin","disableContent","parentContentTitle","questionText","answerUI","AnswerPropTypes","propTypes","slideIndex","slide","validateButton","label","isRequired","onClick","func","disabled","correctionPopinProps","klf","ReviewCorrectionPopinPropTypes","information","next","resultLabel","type"],"sources":["../../../src/organism/review-slide/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport ReviewCorrectionPopinPropTypes, {\n ReviewCorrectionPopinProps\n} from '../../molecule/review-correction-popin/prop-types';\nimport AnswerPropTypes, {AnswerProps} from '../../molecule/answer/prop-types';\n\nexport const SlidePropsTypes = PropTypes.shape({\n position: PropTypes.number,\n loading: PropTypes.bool,\n loadingAriaLabel: PropTypes.string,\n animationType: PropTypes.string, // 'unstack' | 'restack'\n isCorrect: PropTypes.bool,\n animateCorrectionPopin: PropTypes.bool,\n showCorrectionPopin: PropTypes.bool,\n disableContent: PropTypes.bool,\n parentContentTitle: PropTypes.string,\n questionText: PropTypes.string,\n answerUI: PropTypes.shape(AnswerPropTypes)\n});\n\nconst propTypes = {\n slideIndex: PropTypes.string,\n slide: SlidePropsTypes,\n validateButton: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n disabled: PropTypes.bool\n }),\n correctionPopinProps: PropTypes.shape({\n klf: ReviewCorrectionPopinPropTypes.klf,\n information: ReviewCorrectionPopinPropTypes.information,\n next: PropTypes.shape({\n label: PropTypes.string,\n 'aria-label': PropTypes.string // Pourquoi le onClick du next n'est pas ici !\n // updateSlidesOnNext: PropTypes.func.isRequired ???\n }),\n resultLabel: ReviewCorrectionPopinPropTypes.resultLabel,\n type: ReviewCorrectionPopinPropTypes.type\n })\n};\n\nexport default propTypes;\n\nexport type SlideProps = {\n position: number;\n loading: boolean;\n loadingAriaLabel?: string;\n animationType?: 'unstack' | 'restack';\n isCorrect?: boolean;\n animateCorrectionPopin?: boolean;\n showCorrectionPopin?: boolean;\n parentContentTitle?: string;\n questionText?: string;\n answerUI?: AnswerProps;\n};\n\nexport type ReviewSlideProps = {\n slideIndex: string;\n num: number;\n slide: SlideProps;\n correctionPopinProps?: ReviewCorrectionPopinProps;\n validateButton: {\n label: string;\n onClick: () => void;\n disabled: boolean;\n };\n};\n"],"mappings":";;;;;AAAA;;AACA;;AAGA;;;;AAEO,MAAMA,eAAe,GAAGC,kBAAA,CAAUC,KAAV,CAAgB;EAC7CC,QAAQ,EAAEF,kBAAA,CAAUG,MADyB;EAE7CC,OAAO,EAAEJ,kBAAA,CAAUK,IAF0B;EAG7CC,gBAAgB,EAAEN,kBAAA,CAAUO,MAHiB;EAI7CC,aAAa,EAAER,kBAAA,CAAUO,MAJoB;EAIZ;EACjCE,SAAS,EAAET,kBAAA,CAAUK,IALwB;EAM7CK,sBAAsB,EAAEV,kBAAA,CAAUK,IANW;EAO7CM,mBAAmB,EAAEX,kBAAA,CAAUK,IAPc;EAQ7CO,cAAc,EAAEZ,kBAAA,CAAUK,IARmB;EAS7CQ,kBAAkB,EAAEb,kBAAA,CAAUO,MATe;EAU7CO,YAAY,EAAEd,kBAAA,CAAUO,MAVqB;EAW7CQ,QAAQ,EAAEf,kBAAA,CAAUC,KAAV,CAAgBe,mBAAhB;AAXmC,CAAhB,CAAxB;;;AAcP,MAAMC,SAAS,GAAG;EAChBC,UAAU,EAAElB,kBAAA,CAAUO,MADN;EAEhBY,KAAK,EAAEpB,eAFS;EAGhBqB,cAAc,EAAEpB,kBAAA,CAAUC,KAAV,CAAgB;IAC9BoB,KAAK,EAAErB,kBAAA,CAAUO,MAAV,CAAiBe,UADM;IAE9BC,OAAO,EAAEvB,kBAAA,CAAUwB,IAAV,CAAeF,UAFM;IAG9BG,QAAQ,EAAEzB,kBAAA,CAAUK;EAHU,CAAhB,CAHA;EAQhBqB,oBAAoB,EAAE1B,kBAAA,CAAUC,KAAV,CAAgB;IACpC0B,GAAG,EAAEC,mBAAA,CAA+BD,GADA;IAEpCE,WAAW,EAAED,mBAAA,CAA+BC,WAFR;IAGpCC,IAAI,EAAE9B,kBAAA,CAAUC,KAAV,CAAgB;MACpBoB,KAAK,EAAErB,kBAAA,CAAUO,MADG;MAEpB,cAAcP,kBAAA,CAAUO,MAFJ,CAEW;MAC/B;;IAHoB,CAAhB,CAH8B;IAQpCwB,WAAW,EAAEH,mBAAA,CAA+BG,WARR;IASpCC,IAAI,EAAEJ,mBAAA,CAA+BI;EATD,CAAhB;AARN,CAAlB;eAqBef,S"}
|
|
1
|
+
{"version":3,"file":"prop-types.js","names":["SlidePropsTypes","PropTypes","shape","position","number","loading","bool","loadingAriaLabel","string","animationType","isCorrect","animateCorrectionPopin","showCorrectionPopin","disableContent","parentContentTitle","questionText","answerUI","AnswerPropTypes","propTypes","slideIndex","slide","validateButton","label","isRequired","onClick","func","disabled","correctionPopinProps","klf","ReviewCorrectionPopinPropTypes","information","next","resultLabel","type"],"sources":["../../../src/organism/review-slide/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport ReviewCorrectionPopinPropTypes, {\n ReviewCorrectionPopinProps\n} from '../../molecule/review-correction-popin/prop-types';\nimport AnswerPropTypes, {AnswerProps} from '../../molecule/answer/prop-types';\n\nexport const SlidePropsTypes = PropTypes.shape({\n position: PropTypes.number,\n loading: PropTypes.bool,\n loadingAriaLabel: PropTypes.string,\n animationType: PropTypes.string, // 'unstack' | 'restack'\n isCorrect: PropTypes.bool,\n animateCorrectionPopin: PropTypes.bool,\n showCorrectionPopin: PropTypes.bool,\n disableContent: PropTypes.bool,\n parentContentTitle: PropTypes.string,\n questionText: PropTypes.string,\n answerUI: PropTypes.shape(AnswerPropTypes)\n});\n\nconst propTypes = {\n slideIndex: PropTypes.string,\n slide: SlidePropsTypes,\n validateButton: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n disabled: PropTypes.bool\n }),\n correctionPopinProps: PropTypes.shape({\n klf: ReviewCorrectionPopinPropTypes.klf,\n information: ReviewCorrectionPopinPropTypes.information,\n next: PropTypes.shape({\n label: PropTypes.string,\n 'aria-label': PropTypes.string // Pourquoi le onClick du next n'est pas ici !\n // updateSlidesOnNext: PropTypes.func.isRequired ???\n }),\n resultLabel: ReviewCorrectionPopinPropTypes.resultLabel,\n type: ReviewCorrectionPopinPropTypes.type\n })\n};\n\nexport default propTypes;\n\nexport type PopinProps = {\n correctionPopinProps: ReviewCorrectionPopinProps;\n slideIndex: string;\n showCorrectionPopin?: boolean;\n animateCorrectionPopin?: boolean;\n};\n\nexport type ValidateButtonProps = {\n slideIndex: string;\n validateButton: ReviewSlideProps['validateButton'];\n primarySkinColor?: string;\n};\n\nexport type SlideProps = {\n position: number;\n loading: boolean;\n loadingAriaLabel?: string;\n animationType?: 'unstack' | 'restack';\n isCorrect?: boolean;\n animateCorrectionPopin?: boolean;\n showCorrectionPopin?: boolean;\n parentContentTitle?: string;\n questionText?: string;\n answerUI?: AnswerProps;\n};\n\nexport type ReviewSlideProps = {\n slideIndex: string;\n num: number;\n slide: SlideProps;\n correctionPopinProps?: ReviewCorrectionPopinProps;\n validateButton: {\n label: string;\n onClick: () => void;\n disabled: boolean;\n };\n};\n"],"mappings":";;;;;AAAA;;AACA;;AAGA;;;;AAEO,MAAMA,eAAe,GAAGC,kBAAA,CAAUC,KAAV,CAAgB;EAC7CC,QAAQ,EAAEF,kBAAA,CAAUG,MADyB;EAE7CC,OAAO,EAAEJ,kBAAA,CAAUK,IAF0B;EAG7CC,gBAAgB,EAAEN,kBAAA,CAAUO,MAHiB;EAI7CC,aAAa,EAAER,kBAAA,CAAUO,MAJoB;EAIZ;EACjCE,SAAS,EAAET,kBAAA,CAAUK,IALwB;EAM7CK,sBAAsB,EAAEV,kBAAA,CAAUK,IANW;EAO7CM,mBAAmB,EAAEX,kBAAA,CAAUK,IAPc;EAQ7CO,cAAc,EAAEZ,kBAAA,CAAUK,IARmB;EAS7CQ,kBAAkB,EAAEb,kBAAA,CAAUO,MATe;EAU7CO,YAAY,EAAEd,kBAAA,CAAUO,MAVqB;EAW7CQ,QAAQ,EAAEf,kBAAA,CAAUC,KAAV,CAAgBe,mBAAhB;AAXmC,CAAhB,CAAxB;;;AAcP,MAAMC,SAAS,GAAG;EAChBC,UAAU,EAAElB,kBAAA,CAAUO,MADN;EAEhBY,KAAK,EAAEpB,eAFS;EAGhBqB,cAAc,EAAEpB,kBAAA,CAAUC,KAAV,CAAgB;IAC9BoB,KAAK,EAAErB,kBAAA,CAAUO,MAAV,CAAiBe,UADM;IAE9BC,OAAO,EAAEvB,kBAAA,CAAUwB,IAAV,CAAeF,UAFM;IAG9BG,QAAQ,EAAEzB,kBAAA,CAAUK;EAHU,CAAhB,CAHA;EAQhBqB,oBAAoB,EAAE1B,kBAAA,CAAUC,KAAV,CAAgB;IACpC0B,GAAG,EAAEC,mBAAA,CAA+BD,GADA;IAEpCE,WAAW,EAAED,mBAAA,CAA+BC,WAFR;IAGpCC,IAAI,EAAE9B,kBAAA,CAAUC,KAAV,CAAgB;MACpBoB,KAAK,EAAErB,kBAAA,CAAUO,MADG;MAEpB,cAAcP,kBAAA,CAAUO,MAFJ,CAEW;MAC/B;;IAHoB,CAAhB,CAH8B;IAQpCwB,WAAW,EAAEH,mBAAA,CAA+BG,WARR;IASpCC,IAAI,EAAEJ,mBAAA,CAA+BI;EATD,CAAhB;AARN,CAAlB;eAqBef,S"}
|
|
@@ -4,7 +4,6 @@ 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>;
|
|
8
7
|
const sections: PropTypes.Requireable<((PropTypes.InferPropsInner<Pick<any, any>> & Partial<PropTypes.InferPropsInner<Pick<any, never>>>) | null | undefined)[]>;
|
|
9
8
|
const cookie: PropTypes.Requireable<PropTypes.InferProps<{
|
|
10
9
|
content: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/dashboard/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/dashboard/index.js"],"names":[],"mappings":";AAoBA,oDAoCC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
5
|
|
|
6
|
-
var _react =
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
7
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
|
|
@@ -25,11 +25,6 @@ var _style = _interopRequireDefault(require("./style.css"));
|
|
|
25
25
|
|
|
26
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
27
|
|
|
28
|
-
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); }
|
|
29
|
-
|
|
30
|
-
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; }
|
|
31
|
-
|
|
32
|
-
/* eslint-disable no-console */
|
|
33
28
|
const Hero = /*#__PURE__*/_react.default.memo(function Hero({
|
|
34
29
|
hero,
|
|
35
30
|
welcome
|
|
@@ -49,8 +44,7 @@ const Dashboard = props => {
|
|
|
49
44
|
sections = [],
|
|
50
45
|
hero,
|
|
51
46
|
welcome,
|
|
52
|
-
cookie
|
|
53
|
-
onLoadMoreSections
|
|
47
|
+
cookie
|
|
54
48
|
} = props;
|
|
55
49
|
|
|
56
50
|
const buildSectionComponent = section => {
|
|
@@ -94,29 +88,9 @@ const Dashboard = props => {
|
|
|
94
88
|
key: 'hero'
|
|
95
89
|
}, ...sections].map(section => /*#__PURE__*/_react.default.createElement("div", {
|
|
96
90
|
key: section.key
|
|
97
|
-
}, buildSection(section)));
|
|
98
|
-
|
|
99
|
-
const ref = (0, _react.useRef)(); // The scroll listener
|
|
100
|
-
|
|
101
|
-
const handleScroll = (0, _react.useCallback)(() => {
|
|
102
|
-
console.log('scrolling');
|
|
103
|
-
|
|
104
|
-
if (window.innerHeight + document.documentElement.scrollTop + 1 >= document.scrollingElement.scrollHeight) {
|
|
105
|
-
onLoadMoreSections ? onLoadMoreSections() : null;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
return;
|
|
109
|
-
}, [onLoadMoreSections]); // Attach the scroll listener to the div
|
|
110
|
-
|
|
111
|
-
(0, _react.useEffect)(() => {
|
|
112
|
-
const div = ref.current;
|
|
113
|
-
console.log('Div is', div); // Attach a scroll listener to the div
|
|
114
|
-
|
|
115
|
-
div.addEventListener('scroll', handleScroll);
|
|
116
|
-
}, [handleScroll]);
|
|
91
|
+
}, buildSection(section)));
|
|
117
92
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
118
93
|
className: _style.default.wrapper,
|
|
119
|
-
ref: ref,
|
|
120
94
|
"data-name": "dashboard"
|
|
121
95
|
}, sectionsList, cookie ? /*#__PURE__*/_react.default.createElement(_cmPopin.default, cookie) : null);
|
|
122
96
|
};
|
|
@@ -124,7 +98,6 @@ const Dashboard = props => {
|
|
|
124
98
|
Dashboard.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
125
99
|
hero: Hero.propTypes.hero,
|
|
126
100
|
welcome: Hero.propTypes.welcome,
|
|
127
|
-
onLoadMoreSections: _propTypes.default.func,
|
|
128
101
|
sections: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.shape(_battleRequestList.default.propTypes), _propTypes.default.shape(_cardsList.default.propTypes), _propTypes.default.shape(_newsList.default.propTypes), _propTypes.default.shape(_startBattle.default.propTypes)])),
|
|
129
102
|
cookie: _propTypes.default.shape(_cmPopin.default.propTypes)
|
|
130
103
|
} : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Hero","React","memo","hero","welcome","style","propTypes","PropTypes","shape","HeroCard","Slide","Dashboard","props","sections","cookie","
|
|
1
|
+
{"version":3,"file":"index.js","names":["Hero","React","memo","hero","welcome","style","propTypes","PropTypes","shape","HeroCard","Slide","Dashboard","props","sections","cookie","buildSectionComponent","section","type","buildSection","index","sectionView","sectionsList","key","map","wrapper","arrayOf","oneOfType","BattleRequestList","CardsList","NewsList","StartBattle","CMPopin"],"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;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,IAAI,gBAAGC,cAAA,CAAMC,IAAN,CAAW,SAASF,IAAT,CAAc;EAACG,IAAD;EAAOC;AAAP,CAAd,EAA+B;EACrD,oBAAO;IAAK,SAAS,EAAEC,cAAA,CAAMF;EAAtB,GAA6BA,IAAI,gBAAG,6BAAC,aAAD,EAAcA,IAAd,CAAH,gBAA4B,6BAAC,cAAD,EAAWC,OAAX,CAA7D,CAAP;AACD,CAFY,CAAb;;AAIAJ,IAAI,CAACM,SAAL,2CAAiB;EACfH,IAAI,EAAEI,kBAAA,CAAUC,KAAV,CAA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B,aAAU;EAAzC,GACGH,YADH,EAEGP,MAAM,gBAAG,6BAAC,gBAAD,EAAaA,MAAb,CAAH,GAA6B,IAFtC,CADF;AAMD,CApCD;;AAsCAH,SAAS,CAACL,SAAV,2CAAsB;EACpBH,IAAI,EAAEH,IAAI,CAACM,SAAL,CAAeH,IADD;EAEpBC,OAAO,EAAEJ,IAAI,CAACM,SAAL,CAAeF,OAFJ;EAGpBS,QAAQ,EAAEN,kBAAA,CAAUkB,OAAV,CACRlB,kBAAA,CAAUmB,SAAV,CAAoB,CAClBnB,kBAAA,CAAUC,KAAV,CAAgBmB,0BAAA,CAAkBrB,SAAlC,CADkB,EAElBC,kBAAA,CAAUC,KAAV,CAAgBoB,kBAAA,CAAUtB,SAA1B,CAFkB,EAGlBC,kBAAA,CAAUC,KAAV,CAAgBqB,iBAAA,CAASvB,SAAzB,CAHkB,EAIlBC,kBAAA,CAAUC,KAAV,CAAgBsB,oBAAA,CAAYxB,SAA5B,CAJkB,CAApB,CADQ,CAHU;EAWpBQ,MAAM,EAAEP,kBAAA,CAAUC,KAAV,CAAgBuB,gBAAA,CAAQzB,SAAxB;AAXY,CAAtB;eAaeK,S"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "10.30.
|
|
3
|
+
"version": "10.30.5-alpha.1+89ae722d1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -157,5 +157,5 @@
|
|
|
157
157
|
"last 2 versions",
|
|
158
158
|
"IE 11"
|
|
159
159
|
],
|
|
160
|
-
"gitHead": "
|
|
160
|
+
"gitHead": "89ae722d1ba04d6da01379267b41a137cac59318"
|
|
161
161
|
}
|