Refactor Navbar component to simplify button class names by removing conditional logic for styling. This improves readability and maintains consistent styling for logout buttons based on user state.

This commit is contained in:
iamkiddy 2025-11-23 21:58:14 +00:00
parent 37531f2b2b
commit 43d0eae01f

View File

@ -133,13 +133,7 @@ export function Navbar() {
<Button <Button
size="sm" size="sm"
variant="outline" variant="outline"
className={`hover:opacity-90 hover:scale-105 transition-all text-xs sm:text-sm ${ className="bg-red-600 hover:bg-red-700 text-white border-red-600 hover:border-red-700 hover:opacity-90 hover:scale-105 transition-all text-xs sm:text-sm"
isUserRoute
? 'bg-red-600 hover:bg-red-700 text-white border-red-600 hover:border-red-700'
: isDark
? 'border-gray-700 text-gray-300 hover:bg-gray-800'
: ''
}`}
onClick={handleLogout} onClick={handleLogout}
> >
<LogOut className="w-4 h-4 mr-2" /> <LogOut className="w-4 h-4 mr-2" />
@ -243,13 +237,7 @@ export function Navbar() {
{isAuthenticated && ( {isAuthenticated && (
<Button <Button
variant="outline" variant="outline"
className={`w-full justify-start text-sm sm:text-base ${ className="w-full justify-start text-sm sm:text-base bg-red-600 hover:bg-red-700 text-white border-red-600 hover:border-red-700"
isUserRoute
? 'bg-red-600 hover:bg-red-700 text-white border-red-600 hover:border-red-700'
: isDark
? 'border-gray-700 text-gray-300 hover:bg-gray-800'
: ''
}`}
onClick={() => { onClick={() => {
handleLogout(); handleLogout();
}} }}