You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
carbon/components/CopyButton.js

42 lines
684 B
JavaScript

import React from 'react'
import Button from './Button'
// constants
const BUTTON_COLOR = '#84ACFC'
const STATUS = {
IDLE: 'IDLE',
LOADING: 'LOADING',
DEBOUNCED: 'DEBOUNCED'
}
const textMap = {
[STATUS.IDLE]: 'Copy Imgur Link',
[STATUS.LOADING]: 'Loading...',
[STATUS.DEBOUNCED]: 'Coppied'
}
class CopyButton extends React.Component {
constructor(props) {
super(props)
this.state = {
status: STATUS.IDLE
}
}
handleClick () {
switch (this.state.status)
}
render () {
return (
<div>
<Button onClick={() => {}} title={textMap[this.state.status]} bg={BUTTON_COLOR}/>
</div>
)
}
}
export default CopyButton