Skip to content

Commit 4a37894

Browse files
committed
display min ratio
1 parent 4725903 commit 4a37894

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

client/pages/user/[username].js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const User = ({ user, userRole }) => {
2222
const [cookies] = useCookies()
2323

2424
const {
25-
publicRuntimeConfig: { SQ_TORRENT_CATEGORIES },
25+
publicRuntimeConfig: { SQ_TORRENT_CATEGORIES, SQ_MINIMUM_RATIO },
2626
} = getConfig()
2727

2828
const downloadedBytes = prettyBytes(user.downloaded?.bytes || 0).split(' ')
@@ -97,7 +97,17 @@ const User = ({ user, userRole }) => {
9797
Ratio
9898
</Text>
9999
<Text fontSize={5}>
100-
{user.ratio === -1 ? '∞' : user.ratio.toFixed(2)}
100+
{user.ratio === -1 ? 'N/A' : user.ratio.toFixed(2)}
101+
{user.ratio !== -1 && (
102+
<Text
103+
as="span"
104+
fontSize={3}
105+
color={user.ratio >= SQ_MINIMUM_RATIO ? 'success' : 'error'}
106+
>
107+
{' '}
108+
{user.ratio >= SQ_MINIMUM_RATIO ? '>' : '<'} {SQ_MINIMUM_RATIO}
109+
</Text>
110+
)}
101111
</Text>
102112
</Box>
103113
<Box bg="sidebar" borderRadius={2} p={4}>

0 commit comments

Comments
 (0)