From 05c63c5c99ce2185cfb64123149cc4c9887c9358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Fri, 20 Oct 2017 23:02:12 +0200 Subject: [PATCH] wip stuffs --- .../compose/attach_options/index.js | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 app/javascript/glitch/components/compose/attach_options/index.js diff --git a/app/javascript/glitch/components/compose/attach_options/index.js b/app/javascript/glitch/components/compose/attach_options/index.js new file mode 100644 index 0000000000..d770012d7d --- /dev/null +++ b/app/javascript/glitch/components/compose/attach_options/index.js @@ -0,0 +1,72 @@ +// Package imports // +import React from 'react'; +import PropTypes from 'prop-types'; +import { injectIntl, defineMessages } from 'react-intl'; + +// Our imports // +import ComposeDropdown from '../dropdown/index'; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + +const messages = defineMessages({ + upload : + { id: 'compose.attach.upload', defaultMessage: 'Upload a file' }, + doodle : + { id: 'compose.attach.doodle', defaultMessage: 'Draw something' }, + attach : + { id: 'compose.attach', defaultMessage: 'Attach...' }, +}); + + +@injectIntl +export default class ComposeAttachOptions extends React.PureComponent { + + static propTypes = { + intl : PropTypes.object.isRequired, + }; + + handleClick = e => { + const bt = e.target.datset.index; + //TODO + }; + + render () { + const { intl } = this.props; + + const options = [ + { icon: 'cloud-upload', text: messages.upload, name: 'upload' }, + { icon: 'paint-brush', text: messages.doodle, name: 'doodle' }, + ]; + + const optionElems = options.map((item) => { + return ( +
+
+ +
+ +
+ {item.text} +
+
+ ); + }); + + return ( + + {optionElems} + + ); + } + +}