2022-08-02 15:00:04 -06:00
|
|
|
<template>
|
2022-08-03 10:20:05 -06:00
|
|
|
<div @click="viewKeep()" class="component">
|
2022-08-04 10:38:52 -06:00
|
|
|
<div class="card bg-dark text-white border-0 rounded-3">
|
2022-08-03 10:20:05 -06:00
|
|
|
<!-- TODO check if keep.img is a valid image -->
|
2022-08-04 10:38:52 -06:00
|
|
|
<img :src="keep.img" class="card-img rounded-3" :alt="keep.name">
|
2022-08-03 10:20:05 -06:00
|
|
|
<div class="card-img-overlay d-flex justify-content-between align-items-end">
|
|
|
|
|
<h5 class="card-title">{{ keep.name }}</h5>
|
2022-08-03 16:31:59 -06:00
|
|
|
<img :src="keep.creator.picture" :alt="keep.creator.name" class="rounded-pill img-fluid profile-pic">
|
2022-08-02 15:00:04 -06:00
|
|
|
</div>
|
2022-08-03 10:20:05 -06:00
|
|
|
</div>
|
2022-08-02 15:00:04 -06:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { computed, onMounted, ref } from 'vue'
|
2022-08-03 10:20:05 -06:00
|
|
|
import { router } from '../router.js'
|
2022-08-02 15:00:04 -06:00
|
|
|
import { AppState } from '../AppState.js'
|
|
|
|
|
import { logger } from '../utils/Logger.js'
|
2022-08-03 10:20:05 -06:00
|
|
|
|
2022-08-02 15:00:04 -06:00
|
|
|
export default {
|
|
|
|
|
props: {
|
|
|
|
|
keep: {
|
2022-08-03 10:20:05 -06:00
|
|
|
id: Number,
|
|
|
|
|
creatorId: String,
|
|
|
|
|
name: String,
|
|
|
|
|
description: String,
|
|
|
|
|
img: String,
|
|
|
|
|
views: Number,
|
|
|
|
|
kept: Number,
|
|
|
|
|
creator: {
|
|
|
|
|
id: String,
|
|
|
|
|
name: String,
|
|
|
|
|
picture: String
|
|
|
|
|
}
|
2022-08-02 15:00:04 -06:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
setup(props) {
|
2022-08-03 10:20:05 -06:00
|
|
|
return {
|
|
|
|
|
viewKeep() {
|
|
|
|
|
AppState.activeKeep = props.keep;
|
|
|
|
|
// console.log(props.keep.id)
|
|
|
|
|
// router.push({name: 'Keep'})
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-08-02 15:00:04 -06:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.card-img {
|
|
|
|
|
min-height: 160px;
|
2022-08-03 10:20:05 -06:00
|
|
|
max-height: 80vh;
|
2022-08-03 16:31:59 -06:00
|
|
|
object-fit: cover;
|
2022-08-02 15:00:04 -06:00
|
|
|
}
|
|
|
|
|
|
2022-08-03 16:31:59 -06:00
|
|
|
.profile-pic {
|
|
|
|
|
height: 36px;
|
2022-08-02 15:00:04 -06:00
|
|
|
}
|
2022-08-04 12:33:15 -06:00
|
|
|
|
|
|
|
|
.card-title {
|
|
|
|
|
color: #fffffff0;
|
|
|
|
|
text-shadow: 1px 1px 3px #000000e0;
|
|
|
|
|
}
|
2022-08-02 15:00:04 -06:00
|
|
|
</style>
|