[Glitch] Make the column header of profile view look like the others, too

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
This commit is contained in:
Mélanie Chauvel (ariasuni) 2019-02-27 13:36:40 +01:00 committed by ThibG
parent 12a0dd71be
commit 282ac61500
5 changed files with 37 additions and 9 deletions

View file

@ -0,0 +1,29 @@
import React from 'react';
import PropTypes from 'prop-types';
import ColumnHeader from '../../../components/column_header';
import { FormattedMessage, injectIntl, defineMessages } from 'react-intl';
const messages = defineMessages({
profile: { id: 'column_header.profile', defaultMessage: 'Profile' },
});
export default @injectIntl
class ProfileColumnHeader extends React.PureComponent {
static propTypes = {
intl: PropTypes.object.isRequired,
};
render() {
const { intl } = this.props;
return (
<ColumnHeader
icon='user-circle'
title={intl.formatMessage(messages.profile)}
showBackButton
>
</ColumnHeader>
)
}
}

View file

@ -6,7 +6,7 @@ import { fetchAccount } from 'flavours/glitch/actions/accounts';
import { expandAccountMediaTimeline } from 'flavours/glitch/actions/timelines'; import { expandAccountMediaTimeline } from 'flavours/glitch/actions/timelines';
import LoadingIndicator from 'flavours/glitch/components/loading_indicator'; import LoadingIndicator from 'flavours/glitch/components/loading_indicator';
import Column from 'flavours/glitch/features/ui/components/column'; import Column from 'flavours/glitch/features/ui/components/column';
import ColumnBackButton from 'flavours/glitch/components/column_back_button'; import ProfileColumnHeader from 'flavours/glitch/features/account/components/profile_column_header';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
import { getAccountGallery } from 'flavours/glitch/selectors'; import { getAccountGallery } from 'flavours/glitch/selectors';
import MediaItem from './components/media_item'; import MediaItem from './components/media_item';
@ -113,7 +113,7 @@ export default class AccountGallery extends ImmutablePureComponent {
return ( return (
<Column> <Column>
<ColumnBackButton /> <ProfileColumnHeader />
<ScrollContainer scrollKey='account_gallery' shouldUpdateScroll={this.shouldUpdateScroll}> <ScrollContainer scrollKey='account_gallery' shouldUpdateScroll={this.shouldUpdateScroll}>
<div className='scrollable scrollable--flex' onScroll={this.handleScroll}> <div className='scrollable scrollable--flex' onScroll={this.handleScroll}>

View file

@ -7,8 +7,8 @@ import { expandAccountFeaturedTimeline, expandAccountTimeline } from 'flavours/g
import StatusList from '../../components/status_list'; import StatusList from '../../components/status_list';
import LoadingIndicator from '../../components/loading_indicator'; import LoadingIndicator from '../../components/loading_indicator';
import Column from '../ui/components/column'; import Column from '../ui/components/column';
import ProfileColumnHeader from 'flavours/glitch/features/account/components/profile_column_header';
import HeaderContainer from './containers/header_container'; import HeaderContainer from './containers/header_container';
import ColumnBackButton from '../../components/column_back_button';
import { List as ImmutableList } from 'immutable'; import { List as ImmutableList } from 'immutable';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
import { FormattedMessage } from 'react-intl'; import { FormattedMessage } from 'react-intl';
@ -74,7 +74,7 @@ export default class AccountTimeline extends ImmutablePureComponent {
return ( return (
<Column name='account'> <Column name='account'>
<ColumnBackButton /> <ProfileColumnHeader />
<StatusList <StatusList
prepend={<HeaderContainer accountId={this.props.params.accountId} />} prepend={<HeaderContainer accountId={this.props.params.accountId} />}

View file

@ -11,9 +11,9 @@ import {
import { ScrollContainer } from 'react-router-scroll-4'; import { ScrollContainer } from 'react-router-scroll-4';
import AccountContainer from 'flavours/glitch/containers/account_container'; import AccountContainer from 'flavours/glitch/containers/account_container';
import Column from 'flavours/glitch/features/ui/components/column'; import Column from 'flavours/glitch/features/ui/components/column';
import ProfileColumnHeader from 'flavours/glitch/features/account/components/profile_column_header';
import HeaderContainer from 'flavours/glitch/features/account_timeline/containers/header_container'; import HeaderContainer from 'flavours/glitch/features/account_timeline/containers/header_container';
import LoadMore from 'flavours/glitch/components/load_more'; import LoadMore from 'flavours/glitch/components/load_more';
import ColumnBackButton from 'flavours/glitch/components/column_back_button';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
const mapStateToProps = (state, props) => ({ const mapStateToProps = (state, props) => ({
@ -80,7 +80,7 @@ export default class Followers extends ImmutablePureComponent {
return ( return (
<Column> <Column>
<ColumnBackButton /> <ProfileColumnHeader />
<ScrollContainer scrollKey='followers' shouldUpdateScroll={this.shouldUpdateScroll}> <ScrollContainer scrollKey='followers' shouldUpdateScroll={this.shouldUpdateScroll}>
<div className='scrollable' onScroll={this.handleScroll}> <div className='scrollable' onScroll={this.handleScroll}>

View file

@ -11,9 +11,9 @@ import {
import { ScrollContainer } from 'react-router-scroll-4'; import { ScrollContainer } from 'react-router-scroll-4';
import AccountContainer from 'flavours/glitch/containers/account_container'; import AccountContainer from 'flavours/glitch/containers/account_container';
import Column from 'flavours/glitch/features/ui/components/column'; import Column from 'flavours/glitch/features/ui/components/column';
import ProfileColumnHeader from 'flavours/glitch/features/account/components/profile_column_header';
import HeaderContainer from 'flavours/glitch/features/account_timeline/containers/header_container'; import HeaderContainer from 'flavours/glitch/features/account_timeline/containers/header_container';
import LoadMore from 'flavours/glitch/components/load_more'; import LoadMore from 'flavours/glitch/components/load_more';
import ColumnBackButton from 'flavours/glitch/components/column_back_button';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
const mapStateToProps = (state, props) => ({ const mapStateToProps = (state, props) => ({
@ -80,7 +80,7 @@ export default class Following extends ImmutablePureComponent {
return ( return (
<Column> <Column>
<ColumnBackButton /> <ProfileColumnHeader />
<ScrollContainer scrollKey='following' shouldUpdateScroll={this.shouldUpdateScroll}> <ScrollContainer scrollKey='following' shouldUpdateScroll={this.shouldUpdateScroll}>
<div className='scrollable' onScroll={this.handleScroll}> <div className='scrollable' onScroll={this.handleScroll}>
@ -94,5 +94,4 @@ export default class Following extends ImmutablePureComponent {
</Column> </Column>
); );
} }
} }