Skip to content

Commit 16e58b6

Browse files
committed
Add favorite icon
1 parent 03b8a0b commit 16e58b6

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

src/app/timeline/timeline.component.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
<div class="tweet-content">
77
{{ tweet.text }}
88
</div>
9+
<div class="favorite">
10+
<i class="far fa-heart"></i>
11+
<span *ngIf="tweet.favoriteCount">{{ tweet.favoriteCount }}</span>
12+
</div>
913
</div>
1014

1115
<div class="create-tweet-container">

src/app/timeline/timeline.component.less

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@
2727
}
2828
}
2929

30+
.favorite {
31+
margin-top: 5px;
32+
color: #e0245e;
33+
.button {
34+
cursor: pointer;
35+
}
36+
span {
37+
margin-left: 4px;
38+
}
39+
}
40+
3041
.create-tweet-container {
3142
margin-top: 20px;
3243
margin-left: 10px;

src/app/timeline/timeline.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ export class TimelineComponent implements OnInit {
1818
created_at: 'Thu Apr 06 15:24:15 +0000 2017',
1919
id: 2,
2020
text: 'Qui a deux pouces et qui s\'en fout ? Bob Kelso !',
21-
user: 'Bob kelso'
21+
user: 'Bob kelso',
22+
favoriteCount: 2
2223
},
2324
];
2425

src/index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@
44
<meta charset="utf-8">
55
<title>AngularShopTutorial</title>
66
<base href="/">
7-
87
<meta name="viewport" content="width=device-width, initial-scale=1">
98
<link rel="icon" type="image/x-icon" href="favicon.ico">
9+
<link
10+
rel="stylesheet"
11+
href="https://use.fontawesome.com/releases/v5.7.2/css/all.css"
12+
integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr"
13+
crossorigin="anonymous"
14+
>
1015
</head>
1116
<body>
1217
<app-root></app-root>

0 commit comments

Comments
 (0)