Skip to content

Commit 4067aab

Browse files
committed
use grid instead of flexbox for recommendations
1 parent 1bf1b6f commit 4067aab

File tree

2 files changed

+13
-22
lines changed

2 files changed

+13
-22
lines changed

frontend/src/components/app/recommendations/RecommendationCard.vue

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
<template>
22
<!-- eslint-disable max-len -->
33
<div v-bind:class="{
4-
'card': true,
5-
'flex w-full': true,
6-
'ml-1': true,
4+
'flex': true,
75
'flex-col': true,
8-
'justify-end items-start': true,
6+
'justify-end': true,
97
'shadow-inner': true,
108
'recommendation-card': true,
11-
'rounded-md': true,
12-
'mb-2': true,
13-
'ml-2': index % 2 === 0}"
9+
'rounded-md': true}"
1410
v-bind:style="{
1511
'background-repeat': 'no-repeat',
1612
'background-position': 'center center',
@@ -48,7 +44,6 @@ export default {
4844
imageForShowcase = userImages[i].link;
4945
}
5046
}
51-
console.log(imageForShowcase);
5247
if (imageForShowcase) {
5348
return imageForShowcase;
5449
}
@@ -71,9 +66,6 @@ export default {
7166
return Math.floor(this.recommendation.distance);
7267
},
7368
},
74-
created() {
75-
console.log(this.index);
76-
},
7769
};
7870
</script>
7971

@@ -83,9 +75,4 @@ export default {
8375
height: 32rem;
8476
box-shadow: inset 0 -8rem 1rem rgba(0, 0, 0, 0.3);
8577
}
86-
@screen md {
87-
.card {
88-
width: 48%;
89-
}
90-
}
9178
</style>

frontend/src/components/app/recommendations/Recommendations.vue

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22
<!-- eslint-disable max-len -->
33
<section>
44
<h1 class="text-5xl my-4 text-center sm:text-left leading-none onboarding-sub-container-content-heading">{{recommendations.length}} {{title}}</h1>
5-
<div class="flex mb-12 relative">
6-
<Sort
7-
v-bind:options="['Youngest', 'Oldest', 'Closest', 'Farest', 'Most popular', 'Least popular', 'Most common interests', 'Least common interests']"
8-
v-on:sort="sort"></Sort>
9-
<FilterSlider v-bind:name="'Age'" v-on:filter="filter"></FilterSlider>
5+
<div class="flex w-full items-stretch sm:items-center justify-center sm:justify-start mb-12 relative">
6+
<Sort
7+
v-bind:options="['Youngest', 'Oldest', 'Closest', 'Farest', 'Most popular', 'Least popular', 'Most common interests', 'Least common interests']"
8+
v-on:sort="sort"></Sort>
9+
<FilterSlider v-bind:name="'age'" v-on:filter="filter"></FilterSlider>
10+
<FilterSlider v-bind:unit="'km'" v-bind:name="'distance'" v-on:filter="filter"></FilterSlider>
11+
<FilterSlider v-bind:unit="'pts'" v-bind:name="'fame'" v-on:filter="filter"></FilterSlider>
12+
<FilterSlider v-bind:name="'tags'" v-on:filter="filter"></FilterSlider>
1013
</div>
11-
<div class="flex flex-wrap items-center justify-start">
14+
<!-- <div class="flex flex-wrap items-center justify-start">-->
15+
<div class="grid grid-cols-1 md:grid-cols-2 gap-2">
1216
<RecommendationCard
1317
v-for="(recommendation, index) in recommendations" :key="index"
1418
v-bind:recommendation="recommendation" v-bind:index="index + 1"></RecommendationCard>

0 commit comments

Comments
 (0)