Skip to content

Instantly share code, notes, and snippets.

View interaminense's full-sized avatar
🖐️
Hi there!

Adriano Interaminense interaminense

🖐️
Hi there!
View GitHub Profile
@interaminense
interaminense / mathematics-validade-props.js
Created February 28, 2018 04:19
Mathematics Validate Props
Button.PROPS = {
isActive: Config.bool().value(false)
};
@interaminense
interaminense / mathematics-validate-props-oneof.js
Created February 28, 2018 04:20
Mathematics Validate Props oneOf
Button.PROPS = {
style: Config.oneOf(['primary','default']).value('default')
};
@interaminense
interaminense / mathematics-jsdoc.js
Created February 28, 2018 04:21
Mathematics JSDoc
Button.PROPS = {
/**
* Adds the classname 'mathematics-btn--active'
* to Button
* @type {boolean}
* @default false
*/
isActive: Config.bool().value(false),
/**
@interaminense
interaminense / mathematics-render-component-button.js
Created February 28, 2018 04:24
Mathematics Render Component Button
import Component, {Config} from 'metal-jsx';
import getCN from 'classnames';
class Button extends Component {
render() {
const {children, isActive, style} = this.props;
const classes = getCN('mathematics-btn',
{
['mathematics-btn--active']: isActive,
[`mathematics-btn--${style}`]: style
@interaminense
interaminense / mathematics-otherprops.js
Created February 28, 2018 04:26
Mathematics OtherProps
{...this.otherProps()}
@interaminense
interaminense / mathematics-event-click.js
Created February 28, 2018 04:26
Mathematics Event Click
<Button style={'primary'} onClick='handleOnClick' />
@interaminense
interaminense / mathematics-props-children.js
Created February 28, 2018 04:28
Mathematics Props Children
<Button style={'primary'}>
<span class='icon icon-arrow-down' /> show more
</Button>
@interaminense
interaminense / mathematics-component-empty.js
Created February 28, 2018 04:30
Mathematics Component Empty
import '../style/mathematics.scss';
import {Button, Layout, Operation} from './';
import {LANGUAGE, CALCULATE, getRandomNumber} from '../utils/Utils';
import {EventHandler} from 'metal-events';
import Component, {Config} from 'metal-jsx';
import dom from 'metal-dom';
import position from 'metal-position';
class Mathematics extends Component {};
@interaminense
interaminense / mathematics-lifecycle-created.js
Created February 28, 2018 04:31
Mathematics Lifecycle Created
created() {
this.state.countdown = this.props.countdown;
this.setLvl(this.props.lvlDefault);
this.setInitGame();
}
@interaminense
interaminense / mathematics-setstartgame.js
Created February 28, 2018 04:32
Mathematics SetStartGame
setStartGame() {
this.setNextOperation();
this.setState({
errors: 0,
finish: false,
hits: 0,
init: false,
message: '',
start: true