Skip to content

Commit d353ce9

Browse files
committed
📦 NEW: conditional rendering
1 parent 313ef7a commit d353ce9

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

components/Card.js

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,29 @@ const Card = ({ url, name, pod, github, linkedin, bio, project, openPopupboxForP
4343
</>
4444
)}
4545
</div>
46-
<div className={styles.read_more_btn}>
47-
<button onClick={() => openPopupboxForPod(bio)}>Read More</button>
48-
</div>
46+
{(pod === true && project === false && (
47+
<div className={styles.read_more_btn}>
48+
<button onClick={() => openPopupboxForPod(bio)}>Read More</button>
49+
</div>
50+
)) ||
51+
(pod === true && project === true && (
52+
<div className={styles.read_more_btn}>
53+
<Link href={github} passHref={true}>
54+
<a>
55+
<button>Read More</button>
56+
</a>
57+
</Link>
58+
</div>
59+
)) ||
60+
(pod === false && project === false && (
61+
<div className={styles.read_more_btn}>
62+
<Link href='https://www.khattak.dev/' passHref={true}>
63+
<a>
64+
<button>Read More</button>
65+
</a>
66+
</Link>
67+
</div>
68+
))}
4969
</div>
5070
);
5171
};

0 commit comments

Comments
 (0)