Skip to content

Commit

Permalink
refactor: clean up imports and optimize functions
Browse files Browse the repository at this point in the history
- **publication-play-view.tsx**: Remove unused imports to improve code readability and maintainability.
- **profile-header.tsx**: Optimize `handleClose` by using it as a dependency for the `useEffect` hook and improve tooltip handling functions.
- **use-resolve-terms.ts**: Comment out an unused import to reduce clutter in the code.
  • Loading branch information
cswni committed Dec 3, 2024
1 parent cc7bf83 commit dc16437
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/hooks/use-resolve-terms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Address } from 'viem';
import SubscriptionPolicyAbi from '@src/config/abi/SubscriptionPolicy.json';
import { GLOBAL_CONSTANTS } from '@src/config-global.ts';
// @ts-ignore
import { ReadResult } from '@lens-protocol/react/dist/declarations/src/helpers/reads';
// import { ReadResult } from '@lens-protocol/react/dist/declarations/src/helpers/reads';

// ----------------------------------------------------------------------

Expand Down
5 changes: 0 additions & 5 deletions src/sections/publication/view/publication-play-view.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
// routes
import { paths } from '@src/routes/paths';
// eslint-disable-next-line import/no-extraneous-dependencies
import { usePublication } from '@lens-protocol/react';
import { useResponsive } from '@src/hooks/use-responsive.ts';
import { useRouter } from '@src/routes/hooks';
import { LoadingScreen } from '../../../components/loading-screen';
import VideoPlayer from '../../../components/VideoPlayer';
import Box from '@mui/material/Box';
Expand Down
10 changes: 5 additions & 5 deletions src/sections/user/profile-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,20 @@ const ProfileHeader = ({ profile, children }: PropsWithChildren<ProfileHeaderPro

const attestationAddress = `0x${BigInt(attestation ?? '').toString(16)}`

const handleClose = useCallback(() => {
setOpenTooltip(false);
}, []);

useEffect(() => {
if (open) {
handleClose();
}
},[]);
},[handleClose, open]);

const handleOpen = useCallback(() => {
setOpenTooltip(true);
}, []);

const handleClose = useCallback(() => {
setOpenTooltip(false);
}, []);

const handleOpenShare = useCallback(() => {
setOpenTooltipShare(true);
}, []);
Expand Down

0 comments on commit dc16437

Please sign in to comment.