mirror of
https://github.com/wassname/talk.git
synced 2026-07-25 13:30:59 +08:00
Adding go to conversation
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
export {setActiveTab} from 'coral-embed-stream/src/actions/stream';
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
export {default as withReaction} from './withReaction';
|
export {default as withReaction} from './withReaction';
|
||||||
export {default as withTags} from './withTags';
|
export {default as withTags} from './withTags';
|
||||||
|
export {default as withFragments} from 'coral-framework/hocs/withFragments';
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {name} from '../../package.json';
|
|||||||
import {timeago} from 'coral-framework/services/i18n';
|
import {timeago} from 'coral-framework/services/i18n';
|
||||||
import {Icon} from 'plugin-api/beta/client/components/ui';
|
import {Icon} from 'plugin-api/beta/client/components/ui';
|
||||||
|
|
||||||
const FeaturedComment = ({comment}) => {
|
const FeaturedComment = ({comment, setActiveTab}) => {
|
||||||
return (
|
return (
|
||||||
<div className={cn(styles.featuredComment, `${name}__featured-comment`)}>
|
<div className={cn(styles.featuredComment, `${name}__featured-comment`)}>
|
||||||
<blockquote className={cn(styles.quote, `${name}__featured-comment__comment-body`)}>
|
<blockquote className={cn(styles.quote, `${name}__featured-comment__comment-body`)}>
|
||||||
@@ -20,7 +20,10 @@ const FeaturedComment = ({comment}) => {
|
|||||||
,{' '}{timeago(comment.created_at)}
|
,{' '}{timeago(comment.created_at)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<a className={cn(styles.goTo, `${name}__featured-comment__go-to`)}>
|
<a
|
||||||
|
className={cn(styles.goTo, `${name}__featured-comment__go-to`)}
|
||||||
|
onClick={() => setActiveTab('all')}
|
||||||
|
>
|
||||||
Go to conversation<Icon name="keyboard_arrow_right" className={styles.goToIcon} />
|
Go to conversation<Icon name="keyboard_arrow_right" className={styles.goToIcon} />
|
||||||
</a>
|
</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import FeaturedComment from './FeaturedComment';
|
import FeaturedComment from './FeaturedComment';
|
||||||
|
|
||||||
export default ({asset: {featuredComments}}) => (
|
export default ({asset: {featuredComments}, setActiveTab}) => (
|
||||||
<div>
|
<div>
|
||||||
{featuredComments.nodes.map((comment) => <FeaturedComment key={comment.id} comment={comment} />)}
|
{featuredComments.nodes.map((comment) =>
|
||||||
|
<FeaturedComment
|
||||||
|
key={comment.id}
|
||||||
|
comment={comment}
|
||||||
|
setActiveTab={setActiveTab} />
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,8 +1,17 @@
|
|||||||
|
import {connect} from 'react-redux';
|
||||||
|
import {bindActionCreators} from 'redux';
|
||||||
import {compose, gql} from 'react-apollo';
|
import {compose, gql} from 'react-apollo';
|
||||||
import withFragments from 'coral-framework/hocs/withFragments';
|
|
||||||
import TabPane from '../components/TabPane';
|
import TabPane from '../components/TabPane';
|
||||||
|
import {withFragments} from 'plugin-api/beta/client/hocs';
|
||||||
|
import {setActiveTab} from 'plugin-api/beta/client/actions/stream';
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch) =>
|
||||||
|
bindActionCreators({
|
||||||
|
setActiveTab,
|
||||||
|
}, dispatch);
|
||||||
|
|
||||||
const enhance = compose(
|
const enhance = compose(
|
||||||
|
connect(null, mapDispatchToProps),
|
||||||
withFragments({
|
withFragments({
|
||||||
asset: gql`
|
asset: gql`
|
||||||
fragment TalkFeatured_TabPane_asset on Asset {
|
fragment TalkFeatured_TabPane_asset on Asset {
|
||||||
|
|||||||
Reference in New Issue
Block a user