Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:LedgerHQ/ledger-live into feat/s…
Browse files Browse the repository at this point in the history
…upport-app-install
  • Loading branch information
chrisduma-ledger committed Nov 25, 2024
2 parents 5d823c9 + 842b255 commit b6d0d62
Show file tree
Hide file tree
Showing 61 changed files with 744 additions and 366 deletions.
5 changes: 5 additions & 0 deletions .changeset/eighty-pants-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"live-mobile": minor
---

Update old reborn banner
5 changes: 5 additions & 0 deletions .changeset/loud-mangos-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ledgerhq/react-ui": minor
---

Add new portfolio content card component
6 changes: 6 additions & 0 deletions .changeset/new-ties-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"ledger-live-desktop": minor
"live-mobile": minor
---

change label stake for UK to Yield, to Earn for others
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
@@ -1,21 +1,22 @@
import { useCallback } from "react";
import { useDispatch } from "react-redux";
import { useTranslation } from "react-i18next";
import { openModal } from "~/renderer/actions/modals";
import IconCoins from "~/renderer/icons/Coins";
import { AlgorandFamily } from "./types";
import { useAccountUnit } from "~/renderer/hooks/useAccountUnit";
import { useGetStakeLabelLocaleBased } from "~/renderer/hooks/useGetStakeLabelLocaleBased";

