Created
January 12, 2016 17:11
-
-
Save chuck0523/8a0785c0a76aee2261b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import ReactDom from "react-dom"; | |
class SkillTag extends React.Component { | |
tagNames() { | |
return ['HTML', 'CSS', 'JavaScript', 'Ruby', 'Haskell'].join(', '); | |
} | |
constructor(props) { | |
super(props); | |
this.state = { | |
hovered: false, | |
selected: [] | |
} | |
} | |
styles() { | |
return { | |
container: { | |
}, | |
selectedTags: { | |
}, | |
tagInput: { | |
}, | |
tagOptions: { | |
padding: 0, | |
listStyleType: 'none', | |
cursor: 'pointer' | |
} | |
} | |
}; | |
onClick(num, index, aaa, bbb) { | |
console.log(num) | |
this.setState({ | |
selected: this.state.selected.push(num) | |
}) | |
} | |
tags() { | |
return { | |
} | |
} | |
render() { | |
const styles = this.styles(); | |
const tagNames = this.tagNames(); | |
return ( | |
<div> | |
<div><span>{tagNames}</span></div> | |
<input></input> | |
<ul style={styles.tagOptions}> | |
<li onClick={::this.onClick}>{tagNames}</li> | |
</ul> | |
</div> | |
); | |
} | |
} | |
ReactDom.render( | |
<SkillTag />, | |
document.getElementById('skilltag-container') | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment