ReplyingTo.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <info-tooltip class='replying_to'>
  3. <template slot='content'>
  4. <div style='margin-top: -0.25rem;'>
  5. <div class='replying_to__username' v-if='post'>{{post.User.username}}</div>
  6. <div class='replying_to__date' v-if='post'>{{post.createdAt | formatDate('date|time', ' - ')}}</div>
  7. </div>
  8. <div class='replying_to__content' v-if='post' v-html='post.content'></div>
  9. <template v-else>Loading...</template>
  10. </template>
  11. <div
  12. slot='display'
  13. class='replying_to__display'
  14. @click='$emit("click")'
  15. >
  16. <span class='fa fa-reply replying_to__icon'></span>
  17. {{username}}
  18. </div>
  19. </info-tooltip>
  20. </template>
  21. <script>
  22. import InfoTooltip from './InfoTooltip'
  23. export default {
  24. name: 'ReplyingTo',
  25. props: ['replyId', 'username'],
  26. data () {
  27. return {
  28. post: null
  29. }
  30. },
  31. components: { InfoTooltip }
  32. }
  33. </script>
  34. <style lang='scss'>
  35. @import '../assets/scss/variables.scss';
  36. .replying_to {
  37. @at-root #{&}__icon {
  38. font-size: 0.7rem;
  39. margin-right: 0.25rem;
  40. color: rgba(0, 0, 0, 0.87);
  41. }
  42. @at-root #{&}__date {
  43. display: inline-block;
  44. color: $color__gray--darkest;
  45. font-size: 0.8rem;
  46. }
  47. @at-root #{&}__username {
  48. display: inline-block;
  49. font-size: 0.9rem;
  50. color: #000;
  51. }
  52. @at-root #{&}__content {
  53. *:first-child, *:last-child {
  54. margin: 0;
  55. }
  56. p {
  57. margin: 0.25rem 0;
  58. }
  59. }
  60. @at-root #{&}__display {
  61. display: inline-flex;
  62. cursor: pointer;
  63. align-items: baseline;
  64. }
  65. }
  66. </style>