Skip to content

Commit

Permalink
Merge pull request #89 from traP-jp/issue/post-link
Browse files Browse the repository at this point in the history
#82 修復
  • Loading branch information
ZOI-dayo authored Jun 16, 2024
2 parents b98bb28 + 5f4dfbb commit 4be9afa
Showing 1 changed file with 31 additions and 29 deletions.
60 changes: 31 additions & 29 deletions frontend/src/components/Post.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,38 +58,40 @@ const vTwemoji = {
</script>

<template>
<div class="post">
<div class="post-author-icon">
<Avatar size="48px" :name="name" />
</div>
<div class="post-content">
<div class="post-header">
<span class="post-author">@{{ name }}</span>
<span class="post-date">{{ dateText }}</span>
</div>
<div class="post-message">
{{ content }}
<router-link :to="`/posts/${id}/`" class="post-link">
<div class="post">
<div class="post-author-icon">
<Avatar size="48px" :name="name" />
</div>
<div class="post-reactions">
<button
v-for="reaction in copiedReactions"
:key="reaction.id"
class="post-reaction"
:class="{ clicked: reaction.clicked, ripple: newReaction === reaction.id }"
@click="
(e) => {
toggleReaction(reaction);
e.stopPropagation();
e.preventDefault();
}
"
>
<span class="post-reaction-icon" v-twemoji>{{ reactionIcons[reaction.id] }}</span>
<span class="post-reaction-count">{{ reaction.count }}</span>
</button>
<div class="post-content">
<div class="post-header">
<span class="post-author">@{{ name }}</span>
<span class="post-date">{{ dateText }}</span>
</div>
<div class="post-message">
{{ content }}
</div>
<div class="post-reactions">
<button
v-for="reaction in copiedReactions"
:key="reaction.id"
class="post-reaction"
:class="{ clicked: reaction.clicked, ripple: newReaction === reaction.id }"
@click="
(e) => {
toggleReaction(reaction);
e.stopPropagation();
e.preventDefault();
}
"
>
<span class="post-reaction-icon" v-twemoji>{{ reactionIcons[reaction.id] }}</span>
<span class="post-reaction-count">{{ reaction.count }}</span>
</button>
</div>
</div>
</div>
</div>
</router-link>
</template>

<style lang="scss" scoped>
Expand Down

0 comments on commit 4be9afa

Please sign in to comment.