Skip to content

Commit 249add2

Browse files
sagars2004RafaelCenzano
authored andcommitted
Update Home.tsx (minor fix for inbox)
1 parent 2760637 commit 249add2

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/shared/pages/Home.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ const Home = () => {
4242
preloadImg.src = darkLogo;
4343
}, []);
4444

45-
// Poll for dark-mode changes
45+
// Poll for darkmode changes
4646
useEffect(() => {
4747
const intervalId = setInterval(() => {
4848
setIsDarkMode(document.documentElement.classList.contains("dark"));
4949
}, 50);
5050
return () => clearInterval(intervalId);
5151
}, []);
5252

53-
// Scroll event to update "Return to Top" button visibility and position.
53+
// Scroll event for Return to Top button
5454
useEffect(() => {
5555
const handleScroll = () => {
5656
setShowReturnToTop(window.scrollY > 100);
@@ -109,17 +109,23 @@ const Home = () => {
109109

110110
{/* Welcome Section */}
111111
<section className="home-general text-center w-full relative">
112-
{/* Inbox button & popup wrapper */}
113-
<div ref={inboxRef} className="absolute top-4 right-4">
112+
{/* Inbox label + button locked top‑right */}
113+
<div
114+
ref={inboxRef}
115+
className="absolute top-4 right-4 flex items-center space-x-2 z-50"
116+
>
117+
<span className={`text-gray-800 dark:text-gray-200 font-medium ${showInbox ? "underline" : ""}`}>
118+
View Inbox
119+
</span>
114120
<button
115121
onClick={() => setShowInbox((v) => !v)}
116-
className="p-2 bg-white dark:bg-gray-800 rounded-full shadow hover:shadow-lg focus:outline-none"
122+
className="p-2 bg-white dark:bg-gray-800 rounded-full shadow hover:shadow-lg focus:outline-none border-2 border-black dark:border-white"
117123
>
118124
<FaEnvelope className="text-xl text-gray-700 dark:text-gray-200" />
119125
</button>
120126

121127
{showInbox && (
122-
<div className="mt-2 w-64 bg-white dark:bg-gray-800 shadow-lg rounded-lg overflow-hidden z-50">
128+
<div className="absolute top-full right-0 mt-2 w-64 bg-white dark:bg-gray-800 shadow-lg rounded-lg overflow-hidden">
123129
<div className="px-4 py-2 border-b border-gray-200 dark:border-gray-700">
124130
<strong className="text-gray-800 dark:text-gray-100">Inbox</strong>
125131
</div>

0 commit comments

Comments
 (0)