Skip to content

Commit 5d1dd8e

Browse files
blog button added
1 parent 28643db commit 5d1dd8e

File tree

3 files changed

+56
-15
lines changed

3 files changed

+56
-15
lines changed

public/data.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@
181181
}
182182
],
183183
"blogs": [
184+
{
185+
"name": "KASHICTF 2025 writeups",
186+
"link": "https://github.com/E-HAX/writeups/tree/main/2025/kashictf"
187+
},
184188
{
185189
"name": "BITSCTF 2025 writeups",
186190
"link": "https://github.com/E-HAX/writeups/tree/main/2025/bitsctf"

src/app/components/tabs/BlogTab.module.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,31 @@
4343
color: var(--background);
4444
padding: 4px;
4545
text-decoration: none;
46+
}
47+
48+
49+
.blogTop {
50+
color: var(--background);
51+
background: var(--text);
52+
padding: 8px;
53+
margin-bottom: 18px;
54+
position: relative;
55+
}
56+
.blogTop p {
57+
font-size: 14px;
58+
margin-top: 4px;
59+
margin-bottom: 12px;
60+
}
61+
.blogTop a {
62+
padding: 5px 8px;
63+
text-decoration: none;
64+
background: var(--background);
65+
color: var(--text);
66+
margin-top: 10px;
67+
border-radius: 4px;
68+
}
69+
70+
.blogTop:hover {
71+
transform: scale(1.01);
72+
cursor: pointer;
4673
}

src/app/components/tabs/BlogTab.tsx

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,35 @@
11
import { AppContext } from "@/app/context/AppContext";
22
import React, { useContext } from "react";
3-
import styles from "./BlogTab.module.css"
3+
import styles from "./BlogTab.module.css";
44

55
const BlogTab = () => {
6-
const { data } = useContext(AppContext)
6+
const { data } = useContext(AppContext);
77
const { blogs } = data;
8-
8+
99
return (
1010
<div>
11-
{
12-
blogs ?
13-
blogs.map(blog => (
14-
<div key={blog.name} className={styles.blog}>
15-
<h4>{blog.name}</h4>
16-
<p>{blog.about}</p>
17-
<a href={blog.link} target="___blank">Read More</a>
18-
</div>
19-
))
20-
:
21-
<p className={styles.text}>No events yet</p>
22-
}
11+
<div className={styles.blogTop}>
12+
<h4>EHAX Blogs</h4>
13+
<p>Full blogs from EHAX {":)"}</p>
14+
<a href="/blog" target="___blank">
15+
View All
16+
</a>
17+
</div>
18+
<>
19+
{blogs ? (
20+
blogs.map((blog) => (
21+
<div key={blog.name} className={styles.blog}>
22+
<h4>{blog.name}</h4>
23+
<p>{blog.about}</p>
24+
<a href={blog.link} target="___blank">
25+
Read More
26+
</a>
27+
</div>
28+
))
29+
) : (
30+
<p className={styles.text}>No events yet</p>
31+
)}
32+
</>
2333
</div>
2434
);
2535
};

0 commit comments

Comments
 (0)