diff --git a/src/components/Post.js b/src/components/Post.js index f60880e..d7c6692 100644 --- a/src/components/Post.js +++ b/src/components/Post.js @@ -8,6 +8,7 @@ import { faAngleDown } from '@fortawesome/free-solid-svg-icons'; import {postApi} from "../api/posts.api"; +import keycloak from "../Authentification/Keycloak"; const Post = ({ post, recursionDepth, selectPost, reload }) => { @@ -43,12 +44,9 @@ const Post = ({ post, recursionDepth, selectPost, reload }) => {
{if (!(click.target instanceof HTMLButtonElement)) setShowComments(!showComments)}}>
- {post.id === post.parent &&
-

{post.title} von {post.anonymousID}

-
} - {post.id !== post.parent &&
-

Kommentar von {post.anonymousID}

-
} +
+

{post.id === post.parent ? post.title : "Kommentar"} von {post.anonymousID === 0 ? keycloak.idTokenParsed.preferred_username : "Anonymous " + post.anonymousID}

+

{post.content}