File tree 2 files changed +448
-105
lines changed
2 files changed +448
-105
lines changed Original file line number Diff line number Diff line change @@ -5,20 +5,24 @@ import { Timeline } from 'react-twitter-widgets';
5
5
type Data = {
6
6
screenName : string ;
7
7
height : number ;
8
+ title : string ;
8
9
} ;
9
10
// you can pass the shape of the data as the generic type argument
10
11
const customContentPluginTwitter : CellPlugin < Data > = {
11
12
Renderer : ( { data } ) => (
12
- < Timeline
13
- dataSource = { {
14
- sourceType : 'profile' ,
15
- // data has already the right type!
16
- screenName : data . screenName ,
17
- } }
18
- options = { {
19
- height : data . height || 600 ,
20
- } }
21
- />
13
+ < div >
14
+ < h4 > { data . title } </ h4 >
15
+ < Timeline
16
+ dataSource = { {
17
+ sourceType : 'profile' ,
18
+ // data has already the right type!
19
+ screenName : data . screenName ,
20
+ } }
21
+ options = { {
22
+ height : data . height || 600 ,
23
+ } }
24
+ />
25
+ </ div >
22
26
) ,
23
27
id : 'twitter-timeline' ,
24
28
title : 'Twitter timeline' ,
@@ -30,9 +34,13 @@ const customContentPluginTwitter: CellPlugin<Data> = {
30
34
// this JSONschema is type checked against the generic type argument
31
35
// the autocompletion of your IDE helps to create this schema
32
36
properties : {
37
+ title : {
38
+ type : 'string' ,
39
+ default : 'A Sample Twitter plugin' ,
40
+ } ,
33
41
screenName : {
34
42
type : 'string' ,
35
- default : 'AlYankovic ' ,
43
+ default : 'typescript ' ,
36
44
} ,
37
45
height : {
38
46
type : 'number' ,
You can’t perform that action at this time.
0 commit comments