Skip to content

Commit

Permalink
chore: update vault page (#1361)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredvu authored Dec 11, 2024
1 parent 9af3aa8 commit bb0f73e
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 29 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@datadog/browser-logs": "^5.23.3",
"@dydxprotocol/v4-abacus": "1.13.39",
"@dydxprotocol/v4-client-js": "1.12.2",
"@dydxprotocol/v4-localization": "^1.1.254",
"@dydxprotocol/v4-localization": "^1.1.256",
"@dydxprotocol/v4-proto": "^7.0.0-dev.0",
"@funkit/connect": "^4.0.2",
"@emotion/is-prop-valid": "^1.3.0",
Expand Down
22 changes: 11 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/constants/tooltips/vault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export const vaultTooltips = {
'vault-all-time-pnl': ({ stringGetter }) => ({
body: stringGetter({ key: TOOLTIP_STRING_KEYS.YOUR_ALL_TIME_PNL_BODY }),
}),
'vault-apr': ({ stringGetter }) => ({
'vault-apr': ({ stringGetter, urlConfigs }) => ({
body: stringGetter({ key: TOOLTIP_STRING_KEYS.VAULT_APR_BODY }),
learnMoreLink: urlConfigs?.vaultLearnMore,
}),
} satisfies TooltipStrings;
2 changes: 1 addition & 1 deletion src/pages/portfolio/Portfolio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const PortfolioPage = () => {
<VaultTransactionsTable
withOuterBorders
withTxHashLink
emptyString={stringGetter({ key: STRING_KEYS.YOU_HAVE_NO_VAULT_DEPOSITS })}
emptyString={stringGetter({ key: STRING_KEYS.YOU_HAVE_NO_VAULT_BALANCE })}
/>
}
/>
Expand Down
18 changes: 9 additions & 9 deletions src/pages/vaults/VaultDepositWithdrawForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -449,10 +449,10 @@ export const VaultDepositWithdrawForm = ({
const inputFormConfig =
operation === 'DEPOSIT'
? {
formLabel: stringGetter({ key: STRING_KEYS.AMOUNT_TO_DEPOSIT }),
formLabel: stringGetter({ key: STRING_KEYS.AMOUNT_TO_ADD }),
buttonLabel: confirmationStep
? stringGetter({ key: STRING_KEYS.CONFIRM_DEPOSIT })
: stringGetter({ key: STRING_KEYS.PREVIEW_DEPOSIT }),
? stringGetter({ key: STRING_KEYS.CONFIRM })
: stringGetter({ key: STRING_KEYS.REVIEW }),
inputReceiptItems: [
{
key: 'cross-free-collateral',
Expand Down Expand Up @@ -481,15 +481,15 @@ export const VaultDepositWithdrawForm = ({
},
}
: {
formLabel: stringGetter({ key: STRING_KEYS.AMOUNT_TO_WITHDRAW }),
formLabel: stringGetter({ key: STRING_KEYS.AMOUNT_TO_REMOVE }),
buttonLabel: confirmationStep
? stringGetter({ key: STRING_KEYS.CONFIRM_WITHDRAW })
: stringGetter({ key: STRING_KEYS.PREVIEW_WITHDRAW }),
? stringGetter({ key: STRING_KEYS.CONFIRM })
: stringGetter({ key: STRING_KEYS.REVIEW }),
inputReceiptItems: [
{
key: 'vault-balance',
tooltip: 'vault-available-to-withdraw',
label: stringGetter({ key: STRING_KEYS.AVAILABLE_TO_WITHDRAW }),
label: stringGetter({ key: STRING_KEYS.AVAILABLE_TO_REMOVE }),
value: availableToWithdrawDiff,
},
] satisfies DetailsItem[],
Expand Down Expand Up @@ -568,7 +568,7 @@ export const VaultDepositWithdrawForm = ({
$active={operation === 'DEPOSIT'}
onClick={() => setOperation('DEPOSIT')}
>
{stringGetter({ key: STRING_KEYS.DEPOSIT })}
{stringGetter({ key: STRING_KEYS.ADD_FUNDS })}
</$TypeButton>
<$TypeButton
shape={ButtonShape.Rectangle}
Expand All @@ -577,7 +577,7 @@ export const VaultDepositWithdrawForm = ({
$active={operation === 'WITHDRAW'}
onClick={() => setOperation('WITHDRAW')}
>
{stringGetter({ key: STRING_KEYS.WITHDRAW })}
{stringGetter({ key: STRING_KEYS.REMOVE_FUNDS })}
</$TypeButton>
</div>

Expand Down
2 changes: 1 addition & 1 deletion src/pages/vaults/VaultLockedSharesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const VaultLockedSharesCard = ({ className }: { className?: string }) =>
<div className={className} tw="rounded-[0.7rem] border border-solid border-color-border">
<div tw="flex justify-between px-1 py-0.625">
<div tw="flex gap-0.5">
<h3 tw="pt-[5px]">Locked Balance</h3>
<h3 tw="pt-[5px]">{stringGetter({ key: STRING_KEYS.LOCKED_BALANCE })}</h3>
<span tw="text-color-text-0">
<Output value={lockedSharesTotalValue} type={OutputType.CompactFiat} />
</span>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/vaults/VaultPnlChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export const VaultPnlChart = ({ className }: VaultPnlChartProps) => {
size={ButtonSize.Small}
items={[
{ value: 'pnl', label: stringGetter({ key: STRING_KEYS.VAULT_PNL }) },
{ value: 'equity', label: stringGetter({ key: STRING_KEYS.VAULT_EQUITY }) },
{ value: 'equity', label: stringGetter({ key: STRING_KEYS.VAULT_TVL }) },
]}
value={selectedChart}
onValueChange={setSelectedChart}
Expand Down
10 changes: 6 additions & 4 deletions src/pages/vaults/VaultTransactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const VaultTransactionsCard = ({ className }: { className?: string }) =>
<>
<div tw="flex justify-between px-1 py-0.625">
<h3 tw="leading-7">
{stringGetter({ key: STRING_KEYS.YOUR_DEPOSITS_AND_WITHDRAWALS })}
{stringGetter({ key: STRING_KEYS.YOUR_MEGAVAULT_HISTORY })}
<span tw="ml-0.5 text-color-text-0">{transactions.length}</span>
</h3>
<$ShowHideHistoryButton
Expand All @@ -53,13 +53,15 @@ export const VaultTransactionsCard = ({ className }: { className?: string }) =>
<div>
<Icon iconName={IconName.OrderPending} size="2rem" tw="mb-0.75" />
</div>
<div>{stringGetter({ key: STRING_KEYS.YOU_HAVE_NO_VAULT_DEPOSITS })}</div>
<div>{stringGetter({ key: STRING_KEYS.YOU_HAVE_NO_VAULT_BALANCE })}</div>
</div>
)}
</div>
);
};

const $ShowHideHistoryButton = styled(Button)``;

export const VaultTransactionsTable = ({
className,
withOuterBorders,
Expand Down Expand Up @@ -105,9 +107,9 @@ export const VaultTransactionsTable = ({
<Output
value={
type?.name === 'DEPOSIT'
? stringGetter({ key: STRING_KEYS.DEPOSIT })
? stringGetter({ key: STRING_KEYS.ADD_FUNDS })
: type?.name === 'WITHDRAWAL'
? stringGetter({ key: STRING_KEYS.WITHDRAW })
? stringGetter({ key: STRING_KEYS.REMOVE_FUNDS })
: undefined
}
type={OutputType.Text}
Expand Down

0 comments on commit bb0f73e

Please sign in to comment.