Skip to content

Commit 87f2e06

Browse files
Ibraheem AhmedIbraheem Ahmed
Ibraheem Ahmed
authored and
Ibraheem Ahmed
committed
remove NavLinks component and move the code into SiteNav
1 parent 9a4b496 commit 87f2e06

File tree

4 files changed

+70
-54
lines changed

4 files changed

+70
-54
lines changed

src/components/SiteNav/index.astro

+47-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,34 @@
11
---
22
import { Icon } from 'astro-icon/components';
3-
import SiteNavLinks from '../SiteNavLinks/index.astro';
3+
import { Image } from 'astro:assets';
4+
import logo from '../../assets/icons/logo.svg';
45
import './styles.css';
6+
const BLOG_URL = Astro.site?.href;
57
---
68

79
<nav id="desktop-navigation" aria-label="Main blog navigation">
8-
<SiteNavLinks />
10+
<ul class="nav-links">
11+
<li>
12+
<a href={BLOG_URL}>
13+
<Image src={logo} class="logo-rounded" alt="TorontoJS Logo!" height={70} width={70} />
14+
</a>
15+
</li>
16+
<li>
17+
<a href={`${BLOG_URL}accessibility`}>
18+
Accessibility
19+
</a>
20+
</li>
21+
<li>
22+
<a href={`${BLOG_URL}license`}>
23+
License
24+
</a>
25+
</li>
26+
<li>
27+
<a href={`${BLOG_URL}about`}>
28+
About
29+
</a>
30+
</li>
31+
</ul>
932
</nav>
1033

1134
<div id="mobile-navigation">
@@ -23,6 +46,27 @@ import './styles.css';
2346
id="close-icon" name="mdi:close" title="Close Icon" width={70} height={70}
2447
/>
2548
</button>
26-
<SiteNavLinks />
49+
<ul class="nav-links">
50+
<li>
51+
<a href={BLOG_URL}>
52+
<Image src={logo} alt="TorontoJS Logo!" height={70} width={70} class="logo-rounded" />
53+
</a>
54+
</li>
55+
<li>
56+
<a href={`${BLOG_URL}accessibility`}>
57+
Accessibility
58+
</a>
59+
</li>
60+
<li>
61+
<a href={`${BLOG_URL}license`}>
62+
License
63+
</a>
64+
</li>
65+
<li>
66+
<a href={`${BLOG_URL}about`}>
67+
About
68+
</a>
69+
</li>
70+
</ul>
2771
</nav>
2872
</div>

src/components/SiteNav/styles.css

+23-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@
44
padding: var(--size-2);
55
}
66

7+
.nav-links {
8+
gap: var(--size-2);
9+
align-items: center;
10+
list-style: none;
11+
display: flex;
12+
padding: var(--size-3)
13+
}
14+
15+
.nav-links a {
16+
color: white;
17+
}
18+
19+
#logo-rounded {
20+
border-radius: var(--size-2);
21+
}
22+
723
#hamburger-button {
824
background-color: transparent;
925
padding: var(--size-3)
@@ -34,7 +50,7 @@
3450
padding: var(--size-2);
3551
}
3652

37-
@media (max-width: 31.25rem) {
53+
@media (max-width: 32rem) {
3854
#mobile-navigation {
3955
display: block;
4056
text-align: right;
@@ -44,3 +60,9 @@
4460
display: none;
4561
}
4662
}
63+
64+
@media (max-width: 32rem) {
65+
.nav-links {
66+
flex-direction: column;
67+
}
68+
}

src/components/SiteNavLinks/index.astro

-29
This file was deleted.

src/components/SiteNavLinks/styles.css

-21
This file was deleted.

0 commit comments

Comments
 (0)