|
@@ -1,10 +1,66 @@
|
|
|
-import React from 'react';
|
|
|
+import React, {useState} from 'react';
|
|
|
+import {StyleSheet} from 'react-native';
|
|
|
|
|
|
import C from 'rn-class'
|
|
|
+import Accordion from 'react-native-collapsible/Accordion';
|
|
|
+import moment from 'moment';
|
|
|
|
|
|
export default (props)=>{
|
|
|
+ let [activeSections , setActiveSections] = useState([0])
|
|
|
+ let arr = [ { title : "뉴욕 서비스가 3월 13일 시작됩니다. " , content : "뉴욕 서비스가 3월 13일 시작됩니다. 뉴욕 서비스가 3월 13일 시작됩니다. " , createdAt : "2019-08-19T13:02:00.184Z"},
|
|
|
+ { title : " 서비스 장애데 대하여 알려드립니다. " , content : "서울에서 가장 오래된 초등학교를 찾아 뒷문을 찾아보세요!!!\n주신 박카스의 은총이 깃들어 있답니다." , createdAt : "2019-08-19T13:02:00.184Z"},
|
|
|
+ { title : "asdf1" , content : "sadjsaljdkasjdklajsdkl" , createdAt : "2019-08-19T13:02:00.184Z"},
|
|
|
+ { title : "asdf1" , content : "sadjsaljdkasjdklajsdkl" , createdAt : "2019-08-19T13:02:00.184Z"}
|
|
|
+ ];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ _renderHeader = (section, idx )=> {
|
|
|
+ return (
|
|
|
+ <C.View cls={`flx-row bgc-color-gray-light-v1 ma2 br3 pa2 ai-c ${activeSections[0] == idx ? "mb0 br-bl0 br-br0" : ""}`}>
|
|
|
+ <C.Text cls="flx0.7 f1.8">{section.title}</C.Text>
|
|
|
+
|
|
|
+ <C.Text cls="flx0.2 f1.5 jc-c">{moment(section.createdAt).format("YYYY-MM-DD") }</C.Text>
|
|
|
+
|
|
|
+ <C.View cls="flx0.1">
|
|
|
+ <C.EL.Icon name={activeSections[0] == idx ? "caretup":"caretdown"} type="antdesign" ccls="f3" />
|
|
|
+ </C.View>
|
|
|
+ </C.View>
|
|
|
+ );
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ _renderContent = section => {
|
|
|
+ return (
|
|
|
+ <C.View cls="bbw0.3 blw0.3 brw0.3 pv2 ph3 mh2 bc-color-gray-light-v1 br-bl3 br-br3 mt-1.5">
|
|
|
+ <C.Text>{section.content}</C.Text>
|
|
|
+ </C.View>
|
|
|
+ );
|
|
|
+ };
|
|
|
+
|
|
|
return (
|
|
|
<C.View cls="flx1 bgc-color-white">
|
|
|
+ <C.EL.Header
|
|
|
+ ccls="bgc-color-transparent"
|
|
|
+ leftComponent={<C.EL.Icon type="antdesign" name="close" onPress={()=>props.navigation.goBack()}/>}
|
|
|
+ >
|
|
|
+ </C.EL.Header>
|
|
|
+ <C.View cls="ai-c">
|
|
|
+ <C.Text cls="f6 fw-b"> FaQ</C.Text>
|
|
|
+ </C.View>
|
|
|
+ <C.View cls="flx1">
|
|
|
+ <Accordion
|
|
|
+ sections={arr}
|
|
|
+ underlayColor ={"#FFF"}
|
|
|
+ activeSections={activeSections}
|
|
|
+ // renderSectionTitle={_renderSectionTitle}
|
|
|
+ renderHeader={_renderHeader}
|
|
|
+ renderContent={_renderContent}
|
|
|
+ onChange={sections =>{setActiveSections(sections)}}
|
|
|
+ />
|
|
|
+
|
|
|
+ </C.View>
|
|
|
+
|
|
|
</C.View>
|
|
|
)
|
|
|
|