{"version":3,"file":"index.js","sources":["../src/components/Common/test.tsx"],"sourcesContent":["import React, { PureComponent } from \"react\";\r\nimport classnames from 'classnames';\r\n\r\nimport styles from './test.less';\r\n\r\nexport const ImgRowList = (\r\n imglist: Array,\r\n outterKey: string,\r\n type: string | null = 'normal',\r\n) => {\r\n if (!imglist || !Array.isArray(imglist)) return null;\r\n return (\r\n \r\n {imglist.map((image_url: string, index: number) => {\r\n return (\r\n \r\n {`comment\r\n \r\n );\r\n })}\r\n \r\n );\r\n};\r\n\r\ninterface MyNormalListProps {\r\n style?: any;\r\n renderItem: Function | any;\r\n renderData: Array;\r\n}\r\nexport class MyNormalList extends PureComponent {\r\n render() {\r\n const {\r\n style: innerStyle = {},\r\n renderItem = () => {},\r\n renderData = [],\r\n } = this.props;\r\n\r\n if (!renderData || !Array.isArray(renderData)) {\r\n console.error('MyNormalList Components renderData Props must be Array');\r\n return null;\r\n }\r\n\r\n return (\r\n
\r\n {renderData.map((value, index, arr) => renderItem(value, index))}\r\n
\r\n );\r\n }\r\n}\r\n\r\ninterface NormalCardProps {\r\n key: any;\r\n userinfo: {\r\n nickname: string | any;\r\n avatar: string | any;\r\n created: string | number;\r\n };\r\n main_content: any;\r\n append_content?: any;\r\n content_img_assets?: Array;\r\n options?: {\r\n header_size?: 'small' | 'normal' | 'middle';\r\n bottom_divider?: boolean;\r\n };\r\n}\r\nexport class NormalCard extends PureComponent {\r\n render() {\r\n const {\r\n userinfo: { nickname, avatar, created } = {\r\n nickname: '',\r\n avatar: '',\r\n created: '',\r\n },\r\n main_content = null,\r\n append_content = null,\r\n content_img_assets = [],\r\n options = {\r\n header_size: 'normal',\r\n bottom_divider: false,\r\n },\r\n } = this.props;\r\n //\r\n\r\n const RENDEROPTIONS_showImgList =\r\n content_img_assets && content_img_assets.length > 0;\r\n\r\n return (\r\n \r\n \r\n
\r\n {typeof avatar === 'string' ? (\r\n
\r\n \"user_avatar\"\r\n
\r\n ) : (\r\n avatar\r\n )}\r\n
{nickname}
\r\n
\r\n
\r\n {main_content}\r\n {RENDEROPTIONS_showImgList\r\n ? ImgRowList(content_img_assets, this.props.key)\r\n : null}\r\n
\r\n
{append_content}
\r\n \r\n );\r\n }\r\n}\r\n\r\ninterface ShareCardProps {\r\n isMobile: boolean | any;\r\n mode: 'line' | 'block';\r\n render_mode: 'text' | 'object';\r\n share_data: any;\r\n}\r\nexport class ShareCard extends PureComponent {\r\n render() {\r\n const {\r\n isMobile = false,\r\n render_mode = 'text',\r\n mode = 'line',\r\n share_data = '',\r\n } = this.props;\r\n\r\n return (\r\n \r\n {render_mode === 'text' ? share_data : null}\r\n \r\n );\r\n }\r\n}\r\n\r\n// type TransmitType = 'imgTxt' | 'shortVideo' | 'microVideo';\r\n// type TransmitImgTxtData = {\r\n// user_id?: string|number;\r\n// anonymity?: boolean;\r\n// avatar?: string;\r\n// nickname?: string;\r\n// is_long?: boolean;\r\n// }\r\n\r\n// interface TransmitCardProps {\r\n// type: TransmitType;\r\n// data: TransmitImgTxtData;\r\n// }\r\n\r\n// export class TransmitCard extends React.PureComponent {\r\n// renderVideo() {\r\n// return
Video
;\r\n// }\r\n\r\n// renderImgTxt() {\r\n// const { data } = this.props;\r\n// const {\r\n// user_id,\r\n// anonymity,\r\n// avatar,\r\n// nickname,\r\n// is_long,\r\n// } = data;\r\n\r\n// return (\r\n//
\r\n//
\r\n// \r\n// \r\n// \r\n//
\r\n// \r\n// {nickname}\r\n// \r\n//
\r\n//
\r\n// {is_long\r\n// ? intl.get('bilingually.imgtxt.article')\r\n// : intl.get('bilingually.imgtxt')}\r\n//
\r\n//
\r\n//
\r\n// );\r\n// }\r\n\r\n// render() {\r\n// const { type } = this.props;\r\n// if (type === 'imgTxt') {\r\n// this.renderImgTxt();\r\n// }\r\n// if (type === 'shortVideo' || type === 'microVideo') {\r\n// this.renderVideo();\r\n// }\r\n// return null;\r\n// }\r\n// }\r\n\r\nexport const Test = \"TestComponent\";\r\nexport const TestRedTxt = () => (\r\n
\r\n RedTxt\r\n
\r\n)\r\n\r\nexport default {\r\n MyNormalList,\r\n NormalCard,\r\n ShareCard,\r\n Test,\r\n // TransmitCard\r\n};"],"names":["Test"],"mappings":";;;;;;;;;;;;;;;;AAuJA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoEA,IAAaA,IAAI,GAAG,eAAb;;;;;;;;"}