A react UI package for working with the genie keyboard control library (https://github.com/kentcdodds/genie)
Demo: http://www.eliotk.net/react-lamp/demo
First istall the package:
npm install react-lamp --save
You also need install the GenieJS package separately if you haven't already:
npm install geniejs --save
And a basic approach for using the component with some wishes loaded into GenieJS:
import React from 'react';
import ReactDOM from 'react-dom';
import Lamp from 'react-lamp';
import Genie from 'geniejs';
const wishes = [
{
magicWords: ['Go to google'],
action: function() {
window.location.href = 'https://www.google.com';
}
}
];
wishes.forEach((wish) => {
Genie(wish);
});
ReactDOM.render(<Lamp genie={Genie} />, document.getElementById('root'));
The key combo that shows and hides the lamp UI is: ctrl+space
npm install
npm start
Go to localhost:8080
npm test
webpack --config webpack.dist.config.js
webpack --config webpack.demo.config.js --optimize-minimize