Skip to content

Commit 69df1fc

Browse files
committed
fix: improve demo
1 parent 2aedeb9 commit 69df1fc

File tree

2 files changed

+448
-105
lines changed

2 files changed

+448
-105
lines changed

examples/plugins/customContentPluginTwitter.tsx

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,24 @@ import { Timeline } from 'react-twitter-widgets';
55
type Data = {
66
screenName: string;
77
height: number;
8+
title: string;
89
};
910
// you can pass the shape of the data as the generic type argument
1011
const customContentPluginTwitter: CellPlugin<Data> = {
1112
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>
2226
),
2327
id: 'twitter-timeline',
2428
title: 'Twitter timeline',
@@ -30,9 +34,13 @@ const customContentPluginTwitter: CellPlugin<Data> = {
3034
// this JSONschema is type checked against the generic type argument
3135
// the autocompletion of your IDE helps to create this schema
3236
properties: {
37+
title: {
38+
type: 'string',
39+
default: 'A Sample Twitter plugin',
40+
},
3341
screenName: {
3442
type: 'string',
35-
default: 'AlYankovic',
43+
default: 'typescript',
3644
},
3745
height: {
3846
type: 'number',

0 commit comments

Comments
 (0)