Merge all slots of BasicUserCard into one

This commit is contained in:
taehoon 2019-02-27 11:58:29 -05:00
parent 6e41b4b546
commit 0e86681aba
4 changed files with 46 additions and 65 deletions

View File

@ -7,8 +7,6 @@
<user-card-content :user="user" :switcher="false"></user-card-content> <user-card-content :user="user" :switcher="false"></user-card-content>
</div> </div>
<div class="user-card-collapsed-content" v-else> <div class="user-card-collapsed-content" v-else>
<div class="user-card-primary-secondary-wrapper">
<div class="user-card-primary-area">
<div :title="user.name" class="user-card-user-name"> <div :title="user.name" class="user-card-user-name">
<span v-if="user.name_html" v-html="user.name_html"></span> <span v-if="user.name_html" v-html="user.name_html"></span>
<span v-else>{{ user.name }}</span> <span v-else>{{ user.name }}</span>
@ -18,15 +16,7 @@
@{{user.screen_name}} @{{user.screen_name}}
</router-link> </router-link>
</div> </div>
<slot name="primary-area"></slot> <slot></slot>
</div>
<div class="user-card-secondary-area">
<slot name="secondary-area"></slot>
</div>
</div>
<div class="user-card-tertiary-area">
<slot name="tertiary-area"></slot>
</div>
</div> </div>
</div> </div>
</template> </template>
@ -52,19 +42,6 @@
margin-left: 0.7em; margin-left: 0.7em;
text-align: left; text-align: left;
flex: 1; flex: 1;
min-width: 0;
}
&-primary-secondary-wrapper {
display: flex;
align-items: flex-start;
justify-content: space-between;
}
&-primary-area {
flex: 1;
margin-right: 1em;
min-width: 0;
} }
&-user-name { &-user-name {
@ -76,15 +53,6 @@
} }
} }
&-secondary-area {
flex: none;
.btn {
margin-top: .5em;
width: 10em;
}
}
&-expanded-content { &-expanded-content {
flex: 1; flex: 1;
margin-left: 0.7em; margin-left: 0.7em;
@ -106,15 +74,5 @@
margin-bottom: 0; margin-bottom: 0;
} }
} }
@media (min-width: 320px) and (max-width: 480px) {
&-primary-secondary-wrapper {
flex-direction: column;
}
&-primary-area {
margin-right: 0;
}
}
} }
</style> </style>

View File

@ -1,6 +1,6 @@
<template> <template>
<basic-user-card :user="user"> <basic-user-card :user="user">
<template slot="secondary-area"> <div class="block-card-content-container">
<button class="btn btn-default" @click="unblockUser" :disabled="progress" v-if="blocked"> <button class="btn btn-default" @click="unblockUser" :disabled="progress" v-if="blocked">
<template v-if="progress"> <template v-if="progress">
{{ $t('user_card.unblock_progress') }} {{ $t('user_card.unblock_progress') }}
@ -17,8 +17,18 @@
{{ $t('user_card.block') }} {{ $t('user_card.block') }}
</template> </template>
</button> </button>
</template> </div>
</basic-user-card> </basic-user-card>
</template> </template>
<script src="./block_card.js"></script> <script src="./block_card.js"></script>
<style lang="scss">
.block-card-content-container {
margin-top: 0.5em;
text-align: right;
button {
width: 10em;
}
}
</style>

View File

@ -1,11 +1,9 @@
<template> <template>
<basic-user-card :user="user"> <basic-user-card :user="user">
<template slot="primary-area"> <div class="follow-card-content-container">
<span class="faint" v-if="!noFollowsYou && user.follows_you"> <span class="faint">
{{ isMe ? $t('user_card.its_you') : $t('user_card.follows_you') }} {{ isMe ? $t('user_card.its_you') : $t('user_card.follows_you') }}
</span> </span>
</template>
<template slot="secondary-area">
<button <button
v-if="showFollow" v-if="showFollow"
class="btn btn-default" class="btn btn-default"
@ -31,8 +29,25 @@
{{ $t('user_card.follow_unfollow') }} {{ $t('user_card.follow_unfollow') }}
</template> </template>
</button> </button>
</template> </div>
</basic-user-card> </basic-user-card>
</template> </template>
<script src="./follow_card.js"></script> <script src="./follow_card.js"></script>
<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>

View File

@ -1,18 +1,16 @@
<template> <template>
<basic-user-card :user="user"> <basic-user-card :user="user">
<template slot="tertiary-area"> <div class="follow-request-card-content-container">
<div class="follow-request-card-btns-container">
<button class="btn btn-default" @click="approveUser">{{ $t('user_card.approve') }}</button> <button class="btn btn-default" @click="approveUser">{{ $t('user_card.approve') }}</button>
<button class="btn btn-default" @click="denyUser">{{ $t('user_card.deny') }}</button> <button class="btn btn-default" @click="denyUser">{{ $t('user_card.deny') }}</button>
</div> </div>
</template>
</basic-user-card> </basic-user-card>
</template> </template>
<script src="./follow_request_card.js"></script> <script src="./follow_request_card.js"></script>
<style lang="scss"> <style lang="scss">
.follow-request-card-btns-container { .follow-request-card-content-container {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
flex-wrap: wrap; flex-wrap: wrap;