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