feat: move some UI stuff to UI class

This commit is contained in:
Oliver Booth 2023-08-10 14:19:11 +01:00
parent f989b4c02f
commit 085bdafda2
Signed by: oliverbooth
GPG Key ID: 725DB725A0D9EE61
2 changed files with 9 additions and 1 deletions

7
src/ts/UI.ts Normal file
View File

@ -0,0 +1,7 @@
class UI {
public static get blogPostContainer(): HTMLDivElement {
return document.querySelector("#all-blog-posts");
}
}
export default UI;

View File

@ -1,11 +1,12 @@
import API from "./API";
import TimeUtility from "./TimeUtility";
import UI from "./UI";
declare const bootstrap: any;
declare const katex: any;
(() => {
const blogPostContainer = document.querySelector("#all-blog-posts");
const blogPostContainer = UI.blogPostContainer;
if (blogPostContainer) {
API.getBlogPostCount().then(async (count) => {
for (let i = 0; i < count; i++) {