@@ -48,6 +48,7 @@ import { useAtomRefresh } from "@effect/atom-react";
4848import { pullRequestReviewKey } from "./pullRequestReviewDrafts" ;
4949import { type PullRequestDetail , type PullRequestListEntry } from "@t3tools/contracts" ;
5050import { PullRequestOverviewLoading } from "./PullRequestOverviewLoading" ;
51+ import { copyPullRequestLink , sharePullRequestLink } from "./pullRequestLink" ;
5152import { pullRequestStatus } from "./pullRequestStatus" ;
5253import { useCallback , useEffect , useMemo , useRef , useState } from "react" ;
5354import {
@@ -420,12 +421,24 @@ export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestP
420421 } ,
421422 ]
422423 : [ ] ) ,
423- ...( pr
424+ ...( identity
424425 ? [
425426 {
426- accessibilityLabel : openOnProviderLabel ( pr . provider ) ,
427+ accessibilityLabel : openOnProviderLabel ( identity . provider ) ,
427428 icon : "arrow.up.right" as const ,
428- onPress : ( ) => void Linking . openURL ( pr . url ) ,
429+ onPress : ( ) => void Linking . openURL ( identity . url ) ,
430+ } ,
431+ {
432+ accessibilityLabel : "Copy link" ,
433+ icon : "link" as const ,
434+ overflowOnly : true ,
435+ onPress : ( ) => copyPullRequestLink ( identity ) ,
436+ } ,
437+ {
438+ accessibilityLabel : "Share…" ,
439+ icon : "square.and.arrow.up" as const ,
440+ overflowOnly : true ,
441+ onPress : ( ) => sharePullRequestLink ( identity ) ,
429442 } ,
430443 ]
431444 : [ ] ) ,
@@ -470,12 +483,25 @@ export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestP
470483 < Toolbar . Label > Add comment</ Toolbar . Label >
471484 </ Toolbar . MenuAction >
472485 ) : null }
473- { pr ? (
486+ { identity ? (
474487 < Toolbar . MenuAction
475488 icon = "arrow.up.right"
476- onPress = { ( ) => void Linking . openURL ( pr . url ) }
489+ onPress = { ( ) => void Linking . openURL ( identity . url ) }
490+ >
491+ < Toolbar . Label > { openOnProviderLabel ( identity . provider ) } </ Toolbar . Label >
492+ </ Toolbar . MenuAction >
493+ ) : null }
494+ { identity ? (
495+ < Toolbar . MenuAction icon = "link" onPress = { ( ) => copyPullRequestLink ( identity ) } >
496+ < Toolbar . Label > Copy link</ Toolbar . Label >
497+ </ Toolbar . MenuAction >
498+ ) : null }
499+ { identity ? (
500+ < Toolbar . MenuAction
501+ icon = "square.and.arrow.up"
502+ onPress = { ( ) => sharePullRequestLink ( identity ) }
477503 >
478- < Toolbar . Label > { openOnProviderLabel ( pr . provider ) } </ Toolbar . Label >
504+ < Toolbar . Label > Share… </ Toolbar . Label >
479505 </ Toolbar . MenuAction >
480506 ) : null }
481507 { showsDeleteBranch ? (
0 commit comments