Skip to content

Commit

Permalink
Remove Image URL form
Browse files Browse the repository at this point in the history
  • Loading branch information
boyvanamstel committed Nov 19, 2020
1 parent 67a9dae commit 669447d
Showing 1 changed file with 5 additions and 24 deletions.
29 changes: 5 additions & 24 deletions components/ImagePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,30 +170,11 @@ export default class ImagePicker extends React.Component {
<div>
<div className="choose-image">
<span>Upload a background image:</span>
<button
className={this.state.mode === 'file' ? 'active' : 'none'}
onClick={this.selectMode.bind(this, 'file')}
>
File
</button>
<button
className={this.state.mode === 'url' ? 'active' : 'none'}
onClick={this.selectMode.bind(this, 'url')}
>
URL
</button>
{this.state.mode === 'file' ? (
<Input
type="file"
accept="image/png,image/x-png,image/jpeg,image/jpg"
onChange={this.uploadImage}
/>
) : (
<form onSubmit={this.handleURLInput}>
<Input type="text" title="Background Image" placeholder="Image URL…" align="left" />
<button type="submit">Upload</button>
</form>
)}
<Input
type="file"
accept="image/png,image/x-png,image/jpeg,image/jpg"
onChange={this.uploadImage}
/>
{this.state.error && <span className="error">{this.state.error}</span>}
</div>
<style jsx>
Expand Down

0 comments on commit 669447d

Please sign in to comment.