Skip to content

Commit

Permalink
Merge pull request #26 from lum-network/improvement/lum-803
Browse files Browse the repository at this point in the history
[LUM-803] Remove confusing poolId
  • Loading branch information
ThibaultJRD committed Aug 17, 2023
2 parents 16b254a + 8e50a4c commit cf55775
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 20 deletions.
1 change: 1 addition & 0 deletions src/constant/firebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const ANALYTICS_EVENTS = {
TRANSFER_OUT_CLICK: 'transfer_out_click',
TRANSFER_OUT_CONFIRMED: 'transfer_out_confirmed',
DEPOSIT_CLICK: 'deposit_click',
VIEW_DETAILS_CLICK: 'view_details_click',
QUIT_DEPOSIT_FLOW_MODAL_OPEN: 'quit_deposit_flow_modal_open',
QUIT_DEPOSIT_FLOW_MODAL_CONFIRMED: 'quit_deposit_flow_modal_confirmed',
QUIT_DEPOSIT_FLOW_MODAL_CANCELLED: 'quit_deposit_flow_modal_cancelled',
Expand Down
5 changes: 3 additions & 2 deletions src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,9 @@ export default {
tvl: 'TVL:',
apy: 'Estimated APR:',
cta: 'Deposit in Pool',
viewDetails: 'Chance to win',
drawEndAt: 'Next draw in:',
poolId: 'Pool #{{ poolId }}',
poolId: 'Pool',
},
poolDetails: {
myDeposits: 'My {{ denom }} deposits',
Expand Down Expand Up @@ -314,7 +315,7 @@ export default {
noDraws: 'No draws yet',
noDrawsDescription: 'Draws will be available as soon as the first prize is won',
noDrawsCta: 'Deposit in Pool',
tableHeaders: ['Pool ID', 'Draw ID', 'Date', 'Prizes', 'Prize Value'],
tableHeaders: ['Draw ID', 'Date', 'Prizes', 'Prize Value'],
},
drawDetails: {
winnersBtn: 'Winners',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const DepositTable = ({ deposits, pools, prices, onLeavePool, onDepositRetry, on
)}
</h3>
<p className='mb-0'>
{numeral(usdPrice).format('$0,0[.]00')} - {I18n.t('pools.poolId', { poolId: deposit.poolId?.toString() || '' })} -{' '}
{numeral(usdPrice).format('$0,0[.]00')} - {DenomsUtils.getNormalDenom(deposit.amount?.denom || '').toUpperCase()} {I18n.t('pools.poolId')} -{' '}
{I18n.t('deposit.depositId', { depositId: deposit.depositId?.toString() || '' })}
</p>
</div>
Expand Down
5 changes: 1 addition & 4 deletions src/pages/PoolDetails/PoolDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const PoolDetails = () => {
}
};

getLeaderboard();
getLeaderboard().finally(() => null);
}, [lumWallet]);

useEffect(() => {
Expand Down Expand Up @@ -585,9 +585,6 @@ const PoolDetails = () => {
}}
className='scale-hover'
>
<td data-label={drawHistoryHeaders[0]}>
<div className='d-flex align-items-center justify-content-center me-0 me-md-3 ms-auto ms-md-0 index-container'>#{draw.poolId.toString()}</div>
</td>
<td data-label={drawHistoryHeaders[1]}>
<div className='d-flex align-items-center justify-content-center me-0 me-md-3 ms-auto ms-md-0 index-container'>#{draw.drawId.toString()}</div>
</td>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Pools/Pools.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
display: flex;
flex-direction: column;
align-items: stretch;
height: 400px;
height: 440px;
justify-content: space-between;

@include media-breakpoint-up(xl) {
height: 440px;
height: 470px;
}

.name-container {
Expand Down
19 changes: 9 additions & 10 deletions src/pages/Pools/components/PoolCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { useSelector } from 'react-redux';
import numeral from 'numeral';

Expand All @@ -24,19 +23,12 @@ const PoolCard = ({ denom, tvl, poolId, estimatedPrize, drawEndAt, apy }: IProps
const loadingAdditionalInfo = useSelector((state: RootState) => state.loading.effects.pools.getPoolsAdditionalInfo);
const lumWallet = useSelector((state: RootState) => state.wallet.lumWallet);

const navigate = useNavigate();

const [drawInProgress, setDrawInProgress] = useState(false);

const price = prices?.[denom];

return (
<Card
className='pool-card-container glow-bg'
onClick={() => {
navigate(`${NavigationConstants.POOL_DETAILS}/${denom}/${poolId}`);
}}
>
<Card className='pool-card-container glow-bg'>
<div className='prize-container'>
<img width={68} height={68} src={DenomsUtils.getIconFromDenom(denom)} alt={denom} />
<div className='d-flex flex-column align-items-start ms-3'>
Expand Down Expand Up @@ -83,6 +75,13 @@ const PoolCard = ({ denom, tvl, poolId, estimatedPrize, drawEndAt, apy }: IProps
</div>
</div>
<div className='w-100'>
<Button
onClick={() => Firebase.logEvent(FirebaseConstants.ANALYTICS_EVENTS.VIEW_DETAILS_CLICK, { denom, pool_id: poolId })}
to={`${NavigationConstants.POOL_DETAILS}/${denom}/${poolId}`}
outline
>
{I18n.t('pools.viewDetails')}
</Button>
<Button
{...(!KeplrUtils.isKeplrInstalled()
? {
Expand All @@ -97,7 +96,7 @@ const PoolCard = ({ denom, tvl, poolId, estimatedPrize, drawEndAt, apy }: IProps
: {
to: `${NavigationConstants.POOLS}/${denom}/${poolId}`,
})}
className='deposit-cta w-100'
className='deposit-cta w-100 mt-3'
onClick={() => Firebase.logEvent(FirebaseConstants.ANALYTICS_EVENTS.DEPOSIT_CLICK, { denom, pool_id: poolId })}
>
{I18n.t('pools.cta')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const LatestWinnersTable = ({ prizes, metadata, visibleItem, onPageChange, onIte
</span>
{StringsUtils.trunc(prize.winnerAddress)}
<span className='prize-infos ms-3'>
${DenomsUtils.getNormalDenom(prize.amount.denom).toUpperCase()} {I18n.t('pools.poolId', { poolId: prize.poolId }).toUpperCase()} -{' '}
${DenomsUtils.getNormalDenom(prize.amount.denom).toUpperCase()} {I18n.t('pools.poolId').toUpperCase()} -{' '}
{I18n.t('mySavings.claimModal.drawId', { drawId: prize.drawId }).toUpperCase()}
</span>
<span className='date ms-3'>{dayjs(prize.createdAt).format('D MMM YYYY')}</span>
Expand Down

0 comments on commit cf55775

Please sign in to comment.