diff --git a/index.html b/index.html
index 76dbd66..2a989cb 100644
--- a/index.html
+++ b/index.html
@@ -114,7 +114,7 @@
마켓로그
-
+
diff --git a/public/spinner.svg b/public/spinner.svg
new file mode 100644
index 0000000..bcfba2c
--- /dev/null
+++ b/public/spinner.svg
@@ -0,0 +1,52 @@
+
+
\ No newline at end of file
diff --git a/src/js/main.js b/src/js/main.js
index e70274d..927a58b 100644
--- a/src/js/main.js
+++ b/src/js/main.js
@@ -1,4 +1,5 @@
import Navigo from 'navigo';
+import { $ } from './utils/dom.js';
import { htmlMypage_Nav, renderMyPageNav } from './page/mypage.js';
import { htmlMypage_Account, initFuncAccount } from './page/mypage/account';
// import { htmlMypage_MyHeart, initFuncMyHeart } from './page/mypage/wishlist';
@@ -38,9 +39,8 @@ import {
orderDetailPage,
} from './page/admin/renderTemplate';
-const $ = (selector) => document.querySelector(selector);
export const router = new Navigo('/');
-const divLoadingEl = $('.loadingGif');
+export const divLoadingEl = $('.loadingGif');
function getLoginStatus() {
return localStorage.getItem('token') ? true : false;
diff --git a/src/js/page/admin/dashboard.js b/src/js/page/admin/dashboard.js
index 62a6052..b7fdb0d 100644
--- a/src/js/page/admin/dashboard.js
+++ b/src/js/page/admin/dashboard.js
@@ -5,9 +5,12 @@ import {
import { getAllOrder, getAllProducts } from '../../api.js';
import { formatPrice } from '../../utils/format.js';
import Chart from 'chart.js/auto';
+import { divLoadingEl } from '../../main.js';
/** 대시보드 페이지 핸들러 */
export const dashboardHandler = async () => {
+ divLoadingEl.style.display = 'block';
+
let orders = await getAllOrder();
let products = await getAllProducts();
@@ -16,6 +19,7 @@ export const dashboardHandler = async () => {
renderDashboardChart();
setDashBoardChartCategory(products);
setDashBoardChartAmount(orders);
+ divLoadingEl.style.display = 'none';
};
/** 거래 카테고리 통계 chart 생성 */
diff --git a/src/js/page/mainPage/mainPage.js b/src/js/page/mainPage/mainPage.js
index 22c32b8..2417c29 100644
--- a/src/js/page/mainPage/mainPage.js
+++ b/src/js/page/mainPage/mainPage.js
@@ -124,6 +124,5 @@ $('.app').addEventListener('click', (e) => {
/** router on '/' 핸들링 함수 */
export const handleMainPage = () => {
$('.modal__addCart').style.display = 'none';
- console.log('/ route is working');
renderPage(renderMainPageTemplate);
};