31 lines
793 B
JavaScript
31 lines
793 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { formatPrice } from '../../library/helpers.js';
|
|
|
|
import { StyleSheet, Text } from 'react-native';
|
|
|
|
const AuctionPriceAndBidCount = ({ bidCount, currentPrice }) => {
|
|
const _getPriceAndBidString = () => `${formatPrice(currentPrice)} (${bidCount} bids)`;
|
|
|
|
return (
|
|
<Text style={styles.currentPriceAndBidCount} numberOfLines={1}>
|
|
{_getPriceAndBidString()}
|
|
</Text>
|
|
);
|
|
};
|
|
|
|
AuctionPriceAndBidCount.propTypes = {
|
|
itemId: PropTypes.string.isRequired,
|
|
bidCount: PropTypes.number.isRequired,
|
|
currentPrice: PropTypes.number.isRequired,
|
|
};
|
|
|
|
const styles = StyleSheet.create({
|
|
currentPriceAndBidCount: {
|
|
color: '#000',
|
|
},
|
|
});
|
|
|
|
export default AuctionPriceAndBidCount;
|