diff --git a/apps/ui-icons/src/DarkMode.tsx b/apps/ui-icons/src/DarkMode.tsx new file mode 100644 index 00000000000..2fa66b5e62f --- /dev/null +++ b/apps/ui-icons/src/DarkMode.tsx @@ -0,0 +1,23 @@ +// Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +import { SVGProps } from 'react'; +export default function SvgDarkMode(props: SVGProps) { + return ( + + + + ); +} diff --git a/apps/ui-icons/src/index.ts b/apps/ui-icons/src/index.ts index 68afd21e7ee..a19892633dd 100644 --- a/apps/ui-icons/src/index.ts +++ b/apps/ui-icons/src/index.ts @@ -21,6 +21,7 @@ export { default as Close } from './Close'; export { default as Copy } from './Copy'; export { default as Create } from './Create'; export { default as Dash } from './Dash'; +export { default as DarkMode } from './DarkMode'; export { default as DataStack } from './DataStack'; export { default as Delete } from './Delete'; export { default as DoubleArrowLeft } from './DoubleArrowLeft'; diff --git a/apps/ui-icons/svgs/dark_mode.svg b/apps/ui-icons/svgs/dark_mode.svg new file mode 100644 index 00000000000..e6b42d17bfc --- /dev/null +++ b/apps/ui-icons/svgs/dark_mode.svg @@ -0,0 +1,3 @@ + + + diff --git a/apps/wallet/src/ui/app/components/menu/content/MenuLayout.tsx b/apps/wallet/src/ui/app/components/menu/content/MenuLayout.tsx deleted file mode 100644 index 7d4a0988322..00000000000 --- a/apps/wallet/src/ui/app/components/menu/content/MenuLayout.tsx +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -import PageTitle, { type PageTitleProps } from '_src/ui/app/shared/PageTitle'; -import { type ReactNode } from 'react'; - -export interface MenuLayoutProps extends PageTitleProps { - children: ReactNode; -} - -export function MenuLayout({ children, ...pageTitleProps }: MenuLayoutProps) { - return ( - <> -
- -
-
{children}
- - ); -} diff --git a/apps/wallet/src/ui/app/components/menu/content/MenuListItem.tsx b/apps/wallet/src/ui/app/components/menu/content/MenuListItem.tsx deleted file mode 100644 index 6a1916bfc1c..00000000000 --- a/apps/wallet/src/ui/app/components/menu/content/MenuListItem.tsx +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -import { ChevronRight16 } from '@iota/icons'; -import clsx from 'clsx'; -import type { MouseEventHandler, ReactNode } from 'react'; -import { Link } from 'react-router-dom'; - -export interface ItemProps { - icon: ReactNode; - title: ReactNode; - subtitle?: ReactNode; - iconAfter?: ReactNode; - to?: string; - href?: string; - onClick?: MouseEventHandler; -} - -function MenuListItem({ - icon, - title, - subtitle, - iconAfter, - to = '', - href = '', - onClick, -}: ItemProps) { - const Component = to ? Link : 'div'; - - const MenuItemContent = ( - <> -
-
{icon}
-
{title}
-
- {subtitle || iconAfter || to ? ( -
- {subtitle ? ( -
- {subtitle} -
- ) : null} -
- {iconAfter || (to && ) || null} -
-
- ) : null} - - ); - - if (href) { - return ( - - {MenuItemContent} - - ); - } - return ( - - {MenuItemContent} - - ); -} - -export default MenuListItem; diff --git a/apps/wallet/src/ui/app/components/menu/content/MoreOptions.tsx b/apps/wallet/src/ui/app/components/menu/content/MoreOptions.tsx deleted file mode 100644 index 9ecdc1e21a8..00000000000 --- a/apps/wallet/src/ui/app/components/menu/content/MoreOptions.tsx +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -import { Button } from '_app/shared/ButtonUI'; -import { useNextMenuUrl } from '_components'; -// import { ampli } from '_src/shared/analytics/ampli'; -import { persister } from '_src/ui/app/helpers/queryClient'; -import { useBackgroundClient } from '_src/ui/app/hooks/useBackgroundClient'; -import { ConfirmationModal } from '_src/ui/app/shared/ConfirmationModal'; -import { useMutation, useQueryClient } from '@tanstack/react-query'; -import { useState } from 'react'; - -import { MenuLayout } from './MenuLayout'; - -export function MoreOptions() { - const mainMenuUrl = useNextMenuUrl(true, '/'); - const [isLogoutDialogOpen, setIsLogoutDialogOpen] = useState(false); - const backgroundClient = useBackgroundClient(); - const queryClient = useQueryClient(); - const logoutMutation = useMutation({ - mutationKey: ['logout', 'clear wallet'], - mutationFn: async () => { - // ampli.client.reset(); - queryClient.cancelQueries(); - queryClient.clear(); - await persister.removeClient(); - await backgroundClient.clearWallet(); - }, - }); - return ( - -