Skip to content

Commit

Permalink
feat: aptos wallet adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
athevinha committed Sep 19, 2024
1 parent e8c7290 commit dc08d76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Stack } from '@mui/material';
// utils
import {PATH_DASHBOARD} from 'src/routes/paths';
import {useWalletClient} from 'wagmi';
import {useWallet} from '@aptos-labs/wallet-adapter-react';
import { hideScrollbarY } from '../../../utils/cssStyles';
//
import { NavSectionProps, NavListProps } from '../types';
Expand Down Expand Up @@ -39,11 +40,11 @@ type ItemsProps = {
};

function Items({ items }: ItemsProps) {
const wallet = useWalletClient()
const wallet = useWallet()
return (
<>
{items.map((list) => {
if (list.path === PATH_DASHBOARD.user.profile && !wallet?.data?.account?.address)
if (list.path === PATH_DASHBOARD.user.profile && !wallet?.account?.address)
return <div />;
return (
<NavList key={list.title + list.path} data={list} depth={1} hasChild={!!list.children} />
Expand Down
5 changes: 3 additions & 2 deletions src/components/nav-section/vertical/NavSectionVertical.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { List, Stack } from '@mui/material';
// locales
import { PATH_DASHBOARD } from 'src/routes/paths';
import {useWalletClient} from 'wagmi';
import {useWallet} from '@aptos-labs/wallet-adapter-react';
import { useLocales } from '../../../locales';
//
import { NavSectionProps } from '../types';
Expand All @@ -13,7 +14,7 @@ import NavList from './NavList';

export default function NavSectionVertical({ data, sx, ...other }: NavSectionProps) {
const { translate } = useLocales();
const wallet = useWalletClient()
const wallet = useWallet()
return (
<Stack sx={sx} {...other}>
{data.map((group) => {
Expand All @@ -26,7 +27,7 @@ export default function NavSectionVertical({ data, sx, ...other }: NavSectionPro
)}

{group.items.map((list) => {
if (list.path === PATH_DASHBOARD.user.profile && !wallet?.data?.account?.address) return <div/>
if (list.path === PATH_DASHBOARD.user.profile && !wallet?.account?.address) return <div/>
return (
<NavList
key={list.title + list.path}
Expand Down

0 comments on commit dc08d76

Please sign in to comment.