I have something in mind which i cant preform yet , currently am watching the wix courses about wix code , but here’s what i have in mind
i added a lightbox to the blog page saying
join us in our members page so you can receive any update !
and below is a button which takes you directly to login/signup page
what i want to do is add a boolean which is true when the user is logged in / signedup or already a member in the site
then if the boolean is true , then don’t show the lightbox
if not show it then
i hope that someone would answer this , and i’ll post an answer once i know it
Hi,
You can use wix-users to check if a user is of role ‘visitor’ or ‘member’.
See more info here
Note that users who are signed up but not logged in will still return the ‘visitor’ type
import wixUsers from 'wix-users';
let user = wixUsers.currentUser;
let isLoggedIn = user.loggedIn; // true
let userRole = user.role; //'Visitor'
if (userRole === 'Visitor') {
//Add show lightbox code here
}
Thank you very much!