From 45c44989c8fb6e24badd18bb83ac5f68de0aceaf Mon Sep 17 00:00:00 2001 From: kibigo! Date: Fri, 17 Nov 2017 19:11:18 -0800 Subject: Forking glitch theme --- .../themes/glitch/components/status_prepend.js | 83 ++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 app/javascript/themes/glitch/components/status_prepend.js (limited to 'app/javascript/themes/glitch/components/status_prepend.js') diff --git a/app/javascript/themes/glitch/components/status_prepend.js b/app/javascript/themes/glitch/components/status_prepend.js new file mode 100644 index 000000000..bd2559e46 --- /dev/null +++ b/app/javascript/themes/glitch/components/status_prepend.js @@ -0,0 +1,83 @@ +// Package imports // +import React from 'react'; +import PropTypes from 'prop-types'; +import ImmutablePropTypes from 'react-immutable-proptypes'; +import { FormattedMessage } from 'react-intl'; + +export default class StatusPrepend extends React.PureComponent { + + static propTypes = { + type: PropTypes.string.isRequired, + account: ImmutablePropTypes.map.isRequired, + parseClick: PropTypes.func.isRequired, + notificationId: PropTypes.number, + }; + + handleClick = (e) => { + const { account, parseClick } = this.props; + parseClick(e, `/accounts/${+account.get('id')}`); + } + + Message = () => { + const { type, account } = this.props; + let link = ( + + + + ); + switch (type) { + case 'reblogged_by': + return ( + + ); + case 'favourite': + return ( + + ); + case 'reblog': + return ( + + ); + } + return null; + } + + render () { + const { Message } = this; + const { type } = this.props; + + return !type ? null : ( + + ); + } + +} -- cgit