Skip to content

Commit 97c72c2

Browse files
committed
highlight selected card
1 parent f6672e3 commit 97c72c2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

packages/common-ui/src/components/CardSearchResults.vue

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
v-for="card in cards"
99
:key="card._id"
1010
@click="selectCard(card)"
11+
:class="{'selected-card': card._id === selectedCardId}"
1112
class="cursor-pointer"
1213
>
1314
<v-list-item-title>{{ card._id }}</v-list-item-title>
@@ -51,6 +52,7 @@ export default defineComponent({
5152
cards: [] as CardWithCourse[],
5253
loading: false,
5354
error: null as string | null,
55+
selectedCardId: null as string | null,
5456
};
5557
},
5658
watch: {
@@ -107,8 +109,20 @@ export default defineComponent({
107109
},
108110
109111
selectCard(card: CardWithCourse) {
112+
this.selectedCardId = card._id;
110113
this.$emit('card-selected', { cardId: card._id, courseId: card.courseId });
111114
},
112115
},
113116
});
114117
</script>
118+
119+
<style scoped>
120+
.selected-card {
121+
background-color: #e0f2f7; /* Light blue background */
122+
border-left: 4px solid #2196f3; /* Blue left border */
123+
}
124+
125+
.cursor-pointer {
126+
cursor: pointer;
127+
}
128+
</style>

0 commit comments

Comments
 (0)