diff options
Diffstat (limited to 'frontend/app/views/tile/forms/tile.form.element.image.js')
| -rw-r--r-- | frontend/app/views/tile/forms/tile.form.element.image.js | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/frontend/app/views/tile/forms/tile.form.element.image.js b/frontend/app/views/tile/forms/tile.form.element.image.js new file mode 100644 index 0000000..68ef65a --- /dev/null +++ b/frontend/app/views/tile/forms/tile.form.element.image.js @@ -0,0 +1,46 @@ +import React from 'react' + +import { + TextInput, + Select, Checkbox, +} from 'app/common' + +import { IMAGE_TILE_STYLES } from './tile.constants' + +export default function TileImageForm({ tile, errorFields, parent }) { + return ( + <div> + <div className='row imageUrl'> + {tile.settings.url && <div className='thumb'><img src={tile.settings.url} /></div>} + <TextInput + title="" + placeholder='http://' + name="url" + required + data={tile.settings} + error={errorFields.has('url')} + onChange={parent.handleImageChange} + autoComplete="off" + /> + </div> + <div className='row pair'> + <Checkbox + label="Tiled" + name="is_tiled" + checked={tile.settings.is_tiled} + onChange={parent.handleSettingsSelect} + autoComplete="off" + /> + {tile.settings.is_tiled && + <Select + name='tile_style' + selected={tile.settings.tile_style || 'tile'} + options={IMAGE_TILE_STYLES} + title='' + onChange={parent.handleSettingsSelect} + /> + } + </div> + </div> + ) +}
\ No newline at end of file |
