Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. import React, {Component} from 'react';
  2. import FontIcon from 'material-ui/FontIcon'
  3. import {cyan500} from 'material-ui/styles/colors'
  4.  
  5. const remote = require('electron').remote
  6. const dialog = remote.require('dialog')
  7.  
  8. class PhotoHover extends Component {
  9. constructor(props) {
  10. super(props)
  11. }
  12.  
  13. uploadPhoto = (e) => {
  14. dialog.showOpenDialog({
  15. properties: ['openFile', 'openDirectory']
  16. }, function(file){
  17. console.log(file)
  18. })
  19. }
  20.  
  21. render() {
  22. return (
  23. <div onClick={this.uploadPhoto} style={{
  24. width:200,
  25. height:200,
  26. border:`5px solid ${cyan500}`,
  27. backgroundColor:cyan500,
  28. textAlign:'center',
  29. color:'#eee',
  30. fontSize:18,
  31. fontWeight:'bold',
  32. cursor:'pointer',
  33. display:'inline-block'
  34. }}>
  35. <span style={{
  36. paddingTop:20,
  37. display:'block'
  38. }}>
  39. Upload Photo
  40. </span>
  41. <FontIcon
  42. className="fa fa-plus-circle"
  43. style={{
  44. display:'block',
  45. fontSize:100,
  46. color:'inherit',
  47. marginTop:30
  48. }}
  49. />
  50. </div>
  51. )
  52. }
  53. }
  54.  
  55. export default PhotoHover
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement