File tree Expand file tree Collapse file tree 4 files changed +45
-1
lines changed
Expand file tree Collapse file tree 4 files changed +45
-1
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import { TimelineComponent } from './timeline/timeline.component';
1010 declarations : [
1111 AppComponent ,
1212 TimelineComponent ,
13- TimeAgoPipe
13+ TimeAgoPipe ,
1414 ] ,
1515 imports : [
1616 BrowserModule ,
Original file line number Diff line number Diff line change 77 {{ tweet.text }}
88 </ div >
99</ div >
10+
11+ < div class ="create-tweet-container ">
12+ < div class ="tweet-content ">
13+ < textarea cols ="50 " rows ="5 " #tweetContent > </ textarea >
14+ </ div >
15+ < div class ="footer ">
16+ < button class ="send-tweet-button " (click) ="addTweet(tweetContent.value) "> Tweeter</ button >
17+ </ div >
18+ </ div >
Original file line number Diff line number Diff line change 2727 }
2828}
2929
30+ .create-tweet-container {
31+ margin-top : 20px ;
32+ margin-left : 10px ;
33+
34+ textarea {
35+ background : #fff ;
36+ border : 1px solid #e6ecf0 ;
37+ border-radius : 8px ;
38+ line-height : 20px ;
39+ }
40+
41+ .send-tweet-button {
42+ background-color : #32ADAD ;
43+ border-color : transparent ;
44+ border-radius : 100px ;
45+ color : white ;
46+ font-size : 10px ;
47+ line-height : 8px ;
48+ padding : 6px 16px ;
49+ margin-left : 310px ;
50+ cursor : pointer ;
51+ }
52+ }
Original file line number Diff line number Diff line change @@ -22,9 +22,21 @@ export class TimelineComponent implements OnInit {
2222 } ,
2323 ] ;
2424
25+ user : string = 'Hugo' ;
26+
2527 constructor ( ) { }
2628
2729 ngOnInit ( ) {
2830 }
2931
32+ addTweet ( text : string ) {
33+ const tweet : Tweet = {
34+ created_at : new Date ( ) . toISOString ( ) ,
35+ id : this . tweets . length + 1 ,
36+ text,
37+ user : this . user
38+ }
39+ this . tweets . push ( tweet ) ;
40+ }
41+
3042}
You can’t perform that action at this time.
0 commit comments