Personal Dashboard

UserPicChange.jsx 1.1KB

12345678910111213141516171819202122232425262728
  1. import React from 'react'
  2. import { InputGroup, Dialog, Intent, Button } from '@blueprintjs/core'
  3. const UserPicChangeTemplate = ({ value, change, save, cancel, open }) =>
  4. <Dialog iconName="inbox" isOpen={open} onClose={cancel} title="Change profile picture">
  5. <div className="pt-dialog-body">
  6. <InputGroup name="picURL" placeholder="Picture URL" leftIconName="mugshot" value={value} onChange={e => change(e.target.value)} />
  7. </div>
  8. <div className="pt-dialog-footer">
  9. <div className="pt-dialog-footer-actions">
  10. <Button text="Cancel" onClick={cancel} />
  11. <Button intent={Intent.PRIMARY} onClick={save} text="Save" />
  12. </div>
  13. </div>
  14. </Dialog>
  15. class UserPicChange extends React.Component {
  16. state = { value: '' }
  17. render() {
  18. return <UserPicChangeTemplate open={this.props.open}
  19. value={this.state.value} change={value => this.setState({ value })}
  20. save={() => this.props.save(this.state.value)} cancel={this.props.cancel}
  21. />
  22. }
  23. }
  24. export default UserPicChange