Skip to content

Commit

Permalink
fix: remove unused stake code
Browse files Browse the repository at this point in the history
  • Loading branch information
Aerilym committed Sep 25, 2024
1 parent 1449d0b commit a1c6abf
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions apps/staking/app/stake/[nodeId]/NodeStaking.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use client';

import { NodeContributorList } from '@/components/NodeCard';
import { PubKey } from '@session/ui/components/PubKey';
import { formatPercentage } from '@/lib/locale-client';
import { ButtonDataTestId } from '@/testing/data-test-ids';
Expand All @@ -14,19 +13,14 @@ import { useMemo } from 'react';
import { ActionModuleRow, ActionModuleRowSkeleton } from '@/components/ActionModule';
import { useStakingBackendSuspenseQuery } from '@/lib/sent-staking-backend-client';
import { getOpenNodes } from '@/lib/queries/getOpenNodes';
import { generateOpenNodes } from '@session/sent-staking-js/test';
import { areHexesEqual } from '@session/util/string';
import { FEATURE_FLAG } from '@/lib/feature-flags';
import { useFeatureFlag } from '@/lib/feature-flags-client';

export default function NodeStaking({ nodeId }: { nodeId: string }) {
const showMockNodes = useFeatureFlag(FEATURE_FLAG.MOCK_OPEN_NODES);
const { data, isLoading } = useStakingBackendSuspenseQuery(getOpenNodes);

const node = useMemo(() => {
if (showMockNodes) return generateOpenNodes()[0];
return data?.nodes?.find((node) => areHexesEqual(node.service_node_pubkey, nodeId));
}, [data, showMockNodes]);
}, [data]);

return isLoading ? (
<Loading />
Expand All @@ -38,7 +32,7 @@ export default function NodeStaking({ nodeId }: { nodeId: string }) {
}

export function NodeStakingForm({ node }: { node: GetOpenNodesResponse['nodes'][number] }) {
const dictionary = useTranslations('actionModules.node');
// const dictionary = useTranslations('actionModules.node');
const generalDictionary = useTranslations('general');
const sessionNodeDictionary = useTranslations('sessionNodes.general');
const sessionNodeStakingDictionary = useTranslations('sessionNodes.staking');
Expand All @@ -54,14 +48,14 @@ export function NodeStakingForm({ node }: { node: GetOpenNodesResponse['nodes'][

return (
<div className="flex flex-col gap-4">
<ActionModuleRow
label={dictionary('contributors')}
tooltip={dictionary('contributorsTooltip')}
>
<span className="flex flex-row flex-wrap items-center gap-2 align-middle">
<NodeContributorList contributors={node.contributions} forceExpand showEmptySlots />
</span>
</ActionModuleRow>
{/*<ActionModuleRow*/}
{/* label={dictionary('contributors')}*/}
{/* tooltip={dictionary('contributorsTooltip')}*/}
{/*>*/}
{/* <span className="flex flex-row flex-wrap items-center gap-2 align-middle">*/}
{/* <NodeContributorList contributors={node.contributions} forceExpand showEmptySlots />*/}
{/* </span>*/}
{/*</ActionModuleRow>*/}
<ActionModuleRow
label={sessionNodeStakingDictionary('stakedAmount')}
tooltip={sessionNodeStakingDictionary('stakedAmountDescription')}
Expand Down

0 comments on commit a1c6abf

Please sign in to comment.