Skip to content

Commit

Permalink
feat: disable modal animation and add lock option in menu
Browse files Browse the repository at this point in the history
  • Loading branch information
jimcase committed Apr 29, 2024
1 parent dac7582 commit 1c4730d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/locales/en/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,8 @@
"connections": "Connections",
"p2p": "P2P",
"identity": "Identity",
"credentials": "Credentials"
"credentials": "Credentials",
"lock": "Lock"
}
}
},
Expand Down
1 change: 1 addition & 0 deletions src/ui/components/LockModal/LockModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ const LockModal = () => {
isOpen={lockApp}
className="lock-modal"
data-testid={componentId}
animated={false}
>
<ResponsivePageLayout
pageId={componentId}
Expand Down
26 changes: 23 additions & 3 deletions src/ui/pages/Menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ import {
chatbubbleOutline,
fingerPrintOutline,
idCardOutline,
lockClosedOutline,
} from "ionicons/icons";
import { TabLayout } from "../../components/layout/TabLayout";
import { useAppDispatch } from "../../../store/hooks";
import {
logout,
setCurrentOperation,
setCurrentRoute,
} from "../../../store/reducers/stateCache";
Expand Down Expand Up @@ -55,8 +57,14 @@ const Menu = () => {
);
};

const handleItemSelection = (index: number) => {
// @TODO - sdisalvo: add some logic for selection
const handleItemSelection = (option: string) => {
switch (option) {
case i18n.t("menu.tab.items.lock"):
dispatch(logout());
return;
default:
return;
}
};

const MenuItem = ({
Expand All @@ -71,7 +79,7 @@ const Menu = () => {
return (
<IonCol>
<IonCard
onClick={() => handleItemSelection(index)}
onClick={() => handleItemSelection(label)}
data-testid={`menu-input-item-${index}`}
className="menu-input"
>
Expand Down Expand Up @@ -129,6 +137,18 @@ const Menu = () => {
label={`${i18n.t("menu.tab.items.credentials")}`}
/>
</IonRow>
<IonRow className="menu-input-row">
<MenuItem
index={4}
icon={lockClosedOutline}
label={`${i18n.t("menu.tab.items.lock")}`}
/>
<MenuItem
index={5}
icon=""
label=""
/>
</IonRow>
</IonGrid>
</TabLayout>
);
Expand Down

0 comments on commit 1c4730d

Please sign in to comment.