* Add base history support * Add tags and ranking and make it work * Fix styling * Add article title and text excerpt to the index * Add pagination support * Debounce the search to 300ms * Show history only to pro users * Use routing helpers instead of hardcoding * Raise the page size to 100 * Remove console log * A bit of regrouping
22 lines
525 B
JavaScript
22 lines
525 B
JavaScript
import { h, render } from 'preact';
|
|
import { getUserDataAndCsrfToken } from '../chat/util';
|
|
import { History } from '../history/history';
|
|
|
|
function loadComponent() {
|
|
getUserDataAndCsrfToken().then(({ currentUser }) => {
|
|
const root = document.getElementById('history');
|
|
if (root) {
|
|
render(
|
|
<History availableTags={currentUser.followed_tag_names} />,
|
|
root,
|
|
root.firstElementChild,
|
|
);
|
|
}
|
|
});
|
|
}
|
|
|
|
window.InstantClick.on('change', () => {
|
|
loadComponent();
|
|
});
|
|
|
|
loadComponent();
|