Skip to content

Commit

Permalink
fix: add useMemo
Browse files Browse the repository at this point in the history
  • Loading branch information
heyJonBray committed Sep 12, 2024
1 parent 9622b15 commit b91285f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/wallet/UserAssets.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import { FaEthereum } from 'react-icons/fa';
import AssetsValues from './AssetsValues';

function UserAssets() {
// Keep track of the switch state
// keep track of the switch state
const [isSwitched, setIsSwitched] = useState(false);

// Switch handler
// switch handler
const switchHandler = () => {
setIsSwitched(!isSwitched);
};

// Memoized values for deposit and withdraw sections
// memoized values for deposit and withdraw sections
const depositSection = useMemo(
() => (
<motion.div
Expand Down Expand Up @@ -103,7 +103,7 @@ function UserAssets() {
</FormLabel>
</FormControl>

{/* Conditionally render deposit or withdraw section */}
{/* conditionally render deposit or withdraw section */}
{isSwitched ? withdrawSection : depositSection}
</div>

Expand Down

0 comments on commit b91285f

Please sign in to comment.