|
|
|
@ -23,11 +23,11 @@ import tw from "tailwind-rn"; |
|
|
|
|
const { height } = Dimensions.get("window"); |
|
|
|
|
const ios = Platform.OS === "ios"; |
|
|
|
|
|
|
|
|
|
function AR({ getArList, arList, mobile, theme }) { |
|
|
|
|
function AR({ getUserProducts, userProducts, mobile, theme }) { |
|
|
|
|
const [position, setPosition] = useState("100%"); |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
getArList(); |
|
|
|
|
getUserProducts(); |
|
|
|
|
StatusBar.setBarStyle( |
|
|
|
|
`${theme === "light" ? "dark" : "light"}-content`, |
|
|
|
|
true |
|
|
|
@ -67,7 +67,7 @@ function AR({ getArList, arList, mobile, theme }) { |
|
|
|
|
}} |
|
|
|
|
/> |
|
|
|
|
<Drawer setBoxPosition={setBoxPosition} position={position} /> |
|
|
|
|
{arList?.length ? ( |
|
|
|
|
{userProducts?.length ? ( |
|
|
|
|
<ScrollView |
|
|
|
|
style={{ |
|
|
|
|
paddingHorizontal: 16, |
|
|
|
@ -75,16 +75,16 @@ function AR({ getArList, arList, mobile, theme }) { |
|
|
|
|
}} |
|
|
|
|
contentContainerStyle={{ paddingBottom: 60 }} |
|
|
|
|
> |
|
|
|
|
<View |
|
|
|
|
style={tw( |
|
|
|
|
`flex justify-between flex-wrap ${ |
|
|
|
|
ios ? "flex-row-reverse" : "flex-row" |
|
|
|
|
}` |
|
|
|
|
)} |
|
|
|
|
> |
|
|
|
|
{arList?.map((book, index) => ( |
|
|
|
|
<Book book={book} key={index} /> |
|
|
|
|
))} |
|
|
|
|
<View style={tw(`flex justify-between flex-wrap flex-row-reverse`)}> |
|
|
|
|
{userProducts |
|
|
|
|
?.filter( |
|
|
|
|
(product) => |
|
|
|
|
(product?.productType === 2 || product?.productType === 3) && |
|
|
|
|
product?.condition >= 2 |
|
|
|
|
) |
|
|
|
|
?.map((book, index) => ( |
|
|
|
|
<Book book={book} key={index} /> |
|
|
|
|
))} |
|
|
|
|
</View> |
|
|
|
|
</ScrollView> |
|
|
|
|
) : ( |
|
|
|
@ -99,13 +99,13 @@ function AR({ getArList, arList, mobile, theme }) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const mapStateToProps = (state) => ({ |
|
|
|
|
arList: state.userProduct.arList, |
|
|
|
|
userProducts: state.userProduct.list, |
|
|
|
|
mobile: state.publicApi.mobile, |
|
|
|
|
theme: state.publicApi.theme |
|
|
|
|
theme: state.publicApi.theme, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const mapDispatchToProps = { |
|
|
|
|
getArList: userProduct.arList, |
|
|
|
|
getUserProducts: userProduct.list, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(AR); |
|
|
|
|