const AccountHeaderActions: AlgorandFamily["accountHeaderManageActions"] = ({
account,
parentAccount,
}) => {
const { t } = useTranslation();
const dispatch = useDispatch();
const balance = account.balance;
const unit = useAccountUnit(account);
const minRewardsBalance = 10 ** unit.magnitude;

const label = useGetStakeLabelLocaleBased();

const onClick = useCallback(() => {
dispatch(openModal("MODAL_ALGORAND_EARN_REWARDS_INFO", { account }));
}, [dispatch, account]);
Expand All @@ -27,7 +28,7 @@ const AccountHeaderActions: AlgorandFamily["accountHeaderManageActions"] = ({
key: "algorand",
onClick: onClick,
icon: IconCoins,
label: t("account.stake"),
label,
event: "button_clicked2",
eventProperties: {
button: "stake",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { getMainAccount } from "@ledgerhq/live-common/account/index";

import { useTranslation } from "react-i18next";
import { useHistory } from "react-router";
import { track } from "~/renderer/analytics/segment";
import { stakeDefaultTrack } from "~/renderer/screens/stake/constants";
import { BitcoinAccount } from "@ledgerhq/coin-bitcoin/lib/types";
import { TokenAccount } from "@ledgerhq/types-live";
import IconCoins from "~/renderer/icons/Coins";
import useFeature from "@ledgerhq/live-common/featureFlags/useFeature";
import { useGetStakeLabelLocaleBased } from "~/renderer/hooks/useGetStakeLabelLocaleBased";

type Props = {
account: BitcoinAccount | TokenAccount;
Expand All @@ -20,7 +20,7 @@ const AccountHeaderActions = ({ account, parentAccount }: Props) => {
const stakeProgramsEnabled = stakeProgramsFeatureFlag?.enabled ?? false;
const availableOnStake = stakeProgramsEnabled && listFlag.includes("bitcoin");
const history = useHistory();
const { t } = useTranslation();
const label = useGetStakeLabelLocaleBased();
const mainAccount = getMainAccount(account, parentAccount);
const {
bitcoinResources,
Expand Down Expand Up @@ -53,7 +53,7 @@ const AccountHeaderActions = ({ account, parentAccount }: Props) => {
{
key: "Stake",
icon: IconCoins,
label: t("accounts.contextMenu.yield"),
label,
event: "button_clicked2",
eventProperties: {
button: "stake",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { useTranslation } from "react-i18next";
import { useDispatch } from "react-redux";
import { openModal } from "~/renderer/actions/modals";
import IconCoins from "~/renderer/icons/Coins";
import { useGetStakeLabelLocaleBased } from "~/renderer/hooks/useGetStakeLabelLocaleBased";

type Props = {
account: AccountLike;
Expand All @@ -18,6 +19,8 @@ const AccountHeaderActions = ({ account, parentAccount }: Props) => {
const { t } = useTranslation();
const dispatch = useDispatch();
const mainAccount = getMainAccount(account, parentAccount);
const label = useGetStakeLabelLocaleBased();

const { cardanoResources } = mainAccount as CardanoAccount;
invariant(cardanoResources, "cardano account expected");

Expand Down Expand Up @@ -47,7 +50,7 @@ const AccountHeaderActions = ({ account, parentAccount }: Props) => {
onClick: onClick,
icon: IconCoins,
disabled: disableStakeButton,
label: t("account.stake"),
label,
tooltip: disabledLabel,
accountActionsTestId: "stake-button",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { openModal } from "~/renderer/actions/modals";
import { IconType } from "../../types";
import { CeloFamily } from "../types";
import Icon from "./Icon";
import { useGetStakeLabelLocaleBased } from "~/renderer/hooks/useGetStakeLabelLocaleBased";

const AccountHeaderManageActions: CeloFamily["accountHeaderManageActions"] = ({
account,
Expand All @@ -16,6 +17,7 @@ const AccountHeaderManageActions: CeloFamily["accountHeaderManageActions"] = ({
}) => {
const { t } = useTranslation();
const dispatch = useDispatch();
const label = useGetStakeLabelLocaleBased();
const isRegistrationPending = isAccountRegistrationPending(account as CeloAccount);
const onClick = useCallback(() => {
if (isAccountEmpty(account)) {
Expand Down Expand Up @@ -45,7 +47,7 @@ const AccountHeaderManageActions: CeloFamily["accountHeaderManageActions"] = ({
onClick: onClick,
icon: (props: IconType) => <Icon {...props} isDisabled={isRegistrationPending} />,
disabled: isRegistrationPending,
label: t("account.stake"),
label,
tooltip: disabledLabel,
event: "button_clicked2",
eventProperties: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useCallback } from "react";
import { useTranslation } from "react-i18next";
import { useDispatch } from "react-redux";
import { openModal } from "~/renderer/actions/modals";
import { useGetStakeLabelLocaleBased } from "~/renderer/hooks/useGetStakeLabelLocaleBased";
import IconCoins from "~/renderer/icons/Coins";

type Props = {
Expand All @@ -17,6 +18,8 @@ type Props = {
const AccountHeaderActions = ({ account, parentAccount, source }: Props) => {
const { t } = useTranslation();
const dispatch = useDispatch();
const label = useGetStakeLabelLocaleBased();

const mainAccount = getMainAccount(account, parentAccount);
const { cosmosResources } = mainAccount;
const earnRewardEnabled = canDelegate(mainAccount);
Expand Down Expand Up @@ -52,7 +55,7 @@ const AccountHeaderActions = ({ account, parentAccount, source }: Props) => {
key: "Stake",
onClick: onClick,
icon: IconCoins,
label: t("account.stake"),
label,
tooltip: disabledLabel,
event: "button_clicked2",
eventProperties: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { useCallback, useMemo } from "react";
import { useTranslation } from "react-i18next";
import { useDispatch } from "react-redux";
import { hasMinimumDelegableBalance } from "@ledgerhq/live-common/families/elrond/helpers";
import { useElrondRandomizedValidators } from "@ledgerhq/live-common/families/elrond/react";
import { openModal } from "~/renderer/actions/modals";
import IconCoins from "~/renderer/icons/Coins";
import { SubAccount } from "@ledgerhq/types-live";
import { ElrondAccount } from "@ledgerhq/live-common/families/elrond/types";
import { useGetStakeLabelLocaleBased } from "~/renderer/hooks/useGetStakeLabelLocaleBased";

const AccountHeaderManageActions = (props: {
account: ElrondAccount | SubAccount;
parentAccount?: ElrondAccount | null;
source?: string;
}) => {
const { account, source } = props;
const { t } = useTranslation();
const dispatch = useDispatch();
const label = useGetStakeLabelLocaleBased();
const validators = useElrondRandomizedValidators();

const earnRewardEnabled = useMemo(
Expand Down Expand Up @@ -57,7 +57,7 @@ const AccountHeaderManageActions = (props: {
key: "Stake",
onClick: onClick,
icon: IconCoins,
label: t("account.stake"),
label,
event: "button_clicked2",
eventProperties: {
button: "stake",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import { Account, AccountLike } from "@ledgerhq/types-live";
import { useCallback } from "react";
import { useDispatch } from "react-redux";
import { useTranslation } from "react-i18next";
import IconCoins from "~/renderer/icons/Coins";
import { openModal } from "~/renderer/actions/modals";
import { isAccountEmpty } from "@ledgerhq/live-common/account/index";
import { useGetStakeLabelLocaleBased } from "~/renderer/hooks/useGetStakeLabelLocaleBased";

type Props = {
account: AccountLike;
parentAccount: Account | undefined | null;
};

const AccountHeaderActions = ({ account, parentAccount }: Props) => {
const { t } = useTranslation();
const dispatch = useDispatch();

const label = useGetStakeLabelLocaleBased();
const isEthereumAccount = account.type === "Account" && account.currency.id === "ethereum";

const onClickStake = useCallback(() => {
Expand Down Expand Up @@ -44,9 +43,7 @@ const AccountHeaderActions = ({ account, parentAccount }: Props) => {
button: "stake",
},
icon: IconCoins,
label: t("account.stake", {
currency: account?.currency?.name,
}),
label,
accountActionsTestId: "stake-button",
},
];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { getMainAccount } from "@ledgerhq/live-common/account/helpers";
import { canStake } from "@ledgerhq/live-common/families/near/logic";
import { useCallback } from "react";
import { useTranslation } from "react-i18next";
import { useDispatch } from "react-redux";
import { openModal } from "~/renderer/actions/modals";
import IconCoins from "~/renderer/icons/Coins";
import { NearFamily } from "./types";
import { useGetStakeLabelLocaleBased } from "~/renderer/hooks/useGetStakeLabelLocaleBased";

const AccountHeaderActions: NearFamily["accountHeaderManageActions"] = ({
account,
parentAccount,
source,
}) => {
const { t } = useTranslation();
const dispatch = useDispatch();
const label = useGetStakeLabelLocaleBased();
const mainAccount = getMainAccount(account, parentAccount);
const { nearResources } = mainAccount;
const stakingEnabled = canStake(mainAccount);
Expand Down Expand Up @@ -52,7 +52,7 @@ const AccountHeaderActions: NearFamily["accountHeaderManageActions"] = ({
key: "Stake",
onClick: onClick,
icon: IconCoins,
label: t("account.stake"),
label,
event: "button_clicked2",
eventProperties: {
button: "stake",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { isAccountEmpty, getMainAccount } from "@ledgerhq/live-common/account/in
import { openModal } from "~/renderer/actions/modals";
import IconCoins from "~/renderer/icons/Coins";
import { PolkadotAccount } from "@ledgerhq/live-common/families/polkadot/types";
import { useGetStakeLabelLocaleBased } from "~/renderer/hooks/useGetStakeLabelLocaleBased";

type Props = {
account: PolkadotAccount | SubAccount;
Expand All @@ -20,6 +21,7 @@ type Props = {

const AccountHeaderManageActions = ({ account, parentAccount, source = "Account Page" }: Props) => {
const { t } = useTranslation();
const label = useGetStakeLabelLocaleBased();
const dispatch = useDispatch();
const mainAccount = getMainAccount(account, parentAccount);
const { polkadotResources } = mainAccount;
Expand Down Expand Up @@ -73,7 +75,7 @@ const AccountHeaderManageActions = ({ account, parentAccount, source = "Account
onClick: onClick,
icon: IconCoins,
disabled: !manageEnabled,
label: t("account.stake"),
label,
tooltip: disabledLabel,
event: "button_clicked2",
eventProperties: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { getMainAccount, isAccountEmpty } from "@ledgerhq/live-common/account/index";
import { useCallback } from "react";
import { useTranslation } from "react-i18next";
import { useDispatch } from "react-redux";
import { openModal } from "~/renderer/actions/modals";
import IconCoins from "~/renderer/icons/Coins";
import { SolanaFamily } from "./types";
import { useGetStakeLabelLocaleBased } from "~/renderer/hooks/useGetStakeLabelLocaleBased";

const AccountHeaderActions: SolanaFamily["accountHeaderManageActions"] = ({ account, source }) => {
const { t } = useTranslation();
const dispatch = useDispatch();
const label = useGetStakeLabelLocaleBased();
const mainAccount = getMainAccount(account);
const { solanaResources } = mainAccount;

Expand Down Expand Up @@ -39,7 +39,7 @@ const AccountHeaderActions: SolanaFamily["accountHeaderManageActions"] = ({ acco
key: "Stake",
onClick: onClick,
icon: IconCoins,
label: t("account.stake"),
label,
event: "button_clicked2",
eventProperties: {
button: "stake",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import { isAccountEmpty } from "@ledgerhq/live-common/account/index";
import { useDelegation } from "@ledgerhq/live-common/families/tezos/react";
import { useCallback } from "react";
import { useTranslation } from "react-i18next";
import { useDispatch } from "react-redux";
import { openModal } from "~/renderer/actions/modals";
import IconCoins from "~/renderer/icons/Coins";
import { TezosFamily } from "./types";
import { StepId } from "./DelegateFlowModal/types";
import { useGetStakeLabelLocaleBased } from "~/renderer/hooks/useGetStakeLabelLocaleBased";

const AccountHeaderManageActions: TezosFamily["accountHeaderManageActions"] = ({
account,
parentAccount,
source,
}) => {
const { t } = useTranslation();
const dispatch = useDispatch();
const label = useGetStakeLabelLocaleBased();

const delegation = useDelegation(account);

const onClick = useCallback(() => {
Expand Down Expand Up @@ -50,7 +51,7 @@ const AccountHeaderManageActions: TezosFamily["accountHeaderManageActions"] = ({
key: "Stake",
onClick: onClick,
icon: IconCoins,
label: t("account.stake"),
label,
event: "button_clicked2",
eventProperties: {
button: "stake",
Expand Down
Loading

0 comments on commit b6d0d62

Please sign in to comment.