783a9f1bd0c98e867e3806744f874253.json
8.39 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 _StyleSheet=_interopRequireDefault(require(\"react-native-web/dist/exports/StyleSheet\"));var _View=_interopRequireDefault(require(\"react-native-web/dist/exports/View\"));var _reactRedux=require(\"react-redux\");var _PromptSearchRate=_interopRequireDefault(require(\"../PromptSearch/PromptSearchRate\"));var SentenceInfo=function SentenceInfo(props){return _react.default.createElement(_View.default,null,_react.default.createElement(_Text.default,{style:[styles.infoText,{color:props.color}]},props.info),_react.default.createElement(_Text.default,{style:[styles.Text,{color:props.color}]},props.Text));};var RateSentence=function RateSentence(_ref){var originalText=_ref.originalText,fixedText=_ref.fixedText,keywordText=_ref.keywordText;var _useState=(0,_react.useState)(0),_useState2=(0,_slicedToArray2.default)(_useState,2),count=_useState2[0],setCount=_useState2[1];var calCount=function calCount(){if(count>1||!keywordText)setCount(0);else setCount(count+1);};return _react.default.createElement(_Surface.default,{style:styles.surface,onTouchStart:calCount},keywordText?_react.default.createElement(_react.default.Fragment,null,_react.default.createElement(_View.default,null,count==0&&_react.default.createElement(SentenceInfo,{Text:originalText,info:'원래 검색 문장',color:'#B71C1C'}),count==1&&_react.default.createElement(SentenceInfo,{Text:fixedText,info:'맞춤법 교정 문장',color:'#2196F3'}),count==2&&_react.default.createElement(SentenceInfo,{Text:keywordText,info:'키워드 교정 문장',color:'#00a676'})),_react.default.createElement(_View.default,{style:{flexDirection:'column-reverse',height:50}},_react.default.createElement(_Text.default,null,\"\\uB20C\\uB7EC\\uC11C \\uBCC0\\uD654 \\uACFC\\uC815\\uC744 \\uC9C0\\uCF1C\\uBCF4\\uC138\\uC694!\"))):_react.default.createElement(_PromptSearchRate.default,null));};var styles=_StyleSheet.default.create({surface:{padding:8,flex:0.3,width:'95%',alignItems:'center',justifyContent:'center',elevation:2,marginTop:10},Text:{fontSize:25,textAlign:'center'},infoText:{fontSize:20,textAlign:'center'}});var RateSentenceContainer=function RateSentenceContainer(_ref2){var originalText=_ref2.originalText,fixedText=_ref2.fixedText,keywordText=_ref2.keywordText;return _react.default.createElement(RateSentence,{originalText:originalText,fixedText:fixedText,keywordText:keywordText});};var _default=(0,_reactRedux.connect)(function(_ref3){var search=_ref3.search;return{originalText:search.result.return_data.originalText,fixedText:search.result.return_data.fixedText,keywordText:search.result.return_data.keywordText};})(RateSentenceContainer);exports.default=_default;","map":{"version":3,"sources":["C:/Users/bluej/Desktop/2_2/searchGuide/searchGuide/components/RateSentence/RateSentence.js"],"names":["SentenceInfo","props","styles","infoText","color","info","Text","RateSentence","originalText","fixedText","keywordText","count","setCount","calCount","surface","flexDirection","height","StyleSheet","create","padding","flex","width","alignItems","justifyContent","elevation","marginTop","fontSize","textAlign","RateSentenceContainer","search","result","return_data"],"mappings":"oVAAA,qD,mXAGA,uCACA,0FAEA,GAAMA,CAAAA,YAAY,CAAG,QAAfA,CAAAA,YAAe,CAACC,KAAD,QACjB,8BAAC,aAAD,MACI,6BAAC,aAAD,EAAM,KAAK,CAAE,CAACC,MAAM,CAACC,QAAR,CAAiB,CAACC,KAAK,CAACH,KAAK,CAACG,KAAb,CAAjB,CAAb,EAAsDH,KAAK,CAACI,IAA5D,CADJ,CAEI,6BAAC,aAAD,EAAM,KAAK,CAAE,CAACH,MAAM,CAACI,IAAR,CAAa,CAACF,KAAK,CAACH,KAAK,CAACG,KAAb,CAAb,CAAb,EAAiDH,KAAK,CAACK,IAAvD,CAFJ,CADiB,EAArB,CAOA,GAAMC,CAAAA,YAAY,CAAG,QAAfA,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HF,CAILC,UAAU,CAAE,QAJP,CAKLC,cAAc,CAAE,QALX,CAMLC,SAAS,CAAE,CANN,CAOLC,SAAS,CAAE,EAPN,CADqB,CAU9BnB,IAAI,CAAC,CACDoB,QAAQ,CAAE,EADT,CAEDC,SAAS,CAAC,QAFT,CAVyB,CAc9BxB,QAAQ,CAAC,CACLuB,QAAQ,CAAE,EADL,CAELC,SAAS,CAAC,QAFL,CAdqB,CAAlB,CAAf,CAqBD,GAAMC,CAAAA,qBAAqB,CAAG,QAAxBA,CAAAA,qBAAwB,WAAGpB,CAAAA,YAAH,OAAGA,YAAH,CAAiBC,SAAjB,OAAiBA,SAAjB,CAA4BC,WAA5B,OAA4BA,WAA5B,OAC1B,8BAAC,YAAD,EAAc,YAAY,CAAEF,YAA5B,CAA0C,SAAS,CAAEC,SAArD,CAAgE,WAAW,CAAEC,WAA7E,EAD0B,EAA9B,C,aAIe,wBACX,mBAAEmB,CAAAA,MAAF,OAAEA,MAAF,OAAa,CACTrB,YAAY,CAAEqB,MAAM,CAACC,MAAP,CAAcC,WAAd,CAA0BvB,YAD/B,CAETC,SAAS,CAAEoB,MAAM,CAACC,MAAP,CAAcC,WAAd,CAA0BtB,SAF5B,CAGTC,WAAW,CAAEmB,MAAM,CAACC,MAAP,CAAcC,WAAd,CAA0BrB,WAH9B,CAAb,EADW,EAMbkB,qBANa,C","sourcesContent":["import React,{ useState } from 'react';\r\nimport { Surface, Text } from 'react-native-paper';\r\nimport { StyleSheet,View } from 'react-native';\r\nimport {connect} from 'react-redux';\r\nimport PromptSearchRate from '../PromptSearch/PromptSearchRate';\r\n\r\nconst SentenceInfo = (props) => (\r\n <View>\r\n <Text style={[styles.infoText,{color:props.color}]} >{props.info}</Text>\r\n <Text style={[styles.Text,{color:props.color}]}>{props.Text}</Text>\r\n </View> \r\n)\r\n\r\nconst RateSentence = ({originalText, fixedText, keywordText }) => {\r\n const [ count,setCount ] = useState(0);\r\n\r\n const calCount = () => {\r\n if(count > 1 || !keywordText) setCount(0);\r\n else setCount(count+1);\r\n }\r\n\r\n return (\r\n <Surface style={styles.surface} onTouchStart={calCount} >\r\n { keywordText ?\r\n <>\r\n <View>\r\n {count == 0 && ( <SentenceInfo Text={originalText} info={'원래 검색 문장'} color={'#B71C1C'} />) }\r\n {count == 1 && ( <SentenceInfo Text={fixedText} info={'맞춤법 교정 문장'} color={'#2196F3'} />) }\r\n {count == 2 && ( <SentenceInfo Text={keywordText} info={'키워드 교정 문장'} color={'#00a676'} />) }\r\n </View> \r\n <View style={{flexDirection:'column-reverse', height:50}}>\r\n <Text >눌러서 변화 과정을 지켜보세요!</Text>\r\n </View>\r\n \r\n </>\r\n : <PromptSearchRate />\r\n }\r\n \r\n </Surface>\r\n )\r\n}\r\n\r\n const styles = StyleSheet.create({\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 textAlign:'center'\r\n },\r\n infoText:{\r\n fontSize: 20,\r\n textAlign:'center'\r\n }\r\n});\r\n\r\n\r\nconst RateSentenceContainer = ( {originalText, fixedText, keywordText } ) => (\r\n <RateSentence originalText={originalText} fixedText={fixedText} keywordText={keywordText} />\r\n);\r\n\r\nexport default connect(\r\n ({search})=>({\r\n originalText: search.result.return_data.originalText,\r\n fixedText: search.result.return_data.fixedText,\r\n keywordText: search.result.return_data.keywordText\r\n })\r\n)(RateSentenceContainer);"]},"metadata":{},"sourceType":"script"}