2022-08-04 10:38:52 -06:00
|
|
|
<template>
|
|
|
|
|
<div class="component">
|
2022-08-04 11:12:27 -06:00
|
|
|
<div class="modal fade" id="vaultKeepModal" tabindex="-1" aria-labelledby="vaultKeepModalLabel" aria-hidden="true">
|
2022-08-04 10:38:52 -06:00
|
|
|
<div class="modal-dialog modal-xl modal-dialog-centered">
|
2022-08-04 11:12:27 -06:00
|
|
|
<div class="modal-content border-0">
|
|
|
|
|
<div class="card border-0">
|
2022-08-04 10:38:52 -06:00
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-6">
|
|
|
|
|
<img :src="keep?.img" :alt="keep?.name" class="img-fluid">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-6">
|
2022-08-04 11:12:27 -06:00
|
|
|
<div class="card-body h-100">
|
|
|
|
|
<div class="d-flex flex-column justify-content-between h-100">
|
2022-08-04 10:38:52 -06:00
|
|
|
<div>
|
|
|
|
|
<div class="d-flex justify-content-end">
|
|
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
|
|
|
</div>
|
2022-08-04 11:12:27 -06:00
|
|
|
<KeepStatsBar :keep="keep" />
|
|
|
|
|
<h5 class=" py-4 card-title text-center">{{ keep?.name }}</h5>
|
|
|
|
|
<div class="">
|
|
|
|
|
<p class="card-text">{{ keep?.description }}</p>
|
2022-08-04 10:38:52 -06:00
|
|
|
</div>
|
2022-08-04 11:12:27 -06:00
|
|
|
<hr>
|
|
|
|
|
<!-- tags go here -->
|
2022-08-04 10:38:52 -06:00
|
|
|
</div>
|
2022-08-04 11:12:27 -06:00
|
|
|
<div class="d-flex justify-content-between align-items-end">
|
|
|
|
|
|
|
|
|
|
<button class="btn btn-outline-primary">add to vault</button>
|
2022-08-04 10:38:52 -06:00
|
|
|
<!-- account is empty... -->
|
|
|
|
|
<button v-show="account?.id == keep?.creator?.id" class="btn btn-primary">trashcan</button>
|
2022-08-04 11:12:27 -06:00
|
|
|
<div @click="viewProfile(keep?.creator)" class="d-flex align-items-end">
|
|
|
|
|
<img :src="keep?.creator?.picture" :alt="keep?.creator?.name"
|
|
|
|
|
class="profile-pic rounded-3 me-2">
|
|
|
|
|
<p class="mb-0 profile-text">{{ keep?.creator?.name }}</p>
|
|
|
|
|
</div>
|
2022-08-04 10:38:52 -06:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { AppState } from '../AppState'
|
|
|
|
|
import { computed } from 'vue'
|
|
|
|
|
import { Modal } from 'bootstrap'
|
|
|
|
|
import { logger } from '../utils/Logger.js'
|
|
|
|
|
import { useRouter } from 'vue-router'
|
2022-08-04 11:12:27 -06:00
|
|
|
import KeepStatsBar from './KeepStatsBar.vue'
|
2022-08-04 10:38:52 -06:00
|
|
|
export default {
|
|
|
|
|
props: {
|
|
|
|
|
keep: {
|
|
|
|
|
id: Number,
|
|
|
|
|
creatorId: String,
|
|
|
|
|
name: String,
|
|
|
|
|
description: String,
|
|
|
|
|
img: String,
|
|
|
|
|
views: Number,
|
|
|
|
|
kept: Number,
|
|
|
|
|
creator: {
|
|
|
|
|
id: String,
|
|
|
|
|
name: String,
|
|
|
|
|
picture: String
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
setup(props) {
|
|
|
|
|
// console.log(AppState.account)
|
2022-08-04 11:12:27 -06:00
|
|
|
const router = useRouter();
|
2022-08-04 10:38:52 -06:00
|
|
|
return {
|
2022-08-04 11:12:27 -06:00
|
|
|
account: computed(() => { AppState.account; }),
|
2022-08-04 10:38:52 -06:00
|
|
|
viewProfile() {
|
|
|
|
|
// console.log(user.name)
|
|
|
|
|
// AppState.activeProfile = props.keep.creator
|
2022-08-04 11:12:27 -06:00
|
|
|
Modal.getOrCreateInstance(document.getElementById("vaultKeepModal")).hide();
|
2022-08-04 10:38:52 -06:00
|
|
|
// logger.log(props.keep.creator.id)
|
2022-08-04 11:12:27 -06:00
|
|
|
router.push({ name: "Profile", params: { id: props.keep.creator.id } });
|
2022-08-04 10:38:52 -06:00
|
|
|
}
|
2022-08-04 11:12:27 -06:00
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
components: { KeepStatsBar }
|
2022-08-04 10:38:52 -06:00
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
|
|
|
|
.img-fluid {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
2022-08-04 11:12:27 -06:00
|
|
|
|
|
|
|
|
.card-title {
|
|
|
|
|
font-size: 32px;
|
|
|
|
|
font-weight: 300;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.profile-pic {
|
|
|
|
|
height: 36px;
|
|
|
|
|
width: 36px;
|
|
|
|
|
object-fit: contain;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.profile-text {
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
font-weight: 300;
|
|
|
|
|
}
|
2022-08-04 10:38:52 -06:00
|
|
|
</style>
|