Skip to content

Commit 5fabbff

Browse files
authored
Merge pull request #14454 from LedgerHQ/feat/LIVE-26222_remove-lock-button
2 parents 02d0d83 + b408834 commit 5fabbff

File tree

3 files changed

+7
-42
lines changed

3 files changed

+7
-42
lines changed

.changeset/fresh-pens-occur.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"ledger-live-desktop": minor
3+
---
4+
5+
feat(lwd): remove lock button in wallet40

apps/ledger-live-desktop/src/mvvm/components/TopBar/TopBarView.tsx

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
import React, { useState, useCallback } from "react";
2-
import { useDispatch, useSelector } from "LLD/hooks/redux";
1+
import React, { useState } from "react";
32
import { useTranslation } from "react-i18next";
4-
import { lock } from "~/renderer/actions/application";
53
import { ItemContainer } from "~/renderer/components/TopBar/shared";
64
import Tooltip from "~/renderer/components/Tooltip";
75
import Breadcrumb from "~/renderer/components/Breadcrumb";
86
import HelpSideBar from "~/renderer/modals/Help";
97

10-
import { hasPasswordSelector } from "~/renderer/reducers/application";
118
import { LiveAppDrawer } from "~/renderer/components/LiveAppDrawer";
129
import { IconsLegacy } from "@ledgerhq/react-ui";
1310
import { NavBar, NavBarTrailing, NavBarTitle } from "@ledgerhq/lumen-ui-react";
@@ -16,10 +13,7 @@ import { TopBarActionsList } from "./components/ActionsList";
1613

1714
const TopBarView = ({ slots }: TopBarViewProps) => {
1815
const { t } = useTranslation();
19-
const dispatch = useDispatch();
20-
const hasPassword = useSelector(hasPasswordSelector);
2116
const [helpSideBarVisible, setHelpSideBarVisible] = useState(false);
22-
const handleLock = useCallback(() => dispatch(lock()), [dispatch]);
2317

2418
return (
2519
<NavBar className="items-center px-32 pt-32 pb-24">
@@ -41,20 +35,6 @@ const TopBarView = ({ slots }: TopBarViewProps) => {
4135
</ItemContainer>
4236
</Tooltip>
4337
<HelpSideBar isOpened={helpSideBarVisible} onClose={() => setHelpSideBarVisible(false)} />
44-
{hasPassword && (
45-
<>
46-
<Tooltip content={t("common.lock")}>
47-
<ItemContainer
48-
data-testid="topbar-password-lock-button"
49-
isInteractive
50-
justifyContent="center"
51-
onClick={handleLock}
52-
>
53-
<IconsLegacy.LockAltMedium size={18} />
54-
</ItemContainer>
55-
</Tooltip>
56-
</>
57-
)}
5838
</NavBarTrailing>
5939
</NavBar>
6040
);

apps/ledger-live-desktop/src/mvvm/components/TopBar/__tests__/index.test.tsx

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -75,36 +75,16 @@ describe("TopBar", () => {
7575
expect(screen.queryByTestId("topbar-action-button-synchronize")).toBeNull();
7676
});
7777

78-
it("renders lock button when hasPassword is true", () => {
78+
it("renders all slot actions and help when hasAccounts is true", () => {
7979
render(<TopBar />, {
8080
initialState: getDefaultInitialState({
81-
application: { hasPassword: true },
82-
}),
83-
});
84-
85-
expect(screen.getByTestId("topbar-password-lock-button")).toBeVisible();
86-
});
87-
88-
it("does not render lock button when hasPassword is false", () => {
89-
render(<TopBar />, {
90-
initialState: getDefaultInitialState(),
91-
});
92-
93-
expect(screen.queryByTestId("topbar-password-lock-button")).toBeNull();
94-
});
95-
96-
it("renders all elements when hasAccounts and hasPassword are true", () => {
97-
render(<TopBar />, {
98-
initialState: getDefaultInitialState({
99-
application: { hasPassword: true },
10081
accounts: [mockAccount],
10182
}),
10283
});
10384

10485
expect(screen.getByTestId("topbar-action-button-synchronize")).toBeVisible();
10586
expect(screen.getByTestId("topbar-action-button-notifications")).toBeVisible();
10687
expect(screen.getByTestId("topbar-action-button-discreet")).toBeVisible();
107-
expect(screen.getByTestId("topbar-password-lock-button")).toBeVisible();
10888
expect(screen.getByTestId("topbar-help-button")).toBeVisible();
10989
expect(screen.getByTestId("topbar-action-button-settings")).toBeVisible();
11090
});

0 commit comments

Comments
 (0)