mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-11-01 10:56:31 +08:00
38 lines
713 B
JavaScript
38 lines
713 B
JavaScript
import React from 'react';
|
|
import './card.scss';
|
|
|
|
export class Card extends React.Component {
|
|
constructor(props){
|
|
super(props);
|
|
this.state = {
|
|
dragging: false
|
|
};
|
|
}
|
|
|
|
onClick(){
|
|
if(this.props.onClick){
|
|
this.props.onClick();
|
|
}
|
|
}
|
|
|
|
onMouseEnter(){
|
|
if(this.props.onMouseEnter){
|
|
this.props.onMouseEnter();
|
|
}
|
|
}
|
|
|
|
onMouseLeave(){
|
|
if(this.props.onMouseLeave){
|
|
this.props.onMouseLeave();
|
|
}
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<div {...this.props} className={this.props.className+" box"}>
|
|
{this.props.children}
|
|
</div>
|
|
);
|
|
}
|
|
}
|