Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Channels: fix lurker mode display #1187

Merged
merged 1 commit into from Dec 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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