Skip to content

Commit

Permalink
fix: input
Browse files Browse the repository at this point in the history
  • Loading branch information
beyond009 committed May 8, 2024
2 parents a7205e5 + 1622411 commit bdc4268
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 15 deletions.
3 changes: 2 additions & 1 deletion src/components/StakeModal/StakeTokenInput/InputPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ export function InputPanel({ amount, setAmount, balance }: InputPanelProps) {
</div>
<InputBase
placeholder="0"
type='number'
className="w-full !text-[40px] !font-bold !text-neutrals2"
onChange={(e) => setAmount(e.target.value)}
onChange={(e) => { setAmount(e.target.value) }}
value={amount}
/>
<div className="flex flex-col items-end gap-[18px]">
Expand Down
2 changes: 1 addition & 1 deletion src/components/StakeModal/StakeTokenInput/Stake.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function Stake() {
const { data: balance } = useQuery({
queryKey: ['balance', address],
queryFn: async () => {
if (!address) return '0';
if (!address) return;
const res = await readContract({
...MASK_TOKEN_CONTRACT,
functionName: 'balanceOf',
Expand Down
30 changes: 21 additions & 9 deletions src/components/StakeRanking/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"use client"
'use client';

import { useQuery } from '@tanstack/react-query';

Expand Down Expand Up @@ -41,21 +41,33 @@ export function StakeRanking() {
/>
<div className="z-10 text-[24px] font-bold text-neutrals2">Staking Ranking</div>
<div className="z-10 mt-[64px] flex w-full items-center justify-center">
<<<<<<< HEAD
{rankingList?.length ? <TopStaker
avatar={rankingList[0]?.twitter_image || '/maskAvatar.svg'}
name={rankingList[0]?.twitter_display_name || formatAddress(rankingList[0].address)}
amount={Number(rankingList[0]?.stake_amount) || 0}
/> : null}
=======
{rankingList?.length && (
<TopStaker
avatar={rankingList[0]?.twitter_image || '/maskAvatar.svg'}
name={rankingList[0]?.twitter_display_name || formatAddress(rankingList[0].address)}
amount={Number(rankingList[0]?.stake_amount) || 0}
/>
)}
>>>>>>> 1622411913cfa06855ddd3de6f4f4250bf5aa55a
</div>
<div className="mt-[28px] grid grid-cols-[repeat(auto-fill,minmax(90px,1fr))] gap-[28px]">
{rankingList?.slice(1).map((item, index) => (
<Staker
key={index + 1}
avatar={item.twitter_image || '/maskAvatar.svg'}
name={item.twitter_display_name || formatAddress(item.address)}
amount={Number(item.stake_amount) || 0}
/>
))}
{rankingList
?.slice(1)
.map((item, index) => (
<Staker
key={index + 1}
avatar={item.twitter_image || '/maskAvatar.svg'}
name={item.twitter_display_name || formatAddress(item.address)}
amount={Number(item.stake_amount) || 0}
/>
))}
</div>
</div>
);
Expand Down
8 changes: 4 additions & 4 deletions src/providers/StakeAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ type RankingItem = {
twitter_username: string;
};

interface RankingListResponse{
interface RankingListResponse {
code: number;
data: {
list: RankingItem[]
page:{cursor: string}
}
list: RankingItem[];
page: { cursor: string };
};
message: string;
reason: string;
}
Expand Down

0 comments on commit bdc4268

Please sign in to comment.