Basic structure of a react SDK and start of an implementation.
This commit is contained in:
11
example/index.html
Normal file
11
example/index.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Matrix Flux</title>
|
||||
</head>
|
||||
<body>
|
||||
<section id="matrixchat"></section>
|
||||
<script src="bundle.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
12
example/lib/index.jsx
Normal file
12
example/lib/index.jsx
Normal file
@@ -0,0 +1,12 @@
|
||||
var React = require("react");
|
||||
// In normal usage of the module:
|
||||
//var MatrixReactSdk = require("matrix-react-sdk");
|
||||
// Or to import the source directly from the file system:
|
||||
// (This is useful for debugging the SDK as ut seems source
|
||||
// maps cannot pass through two stages).
|
||||
var MatrixReactSdk = require("../../src/index");
|
||||
|
||||
React.render(
|
||||
<MatrixReactSdk.MatrixChat />,
|
||||
document.getElementById('matrixchat')
|
||||
);
|
||||
19
example/package.json
Normal file
19
example/package.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "matrix-react-example",
|
||||
"version": "0.0.1",
|
||||
"description": "Example usage of matrix-react-sdk",
|
||||
"author": "matrix.org",
|
||||
"license": "Apache 2",
|
||||
"devDependencies": {
|
||||
"browserify": "^10.2.3",
|
||||
"envify": "^3.4.0",
|
||||
"matrix-react-sdk": "../",
|
||||
"reactify": "^1.1.1",
|
||||
"uglifyify": "^3.0.1",
|
||||
"watchify": "^3.2.1"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "browserify -t [ envify --NODE_ENV production ] -t reactify -g uglifyify lib/index.jsx -o bundle.js",
|
||||
"start": "watchify -v -d -t reactify lib/index.jsx -o bundle.js"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user