Skip to content

Commit f672318

Browse files
committed
feat: change ui to display reviewer just if it is not auto approved
1 parent af74f3c commit f672318

File tree

1 file changed

+57
-35
lines changed

1 file changed

+57
-35
lines changed

src/ui/views/PushDetails/PushDetails.jsx

Lines changed: 57 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -173,45 +173,67 @@ export default function Dashboard() {
173173
}}
174174
>
175175
<CheckCircle
176-
style={{ cursor: 'pointer', transform: 'scale(0.65)' }}
177-
onClick={() => setAttestation(true)}
176+
style={{
177+
cursor: data.autoApproved ? 'default' : 'pointer',
178+
transform: 'scale(0.65)',
179+
opacity: data.autoApproved ? 0.5 : 1,
180+
}}
181+
onClick={() => {
182+
if (!data.autoApproved) {
183+
setAttestation(true);
184+
}
185+
}}
178186
htmlColor='green'
179187
/>
180188
</span>
181-
<a href={`/admin/user/${data.attestation.reviewer.username}`}>
182-
<img
183-
style={{ width: '45px', borderRadius: '20px' }}
184-
src={`https://github.com/${data.attestation.reviewer.gitAccount}.png`}
185-
/>
186-
</a>
187-
<div>
188-
<p>
189+
190+
{data.autoApproved ? (
191+
<>
192+
<div style={{ paddingTop: '15px' }}>
193+
<p>
194+
<strong>Auto-approved by system</strong>
195+
</p>
196+
</div>
197+
</>
198+
) : (
199+
<>
189200
<a href={`/admin/user/${data.attestation.reviewer.username}`}>
190-
{data.attestation.reviewer.gitAccount}
191-
</a>{' '}
192-
approved this contribution
193-
</p>
194-
<Tooltip
195-
title={moment(data.attestation.timestamp).format(
196-
'dddd, MMMM Do YYYY, h:mm:ss a',
197-
)}
198-
arrow
199-
>
200-
<kbd
201-
style={{
202-
color: 'black',
203-
float: 'right',
204-
}}
205-
>
206-
{moment(data.attestation.timestamp).fromNow()}
207-
</kbd>
208-
</Tooltip>
209-
</div>
210-
<AttestationView
211-
data={data.attestation}
212-
attestation={attestation}
213-
setAttestation={setAttestation}
214-
/>
201+
<img
202+
style={{ width: '45px', borderRadius: '20px' }}
203+
src={`https://github.com/${data.attestation.reviewer.gitAccount}.png`}
204+
/>
205+
</a>
206+
<div>
207+
<p>
208+
<a href={`/admin/user/${data.attestation.reviewer.username}`}>
209+
{data.attestation.reviewer.gitAccount}
210+
</a>{' '}
211+
approved this contribution
212+
</p>
213+
</div>
214+
</>
215+
)}
216+
217+
<Tooltip
218+
title={moment(data.attestation.timestamp).format(
219+
'dddd, MMMM Do YYYY, h:mm:ss a',
220+
)}
221+
arrow
222+
>
223+
<kbd style={{ color: 'black', float: 'right' }}>
224+
{moment(data.attestation.timestamp).fromNow()}
225+
</kbd>
226+
</Tooltip>
227+
228+
{data.autoApproved ? (
229+
<></>
230+
) : (
231+
<AttestationView
232+
data={data.attestation}
233+
attestation={attestation}
234+
setAttestation={setAttestation}
235+
/>
236+
)}
215237
</div>
216238
) : null}
217239
</CardHeader>

0 commit comments

Comments
 (0)