mirror of
https://github.com/status-im/meritocracy.git
synced 2025-02-09 12:26:01 +00:00
* feat: added kudos wall * feat: add admin forms * feat: add forfeit and allocate functionality * fix: moved leaderboard out of admin panel
44 lines
1.4 KiB
JavaScript
44 lines
1.4 KiB
JavaScript
/* global web3 */
|
|
import React, { Fragment } from 'react';
|
|
import moment from 'moment';
|
|
import Address from './Address';
|
|
import { Row, Col } from 'react-bootstrap';
|
|
import PropTypes from 'prop-types';
|
|
|
|
const Praise = ({ contributorList, item, individual }) => {
|
|
const name = contributorList.find(x => x.value === item.author);
|
|
const date = moment.unix(item.time).fromNow();
|
|
return (
|
|
<Row>
|
|
<Col className="mb-4 text-muted">
|
|
{!item.praise && (
|
|
<Fragment>
|
|
{(name && name.label) || <Address value={item.author} compact={true} />}{' '}
|
|
{individual ? 'has sent you' : 'sent'} {web3.utils.fromWei(item.amount, 'ether')} SNT{' '}
|
|
{!individual && <span>to {item.destination}</span>}, <small>{date}</small>
|
|
</Fragment>
|
|
)}
|
|
|
|
{item.praise && (
|
|
<Fragment>
|
|
{(name && name.label) || <Address value={item.author} compact={true} />}
|
|
{!individual && <span> to {item.destination}</span>}, <small>{date}</small>
|
|
<div className="chatBubble p-3">
|
|
"{item.praise}"
|
|
<small className="float-right">{web3.utils.fromWei(item.amount, 'ether')} SNT</small>
|
|
</div>
|
|
</Fragment>
|
|
)}
|
|
</Col>
|
|
</Row>
|
|
);
|
|
};
|
|
|
|
Praise.propTypes = {
|
|
contributorList: PropTypes.array,
|
|
individual: PropTypes.bool,
|
|
item: PropTypes.object
|
|
};
|
|
|
|
export default Praise;
|