Skip to content

Commit b897cf8

Browse files
authored
Merge pull request #429 from Seluj78/362-matched-profile
show link icon and matched heading for matched profile
2 parents b485109 + 060d523 commit b897cf8

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

frontend/src/assets/linkPurple.png

3.65 KB
Loading

frontend/src/components/app/users/UserProfile.vue

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
</div>
1212
<div class="text-center text-wrap p-8 mt-4 border-b">
1313
<h1 class="text-gray-matcha text-4xl font-bold mb-6">{{user.first_name}}, {{user.age}}</h1>
14+
<div v-if="isMatched" class="flex items-center mt-2 text-left">
15+
<img src="../../../assets/linkPurple.png" class="w-4 h-4 mr-2">
16+
<h1 class="text-gray-600 text-purple-matcha">Matched</h1>
17+
</div>
1418
<div v-if="!user.is_online" class="flex items-center mt-2 text-left">
1519
<img class="w-3 h-3 mr-2" src="../../../assets/recommendations/offline.png">
1620
<h1 class="text-gray-600">Last seen {{user.last_seen}}</h1>
@@ -118,6 +122,7 @@ export default {
118122
report: 'harassment',
119123
reported: false,
120124
blocked: false,
125+
isMatched: false,
121126
}),
122127
methods: {
123128
avatarsUploaded() {
@@ -159,6 +164,7 @@ export default {
159164
}
160165
const user = await this.$http.get(`/users/${this.$store.getters.getLoggedInUser.id}`);
161166
await this.$store.dispatch('login', user.data);
167+
this.checkIfUserIsMatched();
162168
},
163169
async buttonRevert(...args) {
164170
const [name] = args;
@@ -171,6 +177,7 @@ export default {
171177
}
172178
const user = await this.$http.get(`/users/${this.$store.getters.getLoggedInUser.id}`);
173179
await this.$store.dispatch('login', user.data);
180+
this.checkIfUserIsMatched();
174181
},
175182
saveSingleChoice(...args) {
176183
const [key, value] = args;
@@ -207,6 +214,7 @@ export default {
207214
} else {
208215
this.likeButtons.likeClicked = true;
209216
}
217+
return;
210218
}
211219
}
212220
},
@@ -219,10 +227,22 @@ export default {
219227
}
220228
}
221229
},
230+
checkIfUserIsMatched() {
231+
const likes = this.$store.getters.getLoggedInUser.likes.received;
232+
for (let i = 0; i < likes.length; i += 1) {
233+
if (likes[i].liker_id === this.user.id
234+
&& (this.likeButtons.superLikeClicked || this.likeButtons.likeClicked)) {
235+
this.isMatched = true;
236+
return;
237+
}
238+
}
239+
this.isMatched = false;
240+
},
222241
},
223242
async beforeMount() {
224243
this.checkIfUserIsLiked();
225244
this.checkIfUserIsBlocked();
245+
this.checkIfUserIsMatched();
226246
const interests = this.user.tags;
227247
if (interests) {
228248
for (let j = 0; j < interests.length; j += 1) {

0 commit comments

Comments
 (0)