Skip to content

Commit 3b939bc

Browse files
committed
different approach to arrow function
1 parent b1d69f1 commit 3b939bc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/ui/modals/RecommendedLinks.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ const RecommendedLinksModalBody = forwardRef<HTMLButtonElement, RecommendedLinks
1717
const modalTitle = <ModalTitle breadcrumb={{ option: 'close', onClick: handler.close }} />
1818

1919
const buttons = Object.entries(t('recommended-links.buttons', { returnObjects: true }) || {})
20-
const handleButtonClick = (link: string) => {
21-
window.open(link, '_blank')
20+
const getButtonClickHandler = (link: string) => {
21+
return () => window.open(link, '_blank')
2222
}
2323

2424
return (
@@ -44,7 +44,7 @@ const RecommendedLinksModalBody = forwardRef<HTMLButtonElement, RecommendedLinks
4444
paddingRight: isMobile ? '1rem' : undefined,
4545
textDecoration: 'none',
4646
}}
47-
onClick={() => handleButtonClick(btn.link)}
47+
onClick={getButtonClickHandler(btn.link)}
4848
>
4949
<Text ta='center' variant={variants.Text.utility1} fz={isMobile ? '.75rem' : undefined}>
5050
{btn.text}

0 commit comments

Comments
 (0)