follow_card.vue 1.38 KB
Newer Older
Tae Hoon's avatar
Tae Hoon committed
1
2
<template>
  <basic-user-card :user="user">
3
4
    <div class="follow-card-content-container">
      <span class="faint">
Tae Hoon's avatar
Tae Hoon committed
5
6
        {{ isMe ? $t('user_card.its_you') : $t('user_card.follows_you') }}
      </span>
Tae Hoon's avatar
Tae Hoon committed
7
8
9
10
      <button
        v-if="showFollow"
        class="btn btn-default"
        @click="followUser"
Tae Hoon's avatar
Tae Hoon committed
11
        :disabled="inProgress"
Tae Hoon's avatar
Tae Hoon committed
12
13
        :title="requestSent ? $t('user_card.follow_again') : ''"
      >
Tae Hoon's avatar
Tae Hoon committed
14
        <template v-if="inProgress">
Tae Hoon's avatar
Tae Hoon committed
15
16
17
18
19
20
21
22
23
          {{ $t('user_card.follow_progress') }}
        </template>
        <template v-else-if="requestSent">
          {{ $t('user_card.follow_sent') }}
        </template>
        <template v-else>
          {{ $t('user_card.follow') }}
        </template>
      </button>
Tae Hoon's avatar
Tae Hoon committed
24
25
      <button v-if="following" class="btn btn-default pressed" @click="unfollowUser" :disabled="inProgress">
        <template v-if="inProgress">
Tae Hoon's avatar
Tae Hoon committed
26
27
28
29
30
31
          {{ $t('user_card.follow_progress') }}
        </template>
        <template v-else>
          {{ $t('user_card.follow_unfollow') }}
        </template>
      </button>
32
    </div>
Tae Hoon's avatar
Tae Hoon committed
33
34
35
36
  </basic-user-card>
</template>

<script src="./follow_card.js"></script>
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

<style lang="scss">
.follow-card-content-container {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  flex-wrap: wrap;
  line-height: 1.5em;

  .btn {
    margin-top: 0.5em;
    margin-left: auto;
    width: 10em;
  }
}
</style>