pleroma-fe/src/components/favorite_button/favorite_button.vue

46 lines
1.1 KiB
Vue
Raw Normal View History

2016-10-30 16:12:35 +01:00
<template>
<div v-if="loggedIn">
<FAIcon
2019-07-05 09:17:44 +02:00
:class="classes"
class="FavoriteButton fa-scale-110 fa-old-padding -interactive"
2019-07-05 09:17:44 +02:00
:title="$t('tool_tip.favorite')"
:icon="[status.favorited ? 'fas' : 'far', 'star']"
:spin="animated"
2019-07-05 09:17:44 +02:00
@click.prevent="favorite()"
/>
<span v-if="!mergedConfig.hidePostStats && status.fave_num > 0">{{ status.fave_num }}</span>
</div>
<div v-else>
<FAIcon
2019-07-05 09:17:44 +02:00
:class="classes"
class="FavoriteButton fa-scale-110 fa-old-padding"
2019-07-05 09:17:44 +02:00
:title="$t('tool_tip.favorite')"
:icon="['far', 'star']"
2019-07-05 09:17:44 +02:00
/>
<span v-if="!mergedConfig.hidePostStats && status.fave_num > 0">{{ status.fave_num }}</span>
2016-10-30 16:12:35 +01:00
</div>
</template>
<script src="./favorite_button.js" ></script>
<style lang="scss">
@import '../../_variables.scss';
.FavoriteButton {
&.-interactive {
cursor: pointer;
animation-duration: 0.6s;
&:hover {
color: $fallback--cOrange;
color: var(--cOrange, $fallback--cOrange);
}
}
&.-favorited {
color: $fallback--cOrange;
color: var(--cOrange, $fallback--cOrange);
2018-04-07 18:30:27 +02:00
}
}
2016-10-30 16:12:35 +01:00
</style>