Skip to content

Commit

Permalink
Merge pull request #1187 from kaloudis/channels-lurker
Browse files Browse the repository at this point in the history
Channels: fix lurker mode display
  • Loading branch information
kaloudis committed Dec 12, 2022
2 parents 75de37f + 42f3d47 commit 2c4efc0
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions components/Channels/ChannelItem.tsx
Expand Up @@ -7,8 +7,12 @@ import { Row } from '../../components/layout/Row';
import { Status } from '../../views/Channels/ChannelsPane';
import Amount from '../Amount';
import { Tag } from './Tag';

import PrivacyUtils from './../../utils/PrivacyUtils';
import { themeColor } from './../../utils/ThemeUtils';

import Stores from '../../stores/Stores';

export function ChannelItem({
title,
inbound,
Expand All @@ -22,6 +26,10 @@ export function ChannelItem({
largestTotal?: number;
status: Status;
}) {
const { settings } = Stores.settingsStore;
const { privacy } = settings;
const lurkerMode = (privacy && privacy.lurkerMode) || false;

const percentOfLargest = largestTotal
? (Number(inbound) + Number(outbound)) / largestTotal
: 1.0;
Expand All @@ -37,17 +45,17 @@ export function ChannelItem({
>
<Row justify="space-between">
<View style={{ flex: 1, paddingRight: 10 }}>
<Body>{title}</Body>
<Body>{PrivacyUtils.sensitiveValue(title)}</Body>
</View>
<Tag status={status} />
</Row>
<Row>
<BalanceBar
left={Number(outbound)}
right={Number(inbound)}
left={lurkerMode ? 50 : Number(outbound)}
right={lurkerMode ? 50 : Number(inbound)}
offline={status === Status.Offline}
percentOfLargest={percentOfLargest}
showProportionally={true}
showProportionally={lurkerMode ? false : true}
/>
</Row>
<Row justify="space-between">
Expand Down

0 comments on commit 2c4efc0

Please sign in to comment.