@krowdy-ui/views
Version:
React components that implement Google's Material Design.
32 lines (30 loc) • 797 B
JavaScript
import React from 'react';
import { makeStyles, Typography } from '@krowdy-ui/core';
var Price = function Price(_ref) {
var price = _ref.price,
multiplier = _ref.multiplier,
max = _ref.max;
var classes = useStyles({
max: max,
price: price
});
return /*#__PURE__*/React.createElement("div", {
className: classes.price
}, /*#__PURE__*/React.createElement(Typography, {
variant: "body1"
}, Math.round(price * multiplier)));
};
var useStyles = makeStyles(function (theme) {
return {
price: {
color: theme.palette.grey[600],
position: 'absolute',
top: function top(_ref2) {
var price = _ref2.price,
max = _ref2.max;
return "".concat(100 - price / max * 100, "%");
}
}
};
});
export default Price;