feat: move some UI stuff to UI class
This commit is contained in:
parent
f989b4c02f
commit
085bdafda2
7
src/ts/UI.ts
Normal file
7
src/ts/UI.ts
Normal file
@ -0,0 +1,7 @@
|
||||
class UI {
|
||||
public static get blogPostContainer(): HTMLDivElement {
|
||||
return document.querySelector("#all-blog-posts");
|
||||
}
|
||||
}
|
||||
|
||||
export default UI;
|
@ -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++) {
|
||||
|
Loading…
Reference in New Issue
Block a user