rename onCommit to onPreviewPress

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-06-03 13:32:46 +03:00
parent e33b88212d
commit 7476ef26cd
+5 -5
View File
@@ -375,7 +375,7 @@ export function Link({
return ( return (
<LinkPeek <LinkPeek
href={href} href={href}
onCommit={openExternally} onPreviewPress={openExternally}
shouldProxy={shouldProxy} shouldProxy={shouldProxy}
borderRadius={typeof borderRadius === 'number' ? borderRadius : 0}> borderRadius={typeof borderRadius === 'number' ? borderRadius : 0}>
{button} {button}
@@ -390,17 +390,17 @@ export function Link({
* iOS peek-menu wrapper for an external `Link`. Long-pressing previews the live * iOS peek-menu wrapper for an external `Link`. Long-pressing previews the live
* page in an in-app browser; the in-app-browser preference decides whether * page in an in-app browser; the in-app-browser preference decides whether
* tapping the peek morphs into the browser or hands off to the normal link flow * tapping the peek morphs into the browser or hands off to the normal link flow
* via `onCommit`. The menu carries a Share action. * via `onPreviewPress`. The menu carries a Share action.
*/ */
function LinkPeek({ function LinkPeek({
href, href,
onCommit, onPreviewPress,
shouldProxy, shouldProxy,
borderRadius, borderRadius,
children, children,
}: { }: {
href: string href: string
onCommit: () => void onPreviewPress: () => void
shouldProxy?: boolean shouldProxy?: boolean
borderRadius: number borderRadius: number
children: React.ReactNode children: React.ReactNode
@@ -424,7 +424,7 @@ function LinkPeek({
}} }}
borderRadius={borderRadius} borderRadius={borderRadius}
// Fires only when not morphing natively (in-app browser off/unset). // Fires only when not morphing natively (in-app browser off/unset).
onPreviewPress={onCommit}> onPreviewPress={onPreviewPress}>
{children} {children}
</PeekMenu.Trigger> </PeekMenu.Trigger>
<PeekMenu.Menu> <PeekMenu.Menu>