diff --git a/app/javascript/gabsocial/pages/explore_page.js b/app/javascript/gabsocial/pages/explore_page.js index 4f582984..15dece3d 100644 --- a/app/javascript/gabsocial/pages/explore_page.js +++ b/app/javascript/gabsocial/pages/explore_page.js @@ -1,10 +1,5 @@ import PageTitle from '../features/ui/util/page_title' -import DefaultLayout from '../layouts/default_layout' -import ProgressPanel from '../components/panel/progress_panel' -import VerifiedAccountsPanel from '../components/panel/verified_accounts_panel' -import ShopPanel from '../components/panel/shop_panel' -import SignupPanel from '../components/panel/sign_up_panel' -import LinkFooter from '../components/link_footer' +import ExploreLayout from '../layouts/explore_layout' export default class ExplorePage extends PureComponent { @@ -17,22 +12,13 @@ export default class ExplorePage extends PureComponent { const { children, title } = this.props return ( - , - , - , - , - , - ]} > {children} - + ) } diff --git a/app/javascript/gabsocial/pages/group_page.js b/app/javascript/gabsocial/pages/group_page.js index 08403f32..676f3850 100644 --- a/app/javascript/gabsocial/pages/group_page.js +++ b/app/javascript/gabsocial/pages/group_page.js @@ -7,6 +7,7 @@ import PageTitle from '../features/ui/util/page_title' import GroupLayout from '../layouts/group_layout' import TimelineComposeBlock from '../components/timeline_compose_block' import Divider from '../components/divider' +import GroupSortBlock from '../components/group_sort_block' const messages = defineMessages({ group: { id: 'group', defaultMessage: 'Group' }, @@ -20,7 +21,7 @@ const mapStateToProps = (state, { params: { id } }) => ({ const mapDispatchToProps = (dispatch) => ({ onFetchGroup(groupId) { dispatch(fetchGroup(groupId)) - } + }, }) export default @@ -34,10 +35,13 @@ class GroupPage extends ImmutablePureComponent { children: PropTypes.node.isRequired, relationships: ImmutablePropTypes.map, onFetchGroup: PropTypes.func.isRequired, + sortByValue: PropTypes.string.isRequired, + sortByTopValue: PropTypes.string.isRequired, } componentDidMount() { this.props.onFetchGroup(this.props.params.id) + // this.props.onFetchGroup(this.props.params.slug) } render() { @@ -46,29 +50,35 @@ class GroupPage extends ImmutablePureComponent { children, group, relationships, + isTimeline, } = this.props const groupTitle = !!group ? group.get('title') : '' const groupId = !!group ? group.get('id') : undefined - + return ( { - !!relationships && relationships.get('member') && + !!relationships && isTimeline && relationships.get('member') && } + { + isTimeline && + } + {children} ) diff --git a/app/javascript/gabsocial/pages/groups_page.js b/app/javascript/gabsocial/pages/groups_page.js index 7e63b193..b3a86c38 100644 --- a/app/javascript/gabsocial/pages/groups_page.js +++ b/app/javascript/gabsocial/pages/groups_page.js @@ -1,20 +1,15 @@ import { me } from '../initial_state' import { defineMessages, injectIntl } from 'react-intl' -import { openModal } from '../actions/modal' -import { - MODAL_GROUP_CREATE, - MODAL_PRO_UPGRADE, -} from '../constants' import PageTitle from '../features/ui/util/page_title' import LinkFooter from '../components/link_footer' import GroupsPanel from '../components/panel/groups_panel' -import WhoToFollowPanel from '../components/panel/who_to_follow_panel' import DefaultLayout from '../layouts/default_layout' const messages = defineMessages({ groups: { id: 'groups', defaultMessage: 'Groups' }, - featured: { id: 'featured', defaultMessage: 'Featured' }, - new: { id: 'new', defaultMessage: 'Just Added' }, + new: { id: 'new', defaultMessage: 'Recently Added Groups' }, + featured: { id: 'featured', defaultMessage: 'Featured Groups' }, + myGroupsTimeline: { id: 'my_groups_timeline', defaultMessage: 'Timeline' }, myGroups: { id: 'my_groups', defaultMessage: 'My Groups' }, admin: { id: 'admin', defaultMessage: 'Admin' }, }) @@ -23,30 +18,15 @@ const mapStateToProps = (state) => ({ isPro: state.getIn(['accounts', me, 'is_pro']), }) -const mapDispatchToProps = (dispatch) => ({ - onOpenGroupCreateModal(isPro) { - if (!isPro) { - dispatch(openModal(MODAL_PRO_UPGRADE)) - } else { - dispatch(openModal(MODAL_GROUP_CREATE)) - } - }, -}) - export default @injectIntl -@connect(mapStateToProps, mapDispatchToProps) +@connect(mapStateToProps) class GroupsPage extends PureComponent { static propTypes = { intl: PropTypes.object.isRequired, children: PropTypes.node.isRequired, isPro: PropTypes.bool, - onOpenGroupCreateModal: PropTypes.func.isRequired, - } - - handleOnOpenGroupCreateModal = () => { - this.props.onOpenGroupCreateModal(this.props.isPro) } render() { @@ -54,28 +34,32 @@ class GroupsPage extends PureComponent { intl, children, isPro, - onOpenGroupCreateModal, } = this.props - const actions = [ + const actions = isPro ? [ { icon: 'add', - onClick: this.handleOnOpenGroupCreateModal, + to: '/groups/create', }, - ] + ] : [] + const tabs = !!me ? [ { - title: intl.formatMessage(messages.featured), + title: intl.formatMessage(messages.myGroupsTimeline), to: '/groups', }, - { - title: intl.formatMessage(messages.new), - to: '/groups/new', - }, { title: intl.formatMessage(messages.myGroups), to: '/groups/browse/member', }, + { + title: intl.formatMessage(messages.featured), + to: '/groups/browse/featured', + }, + { + title: intl.formatMessage(messages.new), + to: '/groups/browse/new', + }, ] : [] if (isPro) { @@ -94,8 +78,7 @@ class GroupsPage extends PureComponent { tabs={tabs} page='groups' layout={[ - , - , + , , ]} > @@ -105,4 +88,4 @@ class GroupsPage extends PureComponent { ) } -} \ No newline at end of file +}