From 4922b99706366ffc96967b343cc5ab6ff4962f2a Mon Sep 17 00:00:00 2001 From: Linda Paiste Date: Sat, 15 Jul 2023 12:08:07 -0500 Subject: [PATCH] delete unused code in CollectionView --- client/modules/User/pages/CollectionView.jsx | 93 +++----------------- 1 file changed, 11 insertions(+), 82 deletions(-) diff --git a/client/modules/User/pages/CollectionView.jsx b/client/modules/User/pages/CollectionView.jsx index 64ccc001a9..98b07ef4c6 100644 --- a/client/modules/User/pages/CollectionView.jsx +++ b/client/modules/User/pages/CollectionView.jsx @@ -1,92 +1,21 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import { connect } from 'react-redux'; -import { withTranslation } from 'react-i18next'; - +import { useParams } from 'react-router-dom'; import Nav from '../../../components/Nav'; import RootPage from '../../../components/RootPage'; - -import CollectionCreate from '../components/CollectionCreate'; import Collection from '../components/Collection'; -class CollectionView extends React.Component { - static defaultProps = { - user: null - }; - - ownerName() { - if (this.props.params.username) { - return this.props.params.username; - } - - return this.props.user.username; - } - - pageTitle() { - if (this.isCreatePage()) { - return this.props.t('CollectionView.TitleCreate'); - } - - return this.props.t('CollectionView.TitleDefault'); - } - - isOwner() { - return this.props.user.username === this.props.params.username; - } +const CollectionView = () => { + const params = useParams(); - isCreatePage() { - const path = this.props.location.pathname; - return /create$/.test(path); - } - - renderContent() { - if (this.isCreatePage() && this.isOwner()) { - return ; - } - - return ( + return ( + +