1seok2

refactor: simply render app

......@@ -13,7 +13,7 @@ import { getState } from "@src/store/state";
import "./assets/style/App.scss";
import { getElement } from "./components/functions";
export default function App(pathname: string): string {
function App(pathname: string): string {
/* id 없을 시 id 입력으로 redirect */
if (!getState().insta_id) pathname = "";
history.pushState("", "", pathname);
......@@ -27,7 +27,7 @@ export default function App(pathname: string): string {
`;
}
export function renderApp(pathname: string): void {
export default function renderApp(pathname: string): void {
const $App = getElement("#App") as HTMLDivElement;
$App.innerHTML = App(pathname);
......
import { randomTransition } from "@src/components/page.transition";
import { renderApp } from "@src/App";
import renderApp from "@src/App";
import {
getElement,
pendingFetch,
......
......@@ -2,7 +2,7 @@ import { BASE_URL } from "@src/config/url";
import { setState } from "@src/store/state";
import { togglePageLoader } from "@src/components/page.loader";
import { randomTransition } from "@src/components/page.transition";
import { renderApp } from "@src/App";
import renderApp from "@src/App";
export function formatNumber(number: number): string {
if (`${number}`.length > 6) {
......
......@@ -13,7 +13,7 @@ import addEventWithElementByType from "@src/components/add.event";
import { getPathname } from "@src/components/functions";
import { linkEvent } from "@src/components/event.list";
import { renderApp } from "./App";
import renderApp from "./App";
window.addEventListener("DOMContentLoaded", () => {
createLoaderElement();
......
......@@ -6,7 +6,7 @@
import "@src/assets/style/Header.scss";
import { renderApp } from "@src/App";
import renderApp from "@src/App";
import addEventWithElementByType from "@src/components/add.event";
import { handleFetchById } from "@src/components/event.list";
......