Skip to content

Commit

Permalink
chore: update trading rewards faq (#622)
Browse files Browse the repository at this point in the history
  • Loading branch information
moo-onthelawn authored Jun 3, 2024
1 parent 89c9ef7 commit 9b106a6
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 18 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@cosmjs/tendermint-rpc": "^0.32.1",
"@dydxprotocol/v4-abacus": "1.7.43",
"@dydxprotocol/v4-client-js": "^1.1.15",
"@dydxprotocol/v4-localization": "^1.1.100",
"@dydxprotocol/v4-localization": "^1.1.105",
"@ethersproject/providers": "^5.7.2",
"@js-joda/core": "^5.5.3",
"@privy-io/react-auth": "^1.59.7",
Expand Down
9 changes: 5 additions & 4 deletions pnpm-lock.yaml

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

4 changes: 2 additions & 2 deletions public/configs/v1/env.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet",
"withdrawalGateLearnMore": "https://help.dydx.exchange/en/articles/8981384-withdrawals-on-dydx-chain#h_23e97bc665",
"launchIncentive": "https://cloud.chaoslabs.co",
"tradingRewardsLearnMore": "https://docs.dydx.exchange/rewards/trading_rewards",
"tradingRewardsLearnMore": "https://docs.dydx.exchange/concepts-trading/rewards_fees_and_parameters",
"exchangeStats": "https://app.mode.com/dydx_eng/reports/58822121650d?secret_key=391d9214fe6aefec35b7d35c",
"initialMarginFractionLearnMore": "https://docs.dydx.exchange/governance/functionalities#liquidity-tiers",
"complianceSupportEmail": "[email protected]",
Expand Down Expand Up @@ -102,7 +102,7 @@
"walletLearnMore": "https://www.dydx.academy/video/defi-wallet",
"withdrawalGateLearnMore": "https://help.dydx.exchange/en/articles/8981384-withdrawals-on-dydx-chain#h_23e97bc665",
"launchIncentive": "https://cloud.chaoslabs.co",
"tradingRewardsLearnMore": "https://docs.dydx.exchange/rewards/trading_rewards",
"tradingRewardsLearnMore": "https://docs.dydx.exchange/concepts-trading/rewards_fees_and_parameters",
"exchangeStats": "https://app.mode.com/dydx_eng/reports/58822121650d?secret_key=391d9214fe6aefec35b7d35c",
"initialMarginFractionLearnMore": "https://docs.dydx.exchange/governance/functionalities#liquidity-tiers",
"complianceSupportEmail": "[email protected]",
Expand Down
12 changes: 6 additions & 6 deletions src/constants/tooltips/trade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,13 @@ export const tradeTooltips: TooltipStrings = {
body: stringGetter({ key: TOOLTIP_STRING_KEYS.REDUCE_ONLY_BODY }),
learnMoreLink: urlConfigs?.reduceOnlyLearnMore,
}),
'reduce-only-execution-ioc-fok': ({ stringGetter }) => ({
title: stringGetter({ key: TOOLTIP_STRING_KEYS.REDUCE_ONLY_EXECUTION_IOC_FOK_TITLE }),
body: stringGetter({ key: TOOLTIP_STRING_KEYS.REDUCE_ONLY_EXECUTION_IOC_FOK_BODY }),
'reduce-only-execution-ioc': ({ stringGetter }) => ({
title: stringGetter({ key: TOOLTIP_STRING_KEYS.REDUCE_ONLY_EXECUTION_IOC_TITLE }),
body: stringGetter({ key: TOOLTIP_STRING_KEYS.REDUCE_ONLY_EXECUTION_IOC_BODY }),
}),
'reduce-only-timeinforce-ioc-fok': ({ stringGetter }) => ({
title: stringGetter({ key: TOOLTIP_STRING_KEYS.REDUCE_ONLY_TIMEINFORCE_IOC_FOK_TITLE }),
body: stringGetter({ key: TOOLTIP_STRING_KEYS.REDUCE_ONLY_TIMEINFORCE_IOC_FOK_BODY }),
'reduce-only-timeinforce-ioc': ({ stringGetter }) => ({
title: stringGetter({ key: TOOLTIP_STRING_KEYS.REDUCE_ONLY_TIMEINFORCE_IOC_TITLE }),
body: stringGetter({ key: TOOLTIP_STRING_KEYS.REDUCE_ONLY_TIMEINFORCE_IOC_BODY }),
}),
'reference-price': ({ stringGetter }) => ({
title: stringGetter({ key: TOOLTIP_STRING_KEYS.REFERENCE_PRICE_TITLE }),
Expand Down
46 changes: 43 additions & 3 deletions src/pages/token/rewards/RewardsHelpPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@ import { Accordion } from '@/components/Accordion';
import { Link } from '@/components/Link';
import { Panel } from '@/components/Panel';

import { isTruthy } from '@/lib/isTruthy';
import { testFlags } from '@/lib/testFlags';

export const RewardsHelpPanel = () => {
const stringGetter = useStringGetter();
const { tradingRewardsLearnMore } = useURLConfigs();

const tradingRewardsRehaulEnabled = testFlags.tradingRewardsRehaul;

return (
<$HelpCard
slotHeader={
Expand All @@ -37,13 +42,43 @@ export const RewardsHelpPanel = () => {
},
{
header: stringGetter({ key: STRING_KEYS.FAQ_HOW_DO_TRADING_REWARDS_WORK_QUESTION }),
content: stringGetter({ key: STRING_KEYS.FAQ_HOW_DO_TRADING_REWARDS_WORK_ANSWER }),
},
content: stringGetter({
key: STRING_KEYS.FAQ_HOW_DO_TRADING_REWARDS_WORK_ANSWER,
params: {
HERE_LINK: (
<$Link href={tradingRewardsLearnMore}>
{stringGetter({ key: STRING_KEYS.HERE })}
</$Link>
),
},
}),
}, // xcxc edit
{
header: stringGetter({ key: STRING_KEYS.FAQ_HOW_DO_I_CLAIM_MY_REWARDS_QUESTION }),
content: stringGetter({ key: STRING_KEYS.FAQ_HOW_DO_I_CLAIM_MY_REWARDS_ANSWER }),
},
]}
tradingRewardsRehaulEnabled && {
header: stringGetter({ key: STRING_KEYS.FAQ_WHAT_IS_STAKING_QUESTION }),
content: stringGetter({
key: STRING_KEYS.FAQ_WHAT_IS_STAKING_ANSWER,
params: {
HERE_LINK: (
<$Link href="https://protocolstaking.info/">
{stringGetter({ key: STRING_KEYS.HERE })}
</$Link>
),
},
}),
},
tradingRewardsRehaulEnabled && {
header: stringGetter({ key: STRING_KEYS.FAQ_HOW_DO_I_STAKE_AND_CLAIM_QUESTION }),
content: stringGetter({ key: STRING_KEYS.FAQ_HOW_DO_I_STAKE_AND_CLAIM_ANSWER }),
},
tradingRewardsRehaulEnabled && {
header: stringGetter({ key: STRING_KEYS.FAQ_WHAT_ARE_THE_RISKS_OF_STAKING_QUESTION }),
content: stringGetter({ key: STRING_KEYS.FAQ_WHAT_ARE_THE_RISKS_OF_STAKING_ANSWER }),
},
].filter(isTruthy)}
/>
</$HelpCard>
);
Expand Down Expand Up @@ -77,3 +112,8 @@ const $Header = styled.div`
color: var(--color-text-2);
}
`;

const $Link = styled(Link)`
--link-color: var(--color-accent);
display: inline-block;
`;
4 changes: 2 additions & 2 deletions src/views/forms/TradeForm/AdvancedTradeOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ export const AdvancedTradeOptions = () => {
: reduceOnlyTooltip?.titleStringKey.includes(
'REDUCE_ONLY_EXECUTION_IOC_FOK'
)
? 'reduce-only-execution-ioc-fok'
: 'reduce-only-timeinforce-ioc-fok'
? 'reduce-only-execution-ioc'
: 'reduce-only-timeinforce-ioc'
}
side="right"
>
Expand Down

0 comments on commit 9b106a6

Please sign in to comment.