63 lines
1.4 KiB
63 lines
1.4 KiB
import React, { useState, useEffect } from "react"; |
|
import { |
|
StyleSheet, |
|
ScrollView, |
|
SafeAreaView, |
|
Dimensions, |
|
StatusBar, |
|
} from "react-native"; |
|
import tw from 'tailwind-rn'; |
|
import { connect } from "react-redux"; |
|
import { qr } from "../../redux/actions"; |
|
import Content from "./Content"; |
|
import Navbar from "../../components/Navbar"; |
|
|
|
const {height} = Dimensions.get("window"); |
|
|
|
function QRContent({ route, getQrData, data, grades }) { |
|
useEffect(() => { |
|
getQrData({ tail: route.params.data }); |
|
}, []); |
|
|
|
useEffect(() => { |
|
if (data) { |
|
// (data.qr.content); |
|
} |
|
}, [data]); |
|
return ( |
|
<SafeAreaView |
|
style={{ |
|
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0, |
|
height: height, |
|
backgroundColor: 'white' |
|
}} |
|
> |
|
<Navbar |
|
headerOptions={{ |
|
logo: false, |
|
menu: false, |
|
hamburgerMenu: false, |
|
title: "", |
|
bookmark: false, |
|
qr: false, |
|
back: true, |
|
}} |
|
/> |
|
<ScrollView |
|
> |
|
{data && <Content data={data} grades={grades} />} |
|
</ScrollView> |
|
</SafeAreaView> |
|
); |
|
} |
|
|
|
const mapStateToProps = (state) => ({ |
|
data: state.qr.list, |
|
grades : state.publicApi.grades |
|
}); |
|
|
|
const mapDispatchToProps = { |
|
getQrData: qr.info, |
|
}; |
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(QRContent);
|
|
|