diff --git a/src/pages/Post.tsx b/src/pages/Post.tsx index 58ec6e4..5d138ca 100644 --- a/src/pages/Post.tsx +++ b/src/pages/Post.tsx @@ -21,10 +21,12 @@ interface IProps extends WithFirestoreProps { /** * Display a Post and the related comments. Shows a form to add a comment. */ -const PostPage: FC = ({post, firestore}) => { +const PostPage: FC = ({post, firestore, firebase}) => { + const name = firebase.auth().currentUser?.displayName; + const avatarUrl = firebase.auth().currentUser?.photoURL; const newComment: Comment = { - name: post.name ?? 'error', - avatarUrl: post.avatarUrl ?? 'error', + name: name ?? 'error', + avatarUrl: avatarUrl ?? 'error', text: '', };