1602a93f12c45fe92e46f27f3021c2c8.json 11.1 KB
{"ast":null,"code":"var _interopRequireWildcard=require(\"@babel/runtime/helpers/interopRequireWildcard\");var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.default=void 0;var _slicedToArray2=_interopRequireDefault(require(\"@babel/runtime/helpers/slicedToArray\"));var _react=_interopRequireWildcard(require(\"react\"));var _Surface=_interopRequireDefault(require(\"react-native-paper/lib/module/components/Surface\"));var _Text=_interopRequireDefault(require(\"react-native-paper/lib/module/components/Typography/Text\"));var _HelperText=_interopRequireDefault(require(\"react-native-paper/lib/module/components/HelperText\"));var _StyleSheet=_interopRequireDefault(require(\"react-native-web/dist/exports/StyleSheet\"));var _View=_interopRequireDefault(require(\"react-native-web/dist/exports/View\"));var _reactNativeSvgCharts=require(\"react-native-svg-charts\");var _PromptSearchRate=_interopRequireDefault(require(\"../PromptSearch/PromptSearchRate\"));var _default=RateBar=function RateBar(props){var _useState=(0,_react.useState)(0),_useState2=(0,_slicedToArray2.default)(_useState,2),click=_useState2[0],setClick=_useState2[1];return _react.default.createElement(_Surface.default,{style:styles.surface},props.score.msg.length?_react.default.createElement(_react.default.Fragment,null,_react.default.createElement(_View.default,{style:styles.container},_react.default.createElement(_Text.default,{style:styles.Text},\"\\uCD1D \\uC810\\uC218 : \",props.score.full),_react.default.createElement(_View.default,{style:styles.colorContainer},_react.default.createElement(_View.default,{style:styles.textContainer},_react.default.createElement(_View.default,{style:styles.colorA}),_react.default.createElement(_Text.default,null,\"\\uD0A4\\uC6CC\\uB4DC \\uC810\\uC218\")),_react.default.createElement(_View.default,{style:styles.textContainer},_react.default.createElement(_View.default,{style:styles.colorB}),_react.default.createElement(_Text.default,null,\"\\uB9DE\\uCDA4\\uBC95 \\uC810\\uC218\")))),_react.default.createElement(_reactNativeSvgCharts.StackedBarChart,{data:[{keyword:{value:props.score.key,svg:{onPressIn:function onPressIn(){setClick(1);},onPressOut:function onPressOut(){setClick(0);}}},korean:{value:props.score.fix,svg:{onPressIn:function onPressIn(){setClick(2);},onPressOut:function onPressOut(){setClick(0);}}},rest:{value:100-(props.score.key+props.score.fix)}}],style:{height:50,width:'90%'},keys:['keyword','korean','rest'],colors:['#ffaa5a','#2cc3c2','#ffffff'],showGrid:false,horizontal:true,contentInset:{top:10},valueAccessor:function valueAccessor(_ref){var item=_ref.item,key=_ref.key;return item[key].value;}}),_react.default.createElement(_View.default,{style:styles.infoContainer},_react.default.createElement(_HelperText.default,{type:'info',visible:click==1,style:{fontSize:20}},\"\\uD0A4\\uC6CC\\uB4DC : \",props.score.key),_react.default.createElement(_HelperText.default,{type:'info',visible:click==2,style:{fontSize:20}},\"\\uB9DE\\uCDA4\\uBC95 : \",props.score.fix)),_react.default.createElement(_Text.default,null,\"\\uB20C\\uB7EC\\uC11C \\uAC01\\uAC01\\uC758 \\uC810\\uC218\\uB97C \\uC54C\\uC544\\uBCF4\\uC138\\uC694!\")):_react.default.createElement(_PromptSearchRate.default,null));};exports.default=_default;var styles=_StyleSheet.default.create({container:{width:'100%',flexDirection:'row',justifyContent:'center'},colorContainer:{position:\"absolute\",right:0},colorA:{backgroundColor:'#ffaa5a',height:7,width:7,marginRight:5},colorB:{backgroundColor:'#2cc3c2',height:7,width:7,marginRight:5},textContainer:{flexDirection:'row',justifyContent:'center',alignItems:'center'},infoContainer:{flexDirection:'row',justifyContent:'center',alignItems:'center',width:'100%'},surface:{padding:8,flex:0.3,width:'95%',alignItems:'center',justifyContent:'center',elevation:2,marginTop:10},Text:{fontSize:25}});","map":{"version":3,"sources":["C:/Users/bluej/Desktop/2_2/searchGuide/searchGuide/components/RateBar/RateBar.js"],"names":["RateBar","props","click","setClick","styles","surface","score","msg","length","container","Text","full","colorContainer","textContainer","colorA","colorB","keyword","value","key","svg","onPressIn","onPressOut","korean","fix","rest","height","width","top","item","infoContainer","fontSize","StyleSheet","create","flexDirection","justifyContent","position","right","backgroundColor","marginRight","alignItems","padding","flex","elev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A,MAAM,CAAG2B,oBAAWC,MAAX,CAAkB,CAC7BvB,SAAS,CAAC,CACNiB,KAAK,CAAE,MADD,CAENO,aAAa,CAAC,KAFR,CAGNC,cAAc,CAAC,QAHT,CADmB,CAM7BtB,cAAc,CAAC,CACXuB,QAAQ,CAAC,UADE,CAEXC,KAAK,CAAC,CAFK,CANc,CAU7BtB,MAAM,CAAC,CACHuB,eAAe,CAAC,SADb,CAEHZ,MAAM,CAAE,CAFL,CAGHC,KAAK,CAAE,CAHJ,CAIHY,WAAW,CAAE,CAJV,CAVsB,CAgB7BvB,MAAM,CAAC,CACHsB,eAAe,CAAC,SADb,CAEHZ,MAAM,CAAE,CAFL,CAGHC,KAAK,CAAE,CAHJ,CAIHY,WAAW,CAAE,CAJV,CAhBsB,CAsB7BzB,aAAa,CAAC,CACVoB,aAAa,CAAC,KADJ,CAEVC,cAAc,CAAC,QAFL,CAGVK,UAAU,CAAC,QAHD,CAtBe,CA2B7BV,aAAa,CAAC,CACVI,aAAa,CAAC,KADJ,CAEVC,cAAc,CAAC,QAFL,CAGVK,UAAU,CAAC,QAHD,CAIVb,KAAK,CAAE,MAJG,CA3Be,CAiC7BrB,OAAO,CAAE,CACLmC,OAAO,CAAE,CADJ,CAELC,IAAI,CAAE,GAFD,CAGLf,KAAK,CAAE,KAHF,CAILa,UAAU,CAAE,QAJP,CAKLL,cAAc,CAAE,QALX,CAMLQ,SAAS,CAAE,CANN,CAOLC,SAAS,CAAE,EAPN,CAjCoB,CA0C7BjC,IAAI,CAAC,CACDoB,QAAQ,CAAE,EADT,CA1CwB,CAAlB,CAAf","sourcesContent":["import React,{ useState } from 'react';\r\nimport { Surface, Text ,HelperText} from 'react-native-paper';\r\nimport { StyleSheet,View } from 'react-native';\r\nimport { StackedBarChart  } from 'react-native-svg-charts';\r\nimport PromptSearchRate from '../PromptSearch/PromptSearchRate';\r\n\r\nexport default RateBar = (props) => {\r\n    const [ click,setClick ] = useState(0);\r\n\r\n    return (\r\n        <Surface style={styles.surface}>\r\n            \r\n            {props.score.msg.length ?\r\n            <>\r\n            <View style={styles.container}>\r\n                <Text style={styles.Text}>총 점수 : {props.score.full}</Text>\r\n                <View style={styles.colorContainer}>\r\n                    <View style={styles.textContainer}>\r\n                        <View style={styles.colorA}></View><Text>키워드 점수</Text>\r\n                    </View>\r\n                    <View style={styles.textContainer}>\r\n                        <View style={styles.colorB}></View><Text>맞춤법 점수</Text>\r\n                    </View>\r\n                </View>\r\n            </View>\r\n            <StackedBarChart  \r\n            data={ [{\r\n                keyword: {\r\n                    value: props.score.key,\r\n                    svg: {\r\n                        onPressIn: () => {setClick(1)},\r\n                        onPressOut: ()=>{setClick(0)}\r\n                    },\r\n                },\r\n                korean: {\r\n                    value: props.score.fix,\r\n                    svg: {\r\n                        onPressIn: () => {setClick(2)},\r\n                        onPressOut: ()=>{setClick(0)}\r\n                    },\r\n                }, \r\n                rest: {\r\n                    value: (100-(props.score.key+props.score.fix)),\r\n                }\r\n            }]} \r\n            style={{height:50, width:'90%'}}\r\n            keys={['keyword','korean','rest']} \r\n            colors={['#ffaa5a','#2cc3c2','#ffffff']}\r\n            showGrid={ false }\r\n            horizontal={ true }\r\n            contentInset={ { top: 10 } }  \r\n            valueAccessor={({ item, key }) => item[key].value}\r\n            /> \r\n            <View style={styles.infoContainer}>\r\n                <HelperText type={'info'} visible={click==1} style={{fontSize:20}}>키워드 : {props.score.key}</HelperText>\r\n                <HelperText type={'info'} visible={click==2} style={{fontSize:20}}>맞춤법 : {props.score.fix}</HelperText>\r\n            </View>\r\n            <Text>눌러서 각각의 점수를 알아보세요!</Text>\r\n            </>\r\n            : <PromptSearchRate />}\r\n        </Surface>\r\n        \r\n     );\r\n}\r\n\r\n\r\n\r\nconst styles = StyleSheet.create({\r\n    container:{\r\n        width: '100%',\r\n        flexDirection:'row',\r\n        justifyContent:'center',\r\n    },\r\n    colorContainer:{\r\n        position:\"absolute\",\r\n        right:0,\r\n    },\r\n    colorA:{\r\n        backgroundColor:'#ffaa5a',\r\n        height: 7,\r\n        width: 7,\r\n        marginRight: 5,\r\n    },\r\n    colorB:{\r\n        backgroundColor:'#2cc3c2',\r\n        height: 7,\r\n        width: 7,\r\n        marginRight: 5,\r\n    },\r\n    textContainer:{\r\n        flexDirection:'row',\r\n        justifyContent:'center',\r\n        alignItems:'center'\r\n    },\r\n    infoContainer:{\r\n        flexDirection:'row',\r\n        justifyContent:'center',\r\n        alignItems:'center',\r\n        width: '100%'\r\n    },\r\n    surface: {\r\n        padding: 8,\r\n        flex: 0.3,\r\n        width: '95%',\r\n        alignItems: 'center',\r\n        justifyContent: 'center',\r\n        elevation: 2,\r\n        marginTop: 10\r\n    },\r\n    Text:{\r\n        fontSize: 25,\r\n    },\r\n});\r\n"]},"metadata":{},"sourceType":"script"}