follow_card.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <template>
  2. <basic-user-card :user="user">
  3. <div class="follow-card-content-container">
  4. <span
  5. v-if="isMe || (!noFollowsYou && relationship.followed_by)"
  6. class="faint"
  7. >
  8. {{ isMe ? $t('user_card.its_you') : $t('user_card.follows_you') }}
  9. </span>
  10. <template v-if="!loggedIn">
  11. <div
  12. v-if="!relationship.following"
  13. class="follow-card-follow-button"
  14. >
  15. <RemoteFollow :user="user" />
  16. </div>
  17. </template>
  18. <template v-else-if="!isMe">
  19. <FollowButton
  20. :relationship="relationship"
  21. :label-following="$t('user_card.follow_unfollow')"
  22. class="follow-card-follow-button"
  23. />
  24. </template>
  25. </div>
  26. </basic-user-card>
  27. </template>
  28. <script src="./follow_card.js"></script>
  29. <style lang="scss">
  30. .follow-card {
  31. &-content-container {
  32. flex-shrink: 0;
  33. display: flex;
  34. flex-direction: row;
  35. justify-content: space-between;
  36. flex-wrap: wrap;
  37. line-height: 1.5em;
  38. }
  39. &-follow-button {
  40. margin-top: 0.5em;
  41. margin-left: auto;
  42. width: 10em;
  43. }
  44. }
  45. </style>