Megadraft embed plugin
Megradraft plugin to embed media URLs.
We support the following medias:
twitter
post URL like:https://twitter.com/RedeGlobo/status/840532910696361984
.If you need some other media, check the section: Add new sources
above.
Include the plugin in the plugins
prop of your Megadraft
instance.
import React from "react";
import ReactDOM from "react-dom";
import Megadraft from "megadraft";
import plugin from "megadraft-embed";
class Example extends React.Component {
render(){
return (
<Megadraft plugins={[plugin]} ></Megadraft>
);
}
}
ReactDOM.render(<Example ></Example>, document.getElementById("container"));
Install, run, test.
# Install npm dependencies
make setup
# Gulp dev-server task with webpack + sass running on http://localhost:8080/
make run
# Run mocha tests + eslint
make test
If you’re constantly running tests, there’s a faster alternative using mocha’s
watch feature:
make watch_unit
—
There’s a prepublish
script entry on package.json
that runs build tasks
before publishing the package.
npm publish
The sample plugin uses the extension icon from https://design.google.com/icons/
under Apache License Version 2.0.
Social Medias:
Facebook, Maps, Youtube, Twitter: Icons made by SimpleIcon is licensed by CC BY 3.0
Instagram: Icons made by GraphicsBay is licensed by CC BY 3.0