Skip to content

Commit e356c30

Browse files
committed
fix: download certificate
1 parent d206101 commit e356c30

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

src/core/components/profile/stepCard.component.tsx

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -376,16 +376,22 @@ const StepCard: React.FC<StepCardProps> = ({ step, status, isApproved }) => {
376376
)}
377377
{step === 6 && application.state === "PASSED_THE_CAMP" && (
378378
<>
379-
<img src={application.certificatePreviewLink} alt="certificate" />
380-
<a
381-
href={`${application.certificateDownloadLink}`}
382-
target="_blank"
383-
rel="noopener noreferrer"
384-
className={`no-underline ${classes.linkButton}`}>
385-
<Button variant={"contained"} disableElevation className={`${classes.button} ${classes.solid}`} onClick={() => {}}>
386-
ดาวน์โหลดเกียรติบัตร
387-
</Button>
388-
</a>
379+
{application.certificateDownloadLink && (
380+
<a
381+
href={`${application.certificateDownloadLink}`}
382+
target="_blank"
383+
rel="noopener noreferrer"
384+
className={`no-underline ${classes.linkButton}`}>
385+
<Button variant={"contained"} disableElevation className={`${classes.button} ${classes.solid}`} onClick={() => {}}>
386+
ดาวน์โหลดเกียรติบัตร
387+
</Button>
388+
</a>
389+
)}
390+
{!application.certificateDownloadLink && (
391+
<Typography variant="subtitle2" className={`${classes.text} ${classes.content}`} style={{ fontWeight: 500, color: "#941014" }}>
392+
ขอแสดงความเสียใจ น้องไม่ได้รับเกียรติบัตรในการเข้าร่วมค่ายลานเกียร์ครั้งนี้
393+
</Typography>
394+
)}
389395
</>
390396
)}
391397
</>

0 commit comments

Comments
 (0)