Skip to content

Commit fb7b92e

Browse files
authored
Merge pull request #1060 from kanishka-commits/ui/nav
[FIX]: #1017 Hamburger Menu Appears but Doesn't Display Content Between 1300px and 996px Screen Width
2 parents 2bcdbde + c2d41c1 commit fb7b92e

File tree

3 files changed

+33
-41
lines changed

3 files changed

+33
-41
lines changed

sidebars.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ const sidebars: SidebarsConfig = {
112112
"python/Data_Structures/python-linked-list",
113113
"python/Data_Structures/python-stack",
114114
"python/Data_Structures/python-queue",
115-
]
116-
}
115+
],
116+
},
117117
],
118118
},
119119
{

src/components/ui/FirebaseAuthGithub.tsx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,29 @@ const uiConfig = {
1717

1818
const FirebaseAuthGithub: React.FC = () => {
1919
const [user, setUser] = useState<User | null>(null);
20+
const [githubText, setGithubText] = useState("Sign in with GitHub"); // ✅ new state
2021

2122
useEffect(() => {
2223
const unregisterAuthObserver = auth.onAuthStateChanged((user) =>
2324
setUser(user as User),
2425
);
25-
return () => unregisterAuthObserver();
26+
27+
// ✅ new effect to change text on resize
28+
const handleResize = () => {
29+
if (window.innerWidth <= 1110) {
30+
setGithubText("Sign in");
31+
} else {
32+
setGithubText("Sign in with GitHub");
33+
}
34+
};
35+
36+
handleResize(); // initial call
37+
window.addEventListener("resize", handleResize);
38+
39+
return () => {
40+
unregisterAuthObserver();
41+
window.removeEventListener("resize", handleResize);
42+
};
2643
}, []);
2744

2845
if (user) {
@@ -88,7 +105,8 @@ const FirebaseAuthGithub: React.FC = () => {
88105
>
89106
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.65 7.65 0 0 1 2-.27c.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z" />
90107
</svg>
91-
<span className="github-text">Sign in with GitHub</span>
108+
{/* ✅ dynamic text */}
109+
<span className="github-text">{githubText}</span>
92110
</button>
93111
</div>
94112
);

src/css/custom.css

Lines changed: 11 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -474,10 +474,14 @@ body {
474474
}
475475

476476
/* ===== SECTION 11: CRITICAL FIX: TABLET/IPAD NAVBAR BEHAVIOR ===== */
477-
@media screen and (max-width: 1299px) {
478-
477+
@media screen and (max-width: 996px) {
479478
/* Hide TOP navbar items on mobile (not sidebar) */
480-
.navbar__items .navbar__item:not(.navbar__toggle):not(.navbar__brand) {
479+
480+
/*
481+
* This hides all navbar items on small screens, *except* for the
482+
* toggle, brand, and the item :has() the GitHub auth button.
483+
*/
484+
.navbar__items .navbar__item:not(.navbar__toggle):not(.navbar__brand):not(:has(#firebase-auth-github-navbar)) {
481485
display: none !important;
482486
}
483487

@@ -1484,7 +1488,7 @@ html {
14841488
margin-left: auto !important;
14851489
display: flex !important;
14861490
align-items: center !important;
1487-
gap: 0.5rem !important;
1491+
/* gap: 0.5rem !important; */
14881492
flex-shrink: 0 !important;
14891493
}
14901494

@@ -1764,38 +1768,8 @@ html[data-theme="light"] [data-slot="card-header"].bg-gradient-to-br {
17641768
mix-blend-mode: normal !important;
17651769
}
17661770

1767-
/* ================= SECTION 15: AUTHOR PAGE AVATAR OVERLAP FIX ================= */
1768-
/* Fix for author page avatar overlap - working solution */
1769-
.avatar.margin-bottom--sm.author-as-h1_iMAg {
1770-
width: 150px !important;
1771-
height: 150px !important;
1772-
border-radius: 50% !important;
1773-
border: none !important;
1774-
}
1775-
1776-
/* Additional avatar class fix */
1777-
/* .avatar.margin-bottom--sm {
1778-
width: 40px !important;
1779-
height: 40px !important;
1780-
border-radius: 50% !important;
1781-
border: none !important; */
1782-
/* } */
1783-
/*
1784-
/* Author name styling fix */
1785-
/* .authorName_w5sO {
1786-
font-size: 1.1rem !important;
1787-
line-height: 1.1rem !important;
1788-
display: block !important;
1789-
flex-direction: column !important;
1790-
} */
1791-
1792-
.avatar.margin-bottom--sm {
1793-
width: auto !important;
1794-
height: auto !important;
1795-
border: none !important;
1771+
@media screen and (max-width: 1110px) {
1772+
.navbar__items{
1773+
gap: 0.1rem !important;
17961774
}
1797-
1798-
1799-
.blog-page .margin-bottom--xl {
1800-
margin-bottom: 0rem !important;
18011775
}

0 commit comments

Comments
 (0)