mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2026-03-10 21:25:04 +00:00
Firebase Init files
This commit is contained in:
30
public/like_button.js
Normal file
30
public/like_button.js
Normal file
@@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
const e = React.createElement;
|
||||
|
||||
class LikeButton extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
liked: false
|
||||
};
|
||||
}
|
||||
|
||||
render() {
|
||||
if (this.state.liked) {
|
||||
return 'You liked this.';
|
||||
}
|
||||
|
||||
return e(
|
||||
'button', {
|
||||
onClick: () => this.setState({
|
||||
liked: true
|
||||
})
|
||||
},
|
||||
'Like'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const domContainer = document.querySelector('#like_button_container');
|
||||
ReactDOM.render(e(LikeButton), domContainer);
|
||||
Reference in New Issue
Block a user