lbry-desktop/ui/component/ratioBar/view.jsx
jessopb 3034f4ce6c
bring in styles (#7542)
* bring in ody styles; modify; cleanup

* workflow

* workflow

* v0.52.6-alpha.teststyles.1

* fix hook

* v0.52.6-alpha.teststyles.2

* style fixes

* fix pagination styling

* v0.52.6-alpha.teststyles.3

* wallet icon was bad

* restore deploy script

* fixes

* fix player close button

* modal inputs

* cleanup

* cleanup

* fix staked indicator

* fix profile menu button skel delay

* fix view-all-playlists hover

* fix overlay buttons on collection page

* fix header buttons
2022-04-17 13:04:56 -04:00

25 lines
575 B
JavaScript

// @flow
import React from 'react';
type Props = {
likeCount: number,
dislikeCount: number,
};
const RatioBar = (props: Props) => {
const { likeCount, dislikeCount } = props;
const like = (1 / (likeCount + dislikeCount)) * likeCount;
if (like || dislikeCount) {
return (
<div className={'ratio-bar'}>
<div className={'ratio-bar-like'} style={{ flex: like }} />
<div className={'ratio-bar-dislike'} style={{ flex: 1 - like }} />
</div>
);
} else {
return <div className={'ratio-bar'} />;
}
};
export default RatioBar;