Ex06: Viewport adapter

Task: change the twitter adapter to a common adapter and check it on Twitter, YouTube, Instagram and Dapplets.org.

The initial code for this example is in master.

Change twitter adapter to a common adapter in /dapplet.json with a right version:

1{
2 ...
3
4 "contextIds": ["common-adapter.dapplet-base.eth"],
5 ...
6 "dependencies": {
7 "common-adapter.dapplet-base.eth": "0.3.6"
8 }
9}

In src/index.ts change injected adapter:

@Inject('common-adapter.dapplet-base.eth') public adapter: any;

and set the right insertion point:

1BODY: () =>
2 button({
3 DEFAULT: {
4 tooltip: 'Injected Button',
5 img: EXAMPLE_IMG,
6 exec: () => alert('Hello, World!'),
7 },
8 }),

Here is the result code of the example: ex06-viewport-adapter.

Run the dapplet:

npm i
npm start