Make avatar in compose box navigate to profile page

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2021-08-30 22:09:21 +02:00
parent e652de227c
commit 8f6bd69f11
3 changed files with 11 additions and 4 deletions

View file

@ -1,5 +1,6 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { NavLink } from 'react-router-dom';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import StatusListContainer from '../../ui/containers/status_list_container'; import StatusListContainer from '../../ui/containers/status_list_container';
@ -80,13 +81,15 @@ class GroupTimeline extends React.PureComponent {
); );
} }
const acct = account.get('acct');
return ( return (
<div> <div>
{relationships.get('member') && ( {relationships.get('member') && (
<div className='timeline-compose-block'> <div className='timeline-compose-block'>
<div className='timeline-compose-block__avatar'> <NavLink className='timeline-compose-block__avatar' to={`/@${acct}`}>
<Avatar account={account} size={46} /> <Avatar account={account} size={46} />
</div> </NavLink>
<ComposeFormContainer group={group} shouldCondense autoFocus={false} /> <ComposeFormContainer group={group} shouldCondense autoFocus={false} />
</div> </div>
)} )}

View file

@ -1,5 +1,6 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { NavLink } from 'react-router-dom';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
import ComposeFormContainer from '../features/compose/containers/compose_form_container'; import ComposeFormContainer from '../features/compose/containers/compose_form_container';
import Avatar from '../components/avatar'; import Avatar from '../components/avatar';
@ -46,6 +47,8 @@ class HomePage extends ImmutablePureComponent {
render() { render() {
const { me, children, account, showFundingPanel, showCryptoDonatePanel, cryptoLimit, showTrendsPanel, showWhoToFollowPanel } = this.props; const { me, children, account, showFundingPanel, showCryptoDonatePanel, cryptoLimit, showTrendsPanel, showWhoToFollowPanel } = this.props;
const acct = account.get('acct');
return ( return (
<div className='page'> <div className='page'>
<div className='page__columns'> <div className='page__columns'>
@ -62,9 +65,9 @@ class HomePage extends ImmutablePureComponent {
<div className='columns-area__panels__main'> <div className='columns-area__panels__main'>
<div className='columns-area columns-area--mobile'> <div className='columns-area columns-area--mobile'>
{me && <div className='timeline-compose-block' ref={this.composeBlock}> {me && <div className='timeline-compose-block' ref={this.composeBlock}>
<div className='timeline-compose-block__avatar'> <NavLink className='timeline-compose-block__avatar' to={`/@${acct}`}>
<Avatar account={account} size={46} /> <Avatar account={account} size={46} />
</div> </NavLink>
<ComposeFormContainer <ComposeFormContainer
shouldCondense shouldCondense
autoFocus={false} autoFocus={false}

View file

@ -179,6 +179,7 @@
} }
&__avatar { &__avatar {
display: block;
@media (max-width: 405px) { display: none; } @media (max-width: 405px) { display: none; }
} }
} }