Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,17 @@ export const ChainIdentifier = ({ genesisHash }: TokenInfoProps) => {
};

interface Props extends TokenInfoProps {
type: 'pool' | 'solo';
balance: BN;
claimPermissions?: PalletNominationPoolsClaimPermission['type'],
price: number;
decimal: number;
token: string;
isSelected?: boolean;
price: number;
token: string;
totalPositions: number;
type: 'pool' | 'solo';
}

function PositionItem ({ balance, claimPermissions, decimal, genesisHash, isSelected, price, token, type }: Props) {
function PositionItem ({ balance, claimPermissions, decimal, genesisHash, isSelected, price, token, totalPositions, type }: Props) {
const { address } = useParams<{ address: string }>();
const navigate = useNavigate();
const hasPoolStaking = useMemo(() => type === 'pool', [type]);
Expand All @@ -123,7 +124,7 @@ function PositionItem ({ balance, claimPermissions, decimal, genesisHash, isSele

return (
<Motion variant='zoom'>
<Container disableGutters onClick={onClick} sx={{ alignItems: 'center', bgcolor: isSelected ? '#2D1E4A' : '#05091C', borderRadius: '14px', cursor: 'pointer', display: 'flex', flexDirection: 'row', justifyContent: 'space-between', p: '4px', pl: '18px' }}>
<Container disableGutters onClick={onClick} sx={{ alignItems: 'center', bgcolor: isSelected ? '#2D1E4A' : '#05091C', borderRadius: '14px', cursor: 'pointer', display: 'flex', flexDirection: 'row', justifyContent: 'space-between', p: totalPositions > 1 ? '4px' : '4px 30px 4px 4px', pl: '18px' }}>
<TokenInfo genesisHash={genesisHash} />
<Stack columnGap='5px' direction='row'>
<StakingBadge hasPoolStaking={hasPoolStaking} isFullscreen />
Expand All @@ -138,7 +139,9 @@ function PositionItem ({ balance, claimPermissions, decimal, genesisHash, isSele
<TestnetBadge style={{ mt: 0, visibility: isTestNet ? 'visible' : 'hidden' }} />
<ChainIdentifier genesisHash={genesisHash} />
<Staked balance={balance} decimal={decimal} price={price} token={token} />
<ArrowButton onClick={noop} />
{totalPositions > 1 &&
<ArrowButton onClick={noop} />
}
</Container>
</Motion>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ interface PositionOptionsProps {

const PositionOptions = ({ isSelected, positionItems, pricesInCurrency, state }: PositionOptionsProps) => {
const { t } = useTranslation();
const totalPositions = positionItems?.length ?? 0;

return (
<>
Expand All @@ -52,6 +53,7 @@ const PositionOptions = ({ isSelected, positionItems, pricesInCurrency, state }:
price={price}
token={token}
type='pool'
totalPositions={totalPositions}
/>}
{soloTotal && !soloTotal?.isZero() && ['both', 'solo'].includes(state.stakingType) &&
<PositionItem
Expand All @@ -63,6 +65,7 @@ const PositionOptions = ({ isSelected, positionItems, pricesInCurrency, state }:
price={price}
token={token}
type='solo'
totalPositions={totalPositions}
/>}
</Fragment>
);
Expand Down
Loading