|
|
@@ -1,109 +0,0 @@
|
|
1
|
|
-<template lang="pug">
|
|
2
|
|
-w-card.profile-card-list--card.xs12.pa12
|
|
3
|
|
- header.xs12.w-flex.column.center
|
|
4
|
|
- NamePlate(
|
|
5
|
|
- :is-list='isList'
|
|
6
|
|
- :is-paired='isPaired'
|
|
7
|
|
- :name='card.name'
|
|
8
|
|
- :pid='card.pid'
|
|
9
|
|
- :pronouns='card.pronouns'
|
|
10
|
|
- :role='card.role'
|
|
11
|
|
- )
|
|
12
|
|
-
|
|
13
|
|
- w-button.text-upper.xs12.pa6(v-if='isPaired && !isList')
|
|
14
|
|
- w-icon.mr1(xl) mdi mdi-chat
|
|
15
|
|
- | start chat
|
|
16
|
|
-
|
|
17
|
|
- template(v-if='!isList')
|
|
18
|
|
- SummaryBar(:is-tab='isPaired' :tab-content='card.summary')
|
|
19
|
|
- TagList(v-if='!isPaired || isList')
|
|
20
|
|
-
|
|
21
|
|
- article.xs12.w-flex.column.justify-space-between
|
|
22
|
|
- AspectBar(
|
|
23
|
|
- :key='aspect.name'
|
|
24
|
|
- :labels='aspect.labels'
|
|
25
|
|
- :percentage='aspect.percentage'
|
|
26
|
|
- v-for='aspect in aspects'
|
|
27
|
|
- v-if='!isPaired || isList'
|
|
28
|
|
- )
|
|
29
|
|
-
|
|
30
|
|
- footer(v-if='!isList && !isPaired')
|
|
31
|
|
- .pa12
|
|
32
|
|
- p {{ card.summary.about.tab }}
|
|
33
|
|
- PairingButton(@pair='onPair' @pass='onPass' v-if='!isPaired')
|
|
34
|
|
-</template>
|
|
35
|
|
-
|
|
36
|
|
-<script setup>
|
|
37
|
|
-import { ref } from 'vue'
|
|
38
|
|
-import { useRouter } from 'vue-router'
|
|
39
|
|
-import {
|
|
40
|
|
- updateQueueByProfileId,
|
|
41
|
|
- postMembershipByProfileId,
|
|
42
|
|
- currentProfile,
|
|
43
|
|
-} from '../services'
|
|
44
|
|
-
|
|
45
|
|
-import NamePlate from './NamePlate.vue'
|
|
46
|
|
-import AspectBar from './AspectBar.vue'
|
|
47
|
|
-import SummaryBar from './SummaryBar.vue'
|
|
48
|
|
-import TagList from './TagList.vue'
|
|
49
|
|
-import PairingButton from './PairingButton.vue'
|
|
50
|
|
-
|
|
51
|
|
-const router = useRouter()
|
|
52
|
|
-// const isPaired = ref(true)
|
|
53
|
|
-const isPaired = ref(false)
|
|
54
|
|
-
|
|
55
|
|
-const props = defineProps({
|
|
56
|
|
- card: {
|
|
57
|
|
- type: Object,
|
|
58
|
|
- required: true,
|
|
59
|
|
- },
|
|
60
|
|
- aspects: {
|
|
61
|
|
- type: Array,
|
|
62
|
|
- required: true,
|
|
63
|
|
- },
|
|
64
|
|
- isList: {
|
|
65
|
|
- type: Boolean,
|
|
66
|
|
- required: false,
|
|
67
|
|
- default: true,
|
|
68
|
|
- },
|
|
69
|
|
-})
|
|
70
|
|
-
|
|
71
|
|
-/**
|
|
72
|
|
- * Attempt to pair with target profile
|
|
73
|
|
- * Creates a grouping, and a membership
|
|
74
|
|
- * for both profileId and targetId
|
|
75
|
|
- */
|
|
76
|
|
-const onPair = async () => {
|
|
77
|
|
- const group = await postMembershipByProfileId({
|
|
78
|
|
- profileId: currentProfile.id.value,
|
|
79
|
|
- targetId: props.card.pid,
|
|
80
|
|
- })
|
|
81
|
|
- updateQueueByProfileId(currentProfile.id.value, props.card.pid, false)
|
|
82
|
|
- currentProfile.getGroupings()
|
|
83
|
|
- console.warn('created grouping:', group)
|
|
84
|
|
-
|
|
85
|
|
- let goToRoute = { name: 'HomeView' }
|
|
86
|
|
- // if (group.membershipMatch.hasMatch) {
|
|
87
|
|
- // goToRoute = { name: 'PairsView' }
|
|
88
|
|
- // }
|
|
89
|
|
- router.push(goToRoute)
|
|
90
|
|
-}
|
|
91
|
|
-
|
|
92
|
|
-/**
|
|
93
|
|
- * Send to the back of the matchQueue
|
|
94
|
|
- * and forward back home
|
|
95
|
|
- */
|
|
96
|
|
-const onPass = async () => {
|
|
97
|
|
- updateQueueByProfileId(currentProfile.id.value, props.card.pid, true)
|
|
98
|
|
- router.push({ name: 'HomeView' })
|
|
99
|
|
-}
|
|
100
|
|
-</script>
|
|
101
|
|
-
|
|
102
|
|
-<style lang="sass">
|
|
103
|
|
-.profile-card-list--card
|
|
104
|
|
- background-color: #000
|
|
105
|
|
- color: #fff
|
|
106
|
|
- header > .w-button
|
|
107
|
|
- background-color: #116006
|
|
108
|
|
- color: #fff
|
|
109
|
|
-</style>
|