-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
58 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export Preview from './Preview'; | ||
export {Vector, Path, Rect, Circle, Text, Image} from './objects'; | ||
export {TextPanel, SizePanel, StylePanel, ArrangePanel} from './panels'; | ||
export {TextPanel, SizePanel, StylePanel, ArrangePanel, ImagePanel} from './panels'; | ||
export default from './Designer'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import React, {Component} from 'react'; | ||
import Radium from 'radium'; | ||
import _ from 'lodash'; | ||
|
||
import Icon from '../Icon'; | ||
import Panel from './Panel'; | ||
|
||
import styles from './styles'; | ||
import PropertyGroup from './PropertyGroup'; | ||
import Button from './Button'; | ||
import SwitchState from './SwitchState'; | ||
import Columns from './Columns'; | ||
import Column from './Column'; | ||
import Dropzone from 'react-dropzone'; | ||
|
||
export default class ImagePanel extends Panel { | ||
state = { | ||
files: [] | ||
} | ||
|
||
onDrop (files) { | ||
this.props.onChange("href", "/img/"+files[0].name); | ||
console.log('Received files: ', files); | ||
this.setState({ | ||
files: files | ||
}); | ||
} | ||
|
||
render() { | ||
let {object} = this.props; | ||
return ( | ||
<PropertyGroup object={object} showIf={_.has(object, 'href')}> | ||
<div style={styles.columns}> | ||
<Column> | ||
<div className="dropzone--wrapper"> | ||
<Dropzone onDrop={this.onDrop.bind(this)} multiple={false}> | ||
<div>Try dropping some files here, or click to select files to upload.</div> | ||
</Dropzone> | ||
</div> | ||
</Column> | ||
</div> | ||
</PropertyGroup> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters