Skip to content

Commit 6c81a8d

Browse files
committed
Add blurb on how to build a customised app.
1 parent df4c5c5 commit 6c81a8d

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,23 @@ In practice this means:
127127
of the modularity requirements it brings to the table.
128128

129129
With all this in mind, here's how you go about skinning the react SDK UI
130-
components to embed a Matrix client into your app: TODO. For now, check out
131-
the examples and work it out for yourself...
130+
components to embed a Matrix client into your app:
131+
132+
* Create a new NPM project. Be sure to directly depend on react, (otherwise
133+
you can end up with two copies of react).
134+
* Create an index.js file that sets up react. Add require statements for
135+
React, the ComponentBroker and matrix-react-sdk and a call to Render
136+
the root React element as in the examples.
137+
* Create React classes for any custom components you wish to add. These
138+
can be based off the files in `views` in the `matrix-react-sdk` package,
139+
modifying the require() statement appropriately.
140+
You only need to copy files you want to customise.
141+
* Add a ComponentBroker.set() call for each of your custom components. These
142+
must come *before* `require("matrix-react-sdk")`.
143+
* Add a way to build your project: we suggest copying the browserify calls
144+
from the example projects, but you could use grunt or gulp.
145+
* Create an index.html file pulling in your compiled index.js file, the
146+
CSS bundle from matrix-react-sdk.
147+
148+
For more specific detail on any of these steps, look at the `custom` example in
149+
matrix-react-sdk/examples.

0 commit comments

Comments
 (0)