99 id =" notifications"
1010 v-bind:class =" {
1111 'hidden': !showNotifications,
12- 'p -4': true,
12+ 'px -4': true,
1313 'overflow-scroll': notifications.length > 3,
1414 'bg-white': true,
1515 'shadow': true,
2121 'mt-10': true,
2222 'z-50': true,
2323 'rounded-md': true}" >
24- <div v-for =" notification in notifications" :key =" notification.id" >{{notification.text}}</div >
24+ <div v-bind:class =" {
25+ 'py-4': true,
26+ 'flex': true,
27+ 'word-break': true,
28+ 'items-center': true,
29+ 'border-b': true,
30+ 'font-bold': notification.is_seen,}"
31+ v-for =" notification in notifications" :key =" notification.id" >
32+ <img v-bind:src =" getImage(notification.type)" class =" w-4 h-4" >
33+ <h1 class =" ml-4" >{{notification.text}}</h1 >
34+ </div >
2535 </div >
2636 </div >
2737</template >
2838
2939<script >
40+ import heart from ' ../../assets/heartOutline.png' ;
41+ import heartBroken from ' ../../assets/brokenHeart.png' ;
42+ import message from ' ../../assets/message.png' ;
43+ import view from ' ../../assets/eye.png' ;
44+ import match from ' ../../assets/linkBlack.png' ;
45+
46+ /* eslint-disable object-curly-newline */
47+ /* eslint-disable consistent-return */
48+
3049export default {
3150 data : () => ({
3251 notify: true ,
3352 notifications: [
34- { text: ' Samantha liked you' , id: 1 },
35- { text: ' Bae liked you' , id: 2 },
36- { text: ' Samantha liked you' , id: 3 },
37- { text: ' Bae liked you' , id: 4 },
38- { text: ' Samantha liked you' , id: 5 },
39- { text: ' Bae liked you' , id: 6 },
40- { text: ' Samantha liked you' , id: 7 },
41- { text: ' Bae liked you' , id: 8 },
42- { text: ' Samantha liked you' , id: 9 },
43- { text: ' Bae liked you' , id: 10 },
53+ { text: ' Samantha liked you' , is_seen : false , type : ' like ' , id: 1 },
54+ { text: ' Bae liked you' , id: 2 , is_seen : false , type : ' dislike ' },
55+ { text: ' Samantha liked you' , id: 3 , is_seen : false , type : ' message ' },
56+ { text: ' Bae liked you' , id: 4 , is_seen : false , type : ' match ' },
57+ { text: ' Samantha liked you' , id: 5 , is_seen : true , type : ' view ' },
58+ { text: ' Bae liked you' , id: 6 , is_seen : true , type : ' like ' },
59+ { text: ' Samantha liked you' , id: 7 , is_seen : true , type : ' like ' },
60+ { text: ' Bae liked you' , id: 8 , is_seen : true , type : ' like ' },
61+ { text: ' Samantha liked you' , id: 9 , is_seen : true , type : ' like ' },
62+ { text: ' Bae liked youBae liked youBae liked youBae liked youBae liked youBae liked you' , id: 10 , is_seen : true , type : ' like ' },
4463 ],
4564 showNotifications: false ,
4665 }),
@@ -54,6 +73,23 @@ export default {
5473 this .notify = false ;
5574 }
5675 },
76+ getImage (type ) {
77+ if (type === ' like' ) {
78+ return heart;
79+ }
80+ if (type === ' dislike' ) {
81+ return heartBroken;
82+ }
83+ if (type === ' match' ) {
84+ return match;
85+ }
86+ if (type === ' view' ) {
87+ return view;
88+ }
89+ if (type === ' message' ) {
90+ return message;
91+ }
92+ },
5793 },
5894};
5995 </script >
0 commit comments