This commit is contained in:
mgabdev
2020-02-24 16:56:07 -05:00
parent d255982ec5
commit 7679012e2f
84 changed files with 1048 additions and 1132 deletions

View File

@@ -5,7 +5,7 @@ import { fetchGroup } from '../actions/groups';
import HeaderContainer from '../features/groups/timeline/containers/header_container';
import GroupPanel from '../features/groups/timeline/components/panel';
// import GroupSidebarPanel from '../features/groups/sidebar_panel';
import DefaultLayout from '../components/layouts/default_layout';
import DefaultLayout from '../layouts/default_layout';
import { WhoToFollowPanel } from '../components/panel';
import LinkFooter from '../components/link_footer';

View File

@@ -1,7 +1,7 @@
import { Fragment } from 'react'
import LinkFooter from '../components/link_footer'
import GroupsPanel from '../components/panel/groups_panel'
import DefaultLayout from '../components/layouts/default_layout'
import DefaultLayout from '../layouts/default_layout'
export default class GroupsPage extends PureComponent {

View File

@@ -6,7 +6,7 @@ import ProgressPanel from '../components/panel/progress_panel'
import UserPanel from '../components/panel/user_panel'
import TrendsPanel from '../components/panel/trends_panel'
import HashtagsPanel from '../components/panel/hashtags_panel'
import DefaultLayout from '../components/layouts/default_layout'
import DefaultLayout from '../layouts/default_layout'
import TimelineComposeBlock from '../components/timeline_compose_block'
import Divider from '../components/divider'

View File

@@ -2,7 +2,7 @@ import { Fragment } from 'react'
import ImmutablePropTypes from 'react-immutable-proptypes'
import ImmutablePureComponent from 'react-immutable-pure-component'
import LinkFooter from '../components/link_footer'
import DefaultLayout from '../components/layouts/default_layout'
import DefaultLayout from '../layouts/default_layout'
import ListDetailsPanel from '../components/panel/list_details_panel'
const mapStateToProps = (state, props) => ({

View File

@@ -2,7 +2,7 @@ import { Fragment } from 'react'
import LinkFooter from '../components/link_footer'
import WhoToFollowPanel from '../components/panel/who_to_follow_panel'
import TrendsPanel from '../components/panel/trends_panel'
import DefaultLayout from '../components/layouts/default_layout'
import DefaultLayout from '../layouts/default_layout'
export default class ListsPage extends PureComponent {

View File

@@ -2,7 +2,7 @@ import { Fragment } from 'react'
import LinkFooter from '../components/link_footer'
import WhoToFollowPanel from '../components/panel/who_to_follow_panel'
import TrendsPanel from '../components/panel/trends_panel'
import DefaultLayout from '../components/layouts/default_layout'
import DefaultLayout from '../layouts/default_layout'
export default class NotificationsPage extends PureComponent {
render() {

View File

@@ -1,26 +1,25 @@
import { Fragment } from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
// import HeaderContainer from '../features/account_timeline/containers/header_container';
// import ProfileInfoPanel from '../features/account_timeline/components/profile_info_panel/profile_info_panel';
// import { WhoToFollowPanel, SignUpPanel } from '../components/panel';
// import LinkFooter from '../components/link_footer';
import ProfileLayout from '../components/layouts/profile_layout';
import { Fragment } from 'react'
import ImmutablePropTypes from 'react-immutable-proptypes'
import ImmutablePureComponent from 'react-immutable-pure-component'
import LinkFooter from '../components/link_footer'
import ProfileInfoPanel from '../components/panel/profile_info_panel'
import MediaGalleryPanel from '../components/panel/media_gallery_panel'
import ProfileLayout from '../layouts/profile_layout'
const mapStateToProps = (state, { params: { username }, withReplies = false }) => {
const accounts = state.getIn(['accounts']);
const accountFetchError = (state.getIn(['accounts', -1, 'username'], '').toLowerCase() == username.toLowerCase());
const accounts = state.getIn(['accounts'])
const accountFetchError = (state.getIn(['accounts', -1, 'username'], '').toLowerCase() == username.toLowerCase())
let accountId = -1;
let account = null;
let accountUsername = username;
let accountId = -1
let account = null
let accountUsername = username
if (accountFetchError) {
accountId = null;
accountId = null
}
else {
account = accounts.find(acct => username.toLowerCase() == acct.getIn(['acct'], '').toLowerCase());
accountId = account ? account.getIn(['id'], null) : -1;
accountUsername = account ? account.getIn(['acct'], '') : '';
account = accounts.find(acct => username.toLowerCase() == acct.getIn(['acct'], '').toLowerCase())
accountId = account ? account.getIn(['id'], null) : -1
accountUsername = account ? account.getIn(['acct'], '') : ''
}
//Children components fetch information
@@ -29,10 +28,11 @@ const mapStateToProps = (state, { params: { username }, withReplies = false }) =
account,
accountId,
accountUsername,
};
};
}
}
export default @connect(mapStateToProps)
export default
@connect(mapStateToProps)
class ProfilePage extends ImmutablePureComponent {
static propTypes = {
account: ImmutablePropTypes.map,
@@ -42,14 +42,23 @@ class ProfilePage extends ImmutablePureComponent {
PropTypes.number,
]).isRequired,
children: PropTypes.node,
};
}
render() {
const { accountId, account, accountUsername } = this.props;
const { accountId, account, accountUsername } = this.props
return (
<ProfileLayout>
{ /*this.props.children */ }
<ProfileLayout
account={account}
layout={(
<Fragment>
<ProfileInfoPanel />
<MediaGalleryPanel />
<LinkFooter />
</Fragment>
)}
>
{ /* this.props.children */ }
</ProfileLayout>
)
}

View File

@@ -2,7 +2,7 @@ import { Fragment } from 'react'
import LinkFooter from '../components/link_footer'
import WhoToFollowPanel from '../components/panel/who_to_follow_panel'
import TrendsPanel from '../components/panel/trends_panel'
import SearchLayout from '../components/layouts/search_layout'
import SearchLayout from '../layouts/search_layout'
export default class SearchPage extends PureComponent {
render() {

View File

@@ -0,0 +1,12 @@
export default class SettingsPage extends PureComponent {
render() {
const { children } = this.props;
return (
<div>
{children}
</div>
)
}
}