@@ -40,9 +40,6 @@ const AttestationInfo: React.FC<AttestationInfoProps> = ({
4040 return null ;
4141 }
4242
43- const reviewerGitAccount =
44- push . attestation . reviewer . gitAccount || push . attestation . reviewer . username ;
45-
4643 return (
4744 < div
4845 style = { {
@@ -79,27 +76,7 @@ const AttestationInfo: React.FC<AttestationInfoProps> = ({
7976 </ p >
8077 </ div >
8178 ) : (
82- < >
83- { isGitHub && (
84- < UserLink username = { push . attestation . reviewer . username } >
85- < img
86- style = { { width : '45px' , borderRadius : '20px' } }
87- src = { `https://github.com/${ reviewerGitAccount } .png` }
88- />
89- </ UserLink >
90- ) }
91- < div >
92- < p >
93- { isGitHub && (
94- < UserLink username = { push . attestation . reviewer . username } >
95- { reviewerGitAccount }
96- </ UserLink >
97- ) }
98- { ! isGitHub && < UserLink username = { push . attestation . reviewer . username } /> } approved
99- this contribution
100- </ p >
101- </ div >
102- </ >
79+ < ReviewerInfo push = { push } isGitHub = { isGitHub } />
10380 ) }
10481
10582 < Tooltip
@@ -122,4 +99,40 @@ const AttestationInfo: React.FC<AttestationInfoProps> = ({
12299 ) ;
123100} ;
124101
102+ interface ReviewerInfoProps {
103+ push : PushActionView ;
104+ isGitHub : boolean ;
105+ }
106+
107+ const ReviewerInfo : React . FC < ReviewerInfoProps > = ( { push, isGitHub } ) => {
108+ if ( ! push . attestation ?. reviewer ) {
109+ return null ;
110+ }
111+
112+ const reviewerGitAccount =
113+ push . attestation . reviewer . gitAccount || push . attestation . reviewer . username ;
114+
115+ return (
116+ < >
117+ { isGitHub && (
118+ < UserLink username = { push . attestation . reviewer . username } >
119+ < img
120+ style = { { width : '45px' , borderRadius : '20px' } }
121+ src = { `https://github.com/${ reviewerGitAccount } .png` }
122+ />
123+ </ UserLink >
124+ ) }
125+ < div >
126+ < p >
127+ { isGitHub && (
128+ < UserLink username = { push . attestation . reviewer . username } > { reviewerGitAccount } </ UserLink >
129+ ) }
130+ { ! isGitHub && < UserLink username = { push . attestation . reviewer . username } /> } approved this
131+ contribution
132+ </ p >
133+ </ div >
134+ </ >
135+ ) ;
136+ } ;
137+
125138export default AttestationInfo ;
0 commit comments