Merge pull request #104 from jadenkiu/main

WIP active discussion indication
This commit is contained in:
Saifeddine ALOUI 2023-04-21 07:30:54 +01:00 committed by GitHub
commit 2343b2484e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 3 deletions

View File

@ -36,6 +36,10 @@
}
}
.activeDiscussion {
background-color: #16a34a; /*Equivalent to bg-green-600*/
}
:root {
--color-primary-light: #ffffff;
--color-secondary-light: #f2f2f2;

View File

@ -156,14 +156,30 @@ function populate_discussions_list()
});
const discussionButton = document.createElement('button');
discussionButton.classList.add('bg-gray-400', 'hover:bg-gray-800', 'dark:hover:bg-gray-700', 'text-black', 'dark:text-white', 'font-bold', 'py-2', 'px-4', 'rounded', 'ml-2', 'w-full');
discussionButton.id = discussion.id;
discussionButton.classList.add('isButton', 'hover:bg-gray-800', 'dark:hover:bg-gray-700', 'text-black', 'dark:text-white', 'font-bold', 'py-2', 'px-4', 'rounded', 'ml-2', 'w-full');
discussionButton.textContent = discussion.title;
discussionButton.title = "Open discussion";
//WIP, NOT DONE
discussionButton.addEventListener('click', () => {
console.log(`Showing messages for discussion ${discussion.id}`);
load_discussion(discussion);
discussionButton.classList.add('activeDiscussion');
const btnElList = document.querySelectorAll('.isButton');
});
const btnElList = document.querySelectorAll('.isButton');
btnElList.forEach(btnEl => {
btnEl.addEventListener('click', () => {
console.log('Total: ' + btnElList.length + ' discussions');
btnEl.querySelector('activeDiscussion')?.classList.remove('activeDiscussion');
console.log('hm idk');
});
})
buttonWrapper.appendChild(renameButton);
buttonWrapper.appendChild(deleteButton);
@ -177,7 +193,6 @@ function populate_discussions_list()
});
}
function populate_menu(){
// adding export discussion button
const exportDiscussionButton = document.querySelector('#export-discussion-button');