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.
31 lines
823 B
31 lines
823 B
import React, { useState, useEffect } from "react"; |
|
import { connect } from "react-redux"; |
|
import { publicApi } from "../../redux/actions"; |
|
import Book from "./layouts/Book"; |
|
|
|
function AR({ getArList, arList, headerOptions, setHeaderOptions }) { |
|
|
|
useEffect(() => { |
|
setHeaderOptions(headerOptions); |
|
getArList(); |
|
|
|
}, []); |
|
|
|
return ( |
|
<div className="flex flex-col flex-1 gap-4 px-4 lg:w-1/2 lg:min-h-screen lg:py-24 lg:mx-auto"> |
|
{arList.length > 0 && |
|
arList.map((book, index) => <Book book={book} key={index} />)} |
|
</div> |
|
); |
|
} |
|
|
|
const mapStateToProps = (state) => ({ |
|
arList: state.publicApi.arList, |
|
}); |
|
|
|
const mapDispatchToProps = { |
|
getArList: publicApi.getArList, |
|
setHeaderOptions : publicApi.setHeaderOptions, |
|
}; |
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(AR);
|
|
|