diff --git a/apps/mochi-web/components/BottomSheet/index.tsx b/apps/mochi-web/components/BottomSheet/index.tsx index aac92322e..8252ce5d1 100644 --- a/apps/mochi-web/components/BottomSheet/index.tsx +++ b/apps/mochi-web/components/BottomSheet/index.tsx @@ -9,9 +9,7 @@ import { import clsx from 'clsx' import { createContext } from '@dwarvesf/react-utils' import { - Button, Drawer, - DrawerClose, DrawerContent, DrawerOverlay, DrawerPortal, @@ -99,37 +97,33 @@ function BottomSheet({ className, )} > -
-
- - - + {isLoggedIn && ( +
+
+ {title && isLoggedIn ? ( + + {title} + + ) : ( + <>​ + )} +
- {title && isLoggedIn ? ( - - {title} - - ) : ( - <>​ - )} -
-
+ )} {isLoggedIn ? ( children ) : (
- + + setOpenSheets(openSheets.filter((s) => s !== name)) + } + raw + {...loginWidgetProps} + />
)} diff --git a/apps/mochi-web/components/Header/Header.tsx b/apps/mochi-web/components/Header/Header.tsx index bad969c25..1b50b8043 100644 --- a/apps/mochi-web/components/Header/Header.tsx +++ b/apps/mochi-web/components/Header/Header.tsx @@ -84,7 +84,7 @@ const LoginPopover = () => { - + setIsOpen(false)} raw /> diff --git a/apps/mochi-web/components/Profile/TransactionSection.tsx b/apps/mochi-web/components/Profile/TransactionSection.tsx index ec91c4c6d..1f50b1dc8 100644 --- a/apps/mochi-web/components/Profile/TransactionSection.tsx +++ b/apps/mochi-web/components/Profile/TransactionSection.tsx @@ -65,7 +65,18 @@ export const TransactionOverviewSection = () => { {ready && ( 'h-[60px]'} + headerCellClassName={(i) => + clsx({ + 'pl-4': i === 0, + 'pr-4': i === 8, + }) + } + cellClassName={(_r, _ri, ci) => + clsx('h-[60px]', { + 'pl-4': ci === 0, + 'pr-4': ci === 8, + }) + } className={clsx('!w-auto', { 'min-h-[344px]': txnsCurrentPage?.length, })} diff --git a/apps/mochi-web/components/ProfileDropdown.tsx b/apps/mochi-web/components/ProfileDropdown.tsx index f2e62ad45..ffcd4cca8 100644 --- a/apps/mochi-web/components/ProfileDropdown.tsx +++ b/apps/mochi-web/components/ProfileDropdown.tsx @@ -1,7 +1,3 @@ -import { useFetchChangelogLatest } from '~hooks/app/useFetchChangelogLatest' -import { useRouter } from 'next/router' -import clsx from 'clsx' -import { isMobile } from '~utils/isMobile' import { DropdownMenu, DropdownMenuTrigger, @@ -44,11 +40,9 @@ export default function ProfileDropdown({ children?: ReactNode className?: string }) { - const { pathname } = useRouter() const { setIsNavOpen } = useIsNavOpenStore() const { isLoggedIn, profile } = useLoginWidget() const { activeTheme, setTheme, theme } = useTheme() - const { data: changelogData } = useFetchChangelogLatest() let triggerRender = null if (children) { @@ -66,9 +60,11 @@ export default function ProfileDropdown({ return ( - isMobile() && window.innerWidth <= 1024 && setIsNavOpen(b) - } + onOpenChange={(b) => { + if (window.innerWidth > 1024) return + + setIsNavOpen(b) + }} > {triggerRender} @@ -76,14 +72,7 @@ export default function ProfileDropdown({ { switch (tx.status) { case 'submitted': case 'pending': { - return + return } case 'failed': case 'expired': { - return + return ( + + ) } case 'success': { - return + return } default: { return null diff --git a/apps/mochi-web/package.json b/apps/mochi-web/package.json index b3272cacc..3ecf87bd8 100644 --- a/apps/mochi-web/package.json +++ b/apps/mochi-web/package.json @@ -17,7 +17,7 @@ }, "dependencies": { "@bonfida/spl-name-service": "^0.1.67", - "@consolelabs/mochi-formatter": "^20.0.0", + "@consolelabs/mochi-formatter": "^20.0.1", "@consolelabs/mochi-rest": "^5.3.0", "@dwarvesf/react-hooks": "^0.8.2", "@dwarvesf/react-utils": "^0.4.2", diff --git a/packages/components/table/src/table.tsx b/packages/components/table/src/table.tsx index 9a4157dfb..5b5b63868 100644 --- a/packages/components/table/src/table.tsx +++ b/packages/components/table/src/table.tsx @@ -19,7 +19,7 @@ export interface TableProps { className?: string wrapperClassName?: string rowClassName?: (record: T, index: number) => string - headerCellClassName?: string + headerCellClassName?: ((headerIndex: number) => string) | string cellClassName?: ( record: T | null, rowIndex: number, @@ -116,7 +116,10 @@ export default function Table({ className={tableHeaderClsx({ stickyHeader, size, - className: headerCellClassName, + className: + typeof headerCellClassName === 'string' + ? headerCellClassName + : headerCellClassName?.(header.index), })} colSpan={header.colSpan} key={header.id} diff --git a/packages/components/top-bar/src/mobile-nav.tsx b/packages/components/top-bar/src/mobile-nav.tsx index 2174c8b14..c2ba0b14f 100644 --- a/packages/components/top-bar/src/mobile-nav.tsx +++ b/packages/components/top-bar/src/mobile-nav.tsx @@ -43,7 +43,8 @@ export const MobileNav = (props: MobileNavProps) => { useEffect(() => { if (!hasMounted) return onNavStateChanged?.(openMobileNav) - }, [hasMounted, onNavStateChanged, openMobileNav]) + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [openMobileNav]) return ( <> diff --git a/packages/web3/connect-wallet-widget/src/providers/evm-provider.ts b/packages/web3/connect-wallet-widget/src/providers/evm-provider.ts index 33d0371fc..691adad8e 100644 --- a/packages/web3/connect-wallet-widget/src/providers/evm-provider.ts +++ b/packages/web3/connect-wallet-widget/src/providers/evm-provider.ts @@ -110,6 +110,17 @@ export class ProviderEVM extends ChainProvider { return await this.connectMobile() } + if (['app.phantom'].every((id) => id !== this.id)) { + await this.provider.request({ + method: 'wallet_requestPermissions', + params: [ + { + eth_accounts: {}, + }, + ], + }) + } + const accounts = await this.provider.request({ method: 'eth_requestAccounts', }) diff --git a/packages/web3/connect-wallet-widget/src/providers/ron-provider.ts b/packages/web3/connect-wallet-widget/src/providers/ron-provider.ts index 6ed1c9ad8..7bb355608 100644 --- a/packages/web3/connect-wallet-widget/src/providers/ron-provider.ts +++ b/packages/web3/connect-wallet-widget/src/providers/ron-provider.ts @@ -111,6 +111,15 @@ export class ProviderRON extends ChainProvider { return await this.connectMobile() } + await this.provider.request({ + method: 'wallet_requestPermissions', + params: [ + { + eth_accounts: {}, + }, + ], + }) + const accounts = await this.provider.request({ method: 'eth_requestAccounts', }) diff --git a/packages/web3/connect-wallet-widget/src/providers/sol-provider.ts b/packages/web3/connect-wallet-widget/src/providers/sol-provider.ts index 82c3be8a9..06d068061 100644 --- a/packages/web3/connect-wallet-widget/src/providers/sol-provider.ts +++ b/packages/web3/connect-wallet-widget/src/providers/sol-provider.ts @@ -62,6 +62,8 @@ export class ProviderSOL extends ChainProvider { return await this.connectMobile() } + await this.provider.connect() + const signResult = await this.provider.signMessage(hexedMsg) let signature let pb = this.provider.publicKey diff --git a/packages/web3/login-widget/src/login-content.tsx b/packages/web3/login-widget/src/login-content.tsx index 7676e617f..329b68d1d 100644 --- a/packages/web3/login-widget/src/login-content.tsx +++ b/packages/web3/login-widget/src/login-content.tsx @@ -200,14 +200,18 @@ export default function LoginContent({ > Connect Options - - - + {onClose ? ( + + + + ) : ( +
+ )}