Skip to content

Commit 203a5a1

Browse files
committed
working on light and dark mode
1 parent 49c9c6d commit 203a5a1

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/components/Navbar.jsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -123,23 +123,23 @@ function Navbar({ loggedin }) {
123123
</ul>
124124
</li>
125125
</ul>
126-
126+
<span className="me-3">
127+
<button
128+
className="btn clk rounded-circle"
129+
onClick={toggleTheme}
130+
data-bs-toggle="tooltip"
131+
title={`Switch to ${theme === 'light' ? 'Dark' : 'Light'} Mode`}
132+
>
133+
{theme === 'light' ? (
134+
<i className="fa-solid fa-moon"></i>
135+
) : (
136+
<i className="fa-solid fa-sun"></i>
137+
)}
138+
</button>
139+
</span>
127140
{loggedin === 'true' ? (
128141
<div className="d-flex align-items-center flex-column flex-lg-row">
129-
<span className="me-3">
130-
<button
131-
className="btn clk rounded-circle"
132-
onClick={toggleTheme}
133-
data-bs-toggle="tooltip"
134-
title={`Switch to ${theme === 'light' ? 'Dark' : 'Light'} Mode`}
135-
>
136-
{theme === 'light' ? (
137-
<i className="fa-solid fa-moon"></i>
138-
) : (
139-
<i className="fa-solid fa-sun"></i>
140-
)}
141-
</button>
142-
</span>
142+
143143
<div className="me-2 mb-2 mb-lg-0 position-relative">
144144
<form className="input-group" onSubmit={handleSearchSubmit}>
145145
<span className="input-group-text" id="basic-addon1">

0 commit comments

Comments
 (0)