Skip to content

Commit

Permalink
Change types in chain rewards, remove old css
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytrotkk committed Dec 6, 2024
1 parent d0abddd commit b75f2d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
12 changes: 0 additions & 12 deletions src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -453,18 +453,6 @@ body::-webkit-scrollbar {
box-shadow: none !important;
}

.btnerror {
background: #f4433621;
}

.btnwarning {
background: rgb(244 139 54 / 13%);
}

.btnprimary {
background: rgba(147, 184, 236, 0.16);
}

.btnDisabled {
background: #262626;
}
Expand Down
14 changes: 7 additions & 7 deletions src/components/delegation/ChainRewards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ const ChainRewards: React.FC<ChainRewardsProps> = ({
}) => {
const paymaster = initPaymaster(mpc)

const [rewardAmount, setRewardAmount] = useState<bigint | null>(null)
const [sklToken, setSklToken] = useState<Contract | null>(null)
const [tokenBalance, setTokenBalance] = useState<bigint | null>(null)
const [tokenUrl, setTokenUrl] = useState<string | null>(null)
const [rewardAmount, setRewardAmount] = useState<bigint | undefined>(undefined)
const [sklToken, setSklToken] = useState<Contract | undefined>(undefined)
const [tokenBalance, setTokenBalance] = useState<bigint | undefined>(undefined)
const [tokenUrl, setTokenUrl] = useState<string | undefined>(undefined)

const [btnText, setBtnText] = useState<string | undefined>()
const [errorMsg, setErrorMsg] = useState<string | undefined>()
Expand Down Expand Up @@ -118,7 +118,7 @@ const ChainRewards: React.FC<ChainRewardsProps> = ({
async function loadSkaleToken() {
const tokenAddress = await paymaster.skaleToken()
let skl = sklToken
if (skl === null) {
if (skl === undefined) {
skl = new Contract(tokenAddress, ERC_ABIS.erc20.abi, paymaster.runner)
setTokenUrl(getExplorerUrlForAddress(network, paymasterChain, tokenAddress))
setSklToken(skl)
Expand Down Expand Up @@ -179,7 +179,7 @@ const ChainRewards: React.FC<ChainRewardsProps> = ({
/>
<Tile
disabled={rewardAmount === 0n}
value={rewardAmount !== null && formatBalance(rewardAmount, 'SKL')}
value={rewardAmount !== undefined && formatBalance(rewardAmount, 'SKL')}
text="Rewards on Europa Hub"
icon={<EventAvailableRoundedIcon />}
grow
Expand All @@ -205,7 +205,7 @@ const ChainRewards: React.FC<ChainRewardsProps> = ({
size="md"
transparent
grow
value={tokenBalance !== null && formatBalance(tokenBalance, 'SKL')}
value={tokenBalance !== undefined && formatBalance(tokenBalance, 'SKL')}
ri={!isXs}
text="Balance on Europa Hub"
icon={<TokenIcon tokenSymbol="skl" size="xs" />}
Expand Down

0 comments on commit b75f2d7

Please sign in to comment.