login page, button not responding

i have added a button on my home page connected to a light box. nothing is changing on click neither it is logging out or opening the light box. please find the code below, appreciate your help :

import wixUsers from ‘wix-users’;
import wixWindow from ‘wix-window’;
import wixData from ‘wix-data’;

$w.onReady( () => {
if (wixUsers.currentUser.loggedIn) {$w(“#loginbutton”).label = “Logout”;}
else {
$w(“#loginbutton”).label = “Login”;
}
});

export function loginbutton_click(event) {

if (wixUsers.currentUser.loggedIn) {
// log the user out
wixUsers.logout()
.then( () => {
// update buttons accordingly
$w(“#loginbutton”).label = “Login”;
} );}

else {
wixWindow.openLightbox(“loginlightbox”);
}
}
// user is logged out

Hi,
The code looks fine, please share the editor’s URL so we can inspect.

Hi,
The button’s ID doesn’t match the ID in your code, check out this article about creating event.