Skip to content

Commit

Permalink
feat: resolve forceBalanceDisplay warning (#1036)
Browse files Browse the repository at this point in the history
  • Loading branch information
euharrison authored Aug 22, 2024
1 parent 0e89f5d commit 7a0df00
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 32 deletions.
2 changes: 1 addition & 1 deletion apps/namadillo/src/App/Common/NamCurrency.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Currency, CurrencyProps } from "@namada/components";
type NamCurrencyProps = Omit<
CurrencyProps,
"currency" | "currencyPosition" | "spaceAroundSign"
> & { forceBalanceDisplay?: boolean };
>;

export const NamCurrency = ({ ...props }: NamCurrencyProps): JSX.Element => {
return (
Expand Down
6 changes: 1 addition & 5 deletions apps/namadillo/src/App/Common/TransactionFees.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ export const TransactionFees = ({
return (
<div className={clsx("text-white text-sm", className)}>
<TextLink>Transaction fee:</TextLink>{" "}
<NamCurrency
className="font-medium"
amount={minimumGas}
forceBalanceDisplay={true}
/>
<NamCurrency className="font-medium" amount={minimumGas} />
</div>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ const Loaded: React.FC<{
};

const formattedAmount = (voteType: VoteType): React.ReactNode => (
<NamCurrency amount={props[voteType]} forceBalanceDisplay />
<NamCurrency amount={props[voteType]} />
);

const amounts = {
Expand Down
8 changes: 3 additions & 5 deletions apps/namadillo/src/App/Governance/VoteInfoCards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ const PgfPaymentInfoCards: React.FC<{
content={pgfActions.continuous.add.map(
({ internal: { amount, target } }) => (
<span key={`info-card-continuous-add-${target}`}>
{target}{" "}
<NamCurrency amount={amount} forceBalanceDisplay={true} />
{target} <NamCurrency amount={amount} />
</span>
)
)}
Expand All @@ -67,8 +66,7 @@ const PgfPaymentInfoCards: React.FC<{
content={pgfActions.continuous.remove.map(
({ internal: { amount, target } }) => (
<span key={`info-card-continuous-remove-${target}`}>
{target}{" "}
<NamCurrency amount={amount} forceBalanceDisplay={true} />
{target} <NamCurrency amount={amount} />
</span>
)
)}
Expand All @@ -78,7 +76,7 @@ const PgfPaymentInfoCards: React.FC<{
className="col-span-full"
content={pgfActions.retro.map(({ internal: { amount, target } }) => (
<span key={`info-card-retro-${target}`}>
{target} <NamCurrency amount={amount} forceBalanceDisplay={true} />
{target} <NamCurrency amount={amount} />
</span>
))}
/>
Expand Down
5 changes: 1 addition & 4 deletions apps/namadillo/src/App/Staking/AllValidatorsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ export const AllValidatorsTable = ({
key={`validator-voting-power-${validator.address}`}
>
{validator.votingPowerInNAM && (
<NamCurrency
amount={validator.votingPowerInNAM}
forceBalanceDisplay
/>
<NamCurrency amount={validator.votingPowerInNAM} />
)}
<span className="text-neutral-600 text-sm">
{formatPercentage(BigNumber(validator.votingPowerPercentage || 0))}
Expand Down
5 changes: 1 addition & 4 deletions apps/namadillo/src/App/Staking/IncrementBondingTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,7 @@ export const IncrementBondingTable = ({
key={`validator-voting-power-${validator.address}`}
>
{validator.votingPowerInNAM && (
<NamCurrency
amount={validator.votingPowerInNAM}
forceBalanceDisplay
/>
<NamCurrency amount={validator.votingPowerInNAM} />
)}
<span className="text-neutral-600 text-sm">
{formatPercentage(BigNumber(validator.votingPowerPercentage || 0))}
Expand Down
5 changes: 1 addition & 4 deletions apps/namadillo/src/App/Staking/MyValidatorsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,7 @@ export const MyValidatorsTable = (): JSX.Element => {
key={`my-validator-voting-power-${validator.address}`}
>
{validator.votingPowerInNAM && (
<NamCurrency
amount={validator.votingPowerInNAM}
forceBalanceDisplay
/>
<NamCurrency amount={validator.votingPowerInNAM} />
)}
<span className="text-neutral-600 text-sm">
{formatPercentage(BigNumber(validator.votingPowerPercentage || 0))}
Expand Down
5 changes: 1 addition & 4 deletions apps/namadillo/src/App/Staking/ReDelegateTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,7 @@ export const ReDelegateTable = ({
key={`validator-voting-power-${validator.address}`}
>
{validator.votingPowerInNAM && (
<NamCurrency
amount={validator.votingPowerInNAM}
forceBalanceDisplay
/>
<NamCurrency amount={validator.votingPowerInNAM} />
)}
<span className="text-neutral-600 text-sm">
{formatPercentage(BigNumber(validator.votingPowerPercentage || 0))}
Expand Down
5 changes: 1 addition & 4 deletions apps/namadillo/src/App/Staking/UnstakeBondingTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,7 @@ export const UnstakeBondingTable = ({
key={`validator-voting-power-${validator.address}`}
>
{validator.votingPowerInNAM && (
<NamCurrency
amount={validator.votingPowerInNAM}
forceBalanceDisplay
/>
<NamCurrency amount={validator.votingPowerInNAM} />
)}
<span className="text-neutral-600 text-sm">
{formatPercentage(BigNumber(validator.votingPowerPercentage || 0))}
Expand Down
1 change: 1 addition & 0 deletions packages/config/eslint/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module.exports = {
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
args: "all",
ignoreRestSiblings: true,
},
],
"max-len": [
Expand Down

0 comments on commit 7a0df00

Please sign in to comment.