Skip to content

Commit

Permalink
suggestions-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorginaShall committed Dec 30, 2024
1 parent eff9cbe commit f73e9d6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/components/stakingCalculator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const StakingCalculator: React.FC = () => {
const [zilToStake, setZilToStake] = useState<string>(formatUnits(stakingPoolForView?.stakingPool.definition.minimumStake || 0n, 18));

useEffect(() => {
setZilToStake("1");
onMinClick();
}, [stakingPoolForView]);

const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
Expand All @@ -48,7 +48,7 @@ const StakingCalculator: React.FC = () => {
};

const handleFocus = () => {
if (zilToStake === '') setZilToStake('1');
if (zilToStake === '') onMinClick();
};

const handleBlur = () => {
Expand All @@ -62,7 +62,7 @@ const StakingCalculator: React.FC = () => {
}
setZilToStake(valueTemp.replace(/0*(\d+)/, '$1'));

if (zilToStake === '') setZilToStake('0');
if (zilToStake === '') onMinClick();
};

const zilToStakeNumber = parseFloat(zilToStake);
Expand Down
4 changes: 2 additions & 2 deletions src/components/unstakingCalculator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const UnstakingCalculator: React.FC = () => {
};

const handleFocus = () => {
if (zilToUnstake === '') setZilToUnstake('1');
if (zilToUnstake === '') onMaxClick();
};

const handleBlur = () => {
Expand All @@ -44,7 +44,7 @@ const UnstakingCalculator: React.FC = () => {
valueTemp = zilToUnstake.slice(0, -1);
}
setZilToUnstake(valueTemp.replace(/0*(\d+)/, '$1'));
if (zilToUnstake === '') setZilToUnstake('1');
if (zilToUnstake === '') onMaxClick();
};

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ const HomePage = () => {
</>

)
})
}
</div></div>
)

Expand Down

0 comments on commit f73e9d6

Please sign in to comment.