Skip to content

Instantly share code, notes, and snippets.

@m3l1nd4
Created May 19, 2021 03:12
Show Gist options
  • Save m3l1nd4/d86dde12fd526bf0a968d080831bd6cc to your computer and use it in GitHub Desktop.
Save m3l1nd4/d86dde12fd526bf0a968d080831bd6cc to your computer and use it in GitHub Desktop.
const threadsList = document.querySelector('.threads');
const signedInLinks = document.querySelectorAll('.signed-in');
const signedOutLinks = document.querySelectorAll('.signed-out');
const setUpUI = (user) => {
if (user) {
// Toggle UI Elements
signedInLinks.forEach(item => item.style.display = 'inline');
signedOutLinks.forEach(item => item.style.display = 'none');
} else {
// Toggle UI Elements
signedInLinks.forEach(item => item.style.display = 'none');
signedOutLinks.forEach(item => item.style.display = 'inline');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment