import React, { useEffect } from 'react'; import PropTypes from 'prop-types'; import { NavLink, Redirect, Route, Switch, useRouteMatch } from 'react-router-dom'; import reduxConnect from '../../../../redux/utils/connect'; import ChangeCard from './ChangeCard'; import CurrentPlan from './CurrentPlan'; import UpdatePlan from './UpdatePlan'; import UserTransactions from './UserTransactions'; import { Card, CardBody, Col, Row } from 'reactstrap'; import { translate } from 'react-i18next'; export const planRoutes = { current: 'current', changeCard: 'change-card', txn: 'transactions', update: 'update' }; function UserPlans({ actions, restrictions, t }) { const match = useRouteMatch(); useEffect(() => { const { setEnableClosedSidebar } = actions; actions.getRestrictions(); setEnableClosedSidebar(true); return () => setEnableClosedSidebar(false); }, []); return (
  • {t('plans.sidebar.activePlanDetails')}
  • {restrictions.isPaymentId && (
  • {t('plans.sidebar.changeCard')}
  • )}
  • {t('plans.sidebar.updatePlan')}
  • {t('plans.sidebar.yourTransactions')}
{restrictions.isPaymentId && ( )}
); } UserPlans.propTypes = { t: PropTypes.func.isRequired, actions: PropTypes.object.isRequired, restrictions: PropTypes.object.isRequired }; export default reduxConnect('restrictions', [ 'common', 'auth', 'user', 'restrictions' ])(translate(['tabsContent'], { wait: true })(UserPlans));