diff --git a/packages/concordia-app/src/components/Pagination/PaginatedTopicList/styles.css b/packages/concordia-app/src/components/Pagination/PaginatedTopicList/styles.css deleted file mode 100644 index 6bbac7b..0000000 --- a/packages/concordia-app/src/components/Pagination/PaginatedTopicList/styles.css +++ /dev/null @@ -1,4 +0,0 @@ -#topic-list{ - height: auto; - clear: both; -} diff --git a/packages/concordia-app/src/components/Pagination/index.jsx b/packages/concordia-app/src/components/PaginationComponent.jsx similarity index 100% rename from packages/concordia-app/src/components/Pagination/index.jsx rename to packages/concordia-app/src/components/PaginationComponent.jsx diff --git a/packages/concordia-app/src/components/PostList/index.jsx b/packages/concordia-app/src/components/PostList/index.jsx index e2ca121..064d5a0 100644 --- a/packages/concordia-app/src/components/PostList/index.jsx +++ b/packages/concordia-app/src/components/PostList/index.jsx @@ -20,23 +20,14 @@ const PostList = (props) => { useEffect(() => { if (drizzleInitialized && !drizzleInitializationFailed && !loading) { - const newPostsFound = postIds - .filter((postId) => !getPostCallHashes - .map((getPostCallHash) => getPostCallHash.id) - .includes(postId)); - - if (newPostsFound.length > 0) { - setGetPostCallHashes([ - ...getPostCallHashes, - ...newPostsFound - .map((postId) => ({ - id: postId, - hash: getPostChainData(postId), - })), - ]); - } + setGetPostCallHashes( + postIds.map((postId) => ({ + id: postId, + hash: getPostChainData(postId), + })), + ); } - }, [drizzleInitializationFailed, drizzleInitialized, getPostCallHashes, loading, postIds]); + }, [drizzleInitializationFailed, drizzleInitialized, loading, postIds]); const posts = useMemo(() => { if (loading) { diff --git a/packages/concordia-app/src/components/TopicList/index.jsx b/packages/concordia-app/src/components/TopicList/index.jsx index 2941848..8ebde2a 100644 --- a/packages/concordia-app/src/components/TopicList/index.jsx +++ b/packages/concordia-app/src/components/TopicList/index.jsx @@ -6,13 +6,14 @@ import { useSelector } from 'react-redux'; import { List } from 'semantic-ui-react'; import { FORUM_CONTRACT } from 'concordia-shared/src/constants/contracts/ContractNames'; import TopicListRow from './TopicListRow'; +import PaginationComponent from '../PaginationComponent'; import { drizzle } from '../../redux/store'; import './styles.css'; const { contracts: { [FORUM_CONTRACT]: { methods: { getTopic: { cacheCall: getTopicChainData } } } } } = drizzle; const TopicList = (props) => { - const { topicIds } = props; + const { topicIds, numberOfItems, onPageChange } = props; const [getTopicCallHashes, setGetTopicCallHashes] = useState([]); const drizzleInitialized = useSelector((state) => state.drizzleStatus.initialized); const drizzleInitializationFailed = useSelector((state) => state.drizzleStatus.failed); @@ -44,14 +45,19 @@ const TopicList = (props) => { }), [getTopicCallHashes, topicIds]); return ( - - {topics} - +
+ + {topics} + + +
); }; TopicList.propTypes = { topicIds: PropTypes.arrayOf(PropTypes.number).isRequired, + numberOfItems: PropTypes.number.isRequired, + onPageChange: PropTypes.func, }; export default TopicList; diff --git a/packages/concordia-app/src/views/Home/Board/index.jsx b/packages/concordia-app/src/views/Home/Board/index.jsx deleted file mode 100644 index 618ea7f..0000000 --- a/packages/concordia-app/src/views/Home/Board/index.jsx +++ /dev/null @@ -1,67 +0,0 @@ -import React, { useMemo } from 'react'; -import { Button, Header } from 'semantic-ui-react'; -import { useSelector } from 'react-redux'; -import { useHistory } from 'react-router'; -import { useTranslation } from 'react-i18next'; -import PropTypes from 'prop-types'; -import PaginatedTopicList from '../../../components/Pagination/PaginatedTopicList'; -import './styles.css'; - -const Board = (props) => { - const { numberOfTopics } = props; - const hasSignedUp = useSelector((state) => state.user.hasSignedUp); - const history = useHistory(); - const { t } = useTranslation(); - - const boardContents = useMemo(() => ( - <> - {hasSignedUp - ? ( -