You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

74 lines
1.9 KiB

import React, { useState, useEffect } from "react";
import { connect } from "react-redux";
import {
View,
StyleSheet,
Dimensions,
ScrollView,
SafeAreaView,
Platform,
StatusBar,
LayoutAnimation,
} from "react-native";
import Navbar from "../../components/Navbar";
import tw from "tailwind-rn";
import Scroll from "./components/Scroll";
import MyBooks from "./components/MyBooks";
import Videos from "./components/Videos";
import Blogs from "./components/Blogs";
import Drawer from "../../components/Drawer";
// import { SafeAreaView } from 'react-native-safe-area-context';
// Within your render function
const Home = ({ isLogin }) => {
const [position, setPosition] = useState("100%");
const setBoxPosition = () => {
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
setPosition(position === "100%" ? "0%" : "100%");
};
return (
<SafeAreaView
style={{
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
position: "relative",
}}
>
<Navbar setBoxPosition={setBoxPosition} />
<Drawer setBoxPosition={setBoxPosition} position={position} />
<ScrollView
contentContainerStyle={styles.contentContainerStyle}
style={[styles.container, tw("w-full flex flex-col")]}
>
<MyBooks />
<Scroll />
<Videos />
<Blogs />
</ScrollView>
</SafeAreaView>
);
};
// Later on in your styles..
const styles = StyleSheet.create({
contentContainerStyle: {
paddingBottom: 100,
},
container: {
width: Dimensions.get("window").width,
backgroundColor: "white",
flexDirection: "column",
paddingVertical: 0,
paddingHorizontal: 0,
},
});
const mapStateToProps = (state) => ({
isLogin: state.user.status,
});
const mapDispatchToProps = {};
export default connect(mapStateToProps, mapDispatchToProps)(Home);