Skip to content

Commit

Permalink
change all labels from stake to yield, earn
Browse files Browse the repository at this point in the history
  • Loading branch information
adammino-ledger committed Nov 18, 2024
1 parent d21ffa5 commit d05c95f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import TopGradient from "./TopGradient";
import Hide from "./Hide";
import { track } from "~/renderer/analytics/segment";
import { useAccountPath } from "@ledgerhq/live-common/hooks/recoverFeatureFlag";
import { useGetStakeLabelLocaleBased } from "~/renderer/hooks/useGetStakeLabelLocaleBased";

type Location = Parameters<Exclude<PromptProps["message"], string>>[0];

Expand Down Expand Up @@ -238,6 +239,7 @@ const MainSideBar = () => {
const location = useLocation();
const dispatch = useDispatch();
const { t } = useTranslation();
const earnLabel = useGetStakeLabelLocaleBased();
const manifest = useRemoteLiveAppManifest(BAANX_APP_ID);
const isCardDisabled = !manifest;

Expand Down Expand Up @@ -456,7 +458,7 @@ const MainSideBar = () => {
/>
<SideBarListItem
id={"earn"}
label={t("sidebar.earn")}
label={earnLabel}
icon={IconsLegacy.LendMedium}
iconSize={20}
iconActiveColor="wallet"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useHistory } from "react-router-dom";
import useStakeFlow from "~/renderer/screens/stake";
import { useFeature } from "@ledgerhq/live-common/featureFlags/index";
import { track } from "~/renderer/analytics/segment";
import { useGetStakeLabelLocaleBased } from "~/renderer/hooks/useGetStakeLabelLocaleBased";

const ButtonGrid = styled(Grid).attrs(() => ({
columns: 3,
Expand All @@ -19,7 +20,7 @@ const ButtonGrid = styled(Grid).attrs(() => ({
const FeaturedButtons = () => {
const history = useHistory();
const { t } = useTranslation();

const stakeLabel = useGetStakeLabelLocaleBased();
const bannerFeatureFlag = useFeature("portfolioExchangeBanner");
const stakeProgramsFeatureFlag = useFeature("stakePrograms");

Expand Down Expand Up @@ -67,7 +68,7 @@ const FeaturedButtons = () => {
<EntryButton
Icon={() => <IconsLegacy.LendMedium size={18} />}
disabled={stakeDisabled}
title={t("dashboard.featuredButtons.earn.title")}
title={stakeLabel}
body={t("dashboard.featuredButtons.earn.description")}
onClick={handleClickStake}
entryButtonTestId="stake-entry-button"
Expand Down
2 changes: 1 addition & 1 deletion apps/ledger-live-desktop/static/i18n/en/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -1486,7 +1486,7 @@
},
"earn": {
"title": "Stake",
"description": "Stake your crypto with Ledger"
"description": "Get rewards on your crypto"
}
},
"recoverBanner": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { PTX_SERVICES_TOAST_ID } from "~/utils/constants";
import { useQuickAccessURI } from "@ledgerhq/live-common/hooks/recoverFeatureFlag";
import { EntryOf } from "~/types/helpers";
import { BaseNavigatorStackParamList } from "../RootNavigator/types/BaseNavigator";
import { getStakeLabelLocaleBased } from "~/helpers/getStakeLabelLocaleBased";

type ButtonItem = {
title: string;
Expand All @@ -42,6 +43,7 @@ export default function TransferDrawer({ onClose }: Omit<ModalProps, "isRequesti
const {
quickActionsList: { SEND, RECEIVE, BUY, SELL, SWAP, STAKE, RECOVER },
} = useQuickActions();
const stakeLabel = getStakeLabelLocaleBased();
const { t } = useTranslation();
const { pushToast, dismissToast } = useToasts();

Expand Down Expand Up @@ -158,7 +160,7 @@ export default function TransferDrawer({ onClose }: Omit<ModalProps, "isRequesti
page,
drawer: "stake",
},
title: t("transfer.stake.title"),
title: t(stakeLabel),
description: t("transfer.stake.description"),
Icon: STAKE.icon,
onPress: () => onNavigate(STAKE.route),
Expand Down
2 changes: 1 addition & 1 deletion apps/ledger-live-mobile/src/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -3271,7 +3271,7 @@
},
"stake": {
"title": "Stake",
"description": "Stake your crypto holdings."
"description": "Get rewards on your crypto."
},
"swap": {
"title": "Swap",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { track } from "~/analytics";
import { useRoute } from "@react-navigation/native";
import { BaseNavigatorStackParamList } from "~/components/RootNavigator/types/BaseNavigator";
import { EntryOf } from "~/types/helpers";
import { getStakeLabelLocaleBased } from "~/helpers/getStakeLabelLocaleBased";

const SHARED_CONFIG = {
variant: "small" as const,
Expand All @@ -17,6 +18,7 @@ const SHARED_CONFIG = {
function PortfolioQuickActionsBar() {
const navigation = useNavigation<StackNavigationProp<BaseNavigatorStackParamList>>();
const router = useRoute();
const stakeLabel = getStakeLabelLocaleBased();
const { t } = useTranslation();
const {
quickActionsList: { SEND, RECEIVE, BUY, SWAP, STAKE },
Expand Down Expand Up @@ -62,7 +64,7 @@ function PortfolioQuickActionsBar() {
STAKE && {
...SHARED_CONFIG,
Icon: STAKE.icon,
children: t("portfolio.quickActions.stake"),
children: t(stakeLabel),
onPress: () => onNavigate(STAKE.route, "quick_action_stake"),
disabled: STAKE.disabled,
},
Expand Down

0 comments on commit d05c95f

Please sign in to comment.