Working signin and comment

This commit is contained in:
Belen Curcio
2018-08-15 12:05:38 -03:00
parent 4d7702c0e3
commit 8e9ac0748e
3 changed files with 13 additions and 2 deletions
+4 -1
View File
@@ -26,7 +26,10 @@ const Stream: StatelessComponent<StreamProps> = props => {
return (
<Flex className={styles.root} direction="column" itemGutter>
<UserBoxContainer user={props.user} />
<PostCommentFormContainer assetID={props.assetID} />
<PostCommentFormContainer
assetID={props.assetID}
signedIn={!!props.user}
/>
<Flex
direction="column"
id="talk-comments-stream-log"
@@ -11,6 +11,7 @@ import { CreateCommentMutation, withCreateCommentMutation } from "../mutations";
interface InnerProps {
createComment: CreateCommentMutation;
assetID: string;
signedIn: boolean;
}
class PostCommentFormContainer extends Component<InnerProps> {
@@ -31,7 +32,12 @@ class PostCommentFormContainer extends Component<InnerProps> {
return undefined;
};
public render() {
return <PostCommentForm onSubmit={this.onSubmit} signedIn={false} />;
return (
<PostCommentForm
onSubmit={this.onSubmit}
signedIn={this.props.signedIn}
/>
);
}
}
@@ -23,9 +23,11 @@ export const render = ({ error, props }: ReadyState<StreamQueryResponse>) => {
if (error) {
return <div>{error.message}</div>;
}
if (props) {
return <StreamContainer asset={props.asset} user={props.me} />;
}
return <div>Loading</div>;
};