Skip to content

Commit 919dec6

Browse files
authored
💄 Improve Dashboard Design (#117)
* refactor orders section * ✨ implement recent orders list * ✨ add trending products section refactor products section add new render functions * 💄 improve card ui * 💄 change default font to Inter * 💄 improve dashboard design for dark-mode * fix linting issues
1 parent bd379d4 commit 919dec6

32 files changed

+320
-175
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
<!-- End Google Tag Manager -->
140140
</head>
141141

142-
<body class="font-sans">
142+
<body class="font-inter">
143143
<!-- Google Tag Manager (noscript) -->
144144
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WBTQRDWN" height="0" width="0"
145145
style="display:none;visibility:hidden"></iframe></noscript>

locales/ar.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ dashboard:
9696
sells: المبيعات
9797
visits: الزيارات
9898
activeOrders: الطلبات النشطة
99+
recentOrders: الطلبات الأخيرة
100+
trendingProducts: المنتجات الرائجة
99101
categories:
100102
title: الفئات
101103
createButton: إنشاء

locales/ch.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ dashboard:
9898
sells: 销售
9999
visits: 访问
100100
activeOrders: 活跃订单
101+
recentOrders: 近期订单
102+
trendingProducts: 热门产品
101103
categories:
102104
title: 分类
103105
createButton: 创建

locales/de.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ dashboard:
9494
sells: Verkäufe
9595
visits: Besuche
9696
activeOrders: Aktive Bestellungen
97+
recentOrders: Aktuelle Bestellungen
98+
trendingProducts: Trendige Produkte
9799
categories:
98100
title: Kategorien
99101
createButton: Erstellen

locales/en.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ch: Chinese
1010
English: English
1111
Persian: Persian
1212
home: Home
13+
currencySign: $
1314
common:
1415
notFound: Not Found
1516
404Error: 404 Error
@@ -97,7 +98,9 @@ dashboard:
9798
products: Products
9899
sells: Sells
99100
visits: Visits
100-
activeOrders: ActiveOrders
101+
activeOrders: Active Orders
102+
recentOrders: Recent Orders
103+
trendingProducts: Trending Products
101104
categories:
102105
title: Categories
103106
createButton: Create

locales/fa.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ar: Arabic
88
de: German
99
ch: Chinese
1010
home: خانه
11+
currencySign: ريال
1112
common:
1213
notFound: پیدا نشد
1314
404Error: 404 خطای
@@ -63,6 +64,8 @@ dashboard:
6364
sells: فروش
6465
visits: بازدید ها
6566
activeOrders: سفارش های فعال
67+
recentOrders: سفارش های اخیر
68+
trendingProducts: محصولات پربازدید
6669
forgot:
6770
button: بازیابی
6871
haveNotAccount: اکانت ندارید؟

locales/tr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ dashboard:
9696
sells: Satışlar
9797
visits: Ziyaretler
9898
activeOrders: Aktif Siparişler
99+
recentOrders: Son siparişler
100+
trendingProducts: trend olan Ürünler
99101
categories:
100102
title: Kategoriler
101103
createButton: Oluştur

src/auto-imports.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ declare global {
9292
const refDefault: typeof import('@vueuse/core')['refDefault']
9393
const refThrottled: typeof import('@vueuse/core')['refThrottled']
9494
const refWithControl: typeof import('@vueuse/core')['refWithControl']
95+
const render: typeof import('./composables/render')['default']
9596
const resolveComponent: typeof import('vue')['resolveComponent']
9697
const resolveRef: typeof import('@vueuse/core')['resolveRef']
9798
const resolveUnref: typeof import('@vueuse/core')['resolveUnref']
@@ -229,6 +230,7 @@ declare global {
229230
const useOnline: typeof import('@vueuse/core')['useOnline']
230231
const useOptions: typeof import('./composables/options')['useOptions']
231232
const useOrderStore: typeof import('./store/order.store')['useOrderStore']
233+
const useOrders: typeof import('./composables/orders')['useOrders']
232234
const usePageLeave: typeof import('@vueuse/core')['usePageLeave']
233235
const useParallax: typeof import('@vueuse/core')['useParallax']
234236
const useParentElement: typeof import('@vueuse/core')['useParentElement']
@@ -247,6 +249,7 @@ declare global {
247249
const useProductStore: typeof import('./store/product.store')['useProductStore']
248250
const useRafFn: typeof import('@vueuse/core')['useRafFn']
249251
const useRefHistory: typeof import('@vueuse/core')['useRefHistory']
252+
const useRender: typeof import('./composables/render')['default']
250253
const useResizeObserver: typeof import('@vueuse/core')['useResizeObserver']
251254
const useReviewStore: typeof import('./store/review.store')['useReviewStore']
252255
const useRoute: typeof import('vue-router/auto')['useRoute']
@@ -415,6 +418,7 @@ declare module 'vue' {
415418
readonly refDefault: UnwrapRef<typeof import('@vueuse/core')['refDefault']>
416419
readonly refThrottled: UnwrapRef<typeof import('@vueuse/core')['refThrottled']>
417420
readonly refWithControl: UnwrapRef<typeof import('@vueuse/core')['refWithControl']>
421+
readonly render: UnwrapRef<typeof import('./composables/render')['default']>
418422
readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']>
419423
readonly resolveRef: UnwrapRef<typeof import('@vueuse/core')['resolveRef']>
420424
readonly resolveUnref: UnwrapRef<typeof import('@vueuse/core')['resolveUnref']>
@@ -551,6 +555,7 @@ declare module 'vue' {
551555
readonly useOnline: UnwrapRef<typeof import('@vueuse/core')['useOnline']>
552556
readonly useOptions: UnwrapRef<typeof import('./composables/options')['useOptions']>
553557
readonly useOrderStore: UnwrapRef<typeof import('./store/order.store')['useOrderStore']>
558+
readonly useOrders: UnwrapRef<typeof import('./composables/orders')['useOrders']>
554559
readonly usePageLeave: UnwrapRef<typeof import('@vueuse/core')['usePageLeave']>
555560
readonly useParallax: UnwrapRef<typeof import('@vueuse/core')['useParallax']>
556561
readonly useParentElement: UnwrapRef<typeof import('@vueuse/core')['useParentElement']>

src/common/api/api-service.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ export class ApiService {
2323
}
2424

2525
async getPagedList<T>(url = '', options: PagedAndSortedRequest = defaultOptions): Promise<PagedListResult<T>> {
26-
const skipCount = (options.page - 1) * options.itemsPerPage
27-
const maxResultCount = options.itemsPerPage
28-
const params = { skipCount, maxResultCount, ...options } as any
26+
const skipCount = (options.page - 1) * options.pageSize
27+
const params = { skipCount, ...options } as any
2928
const response = await this.httpClient.get<PagedListResult<T>>(`${this.apiBase}/${url}`, { params })
29+
response.data.pageCount = Math.ceil(response.data.totalCount / options.pageSize)
30+
options.itemCount = response.data.totalCount
31+
options.pageCount = response.data.pageCount
3032
return response.data as PagedListResult<T>
3133
}
3234

src/components.d.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,12 @@ declare module 'vue' {
3434
NBreadcrumb: typeof import('naive-ui')['NBreadcrumb']
3535
NBreadcrumbItem: typeof import('naive-ui')['NBreadcrumbItem']
3636
NButton: typeof import('naive-ui')['NButton']
37-
NCard: typeof import('naive-ui')['NCard']
3837
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
3938
NDataTable: typeof import('naive-ui')['NDataTable']
4039
NDialogProvider: typeof import('naive-ui')['NDialogProvider']
4140
NDrawer: typeof import('naive-ui')['NDrawer']
4241
NDrawerContent: typeof import('naive-ui')['NDrawerContent']
4342
NDropdown: typeof import('naive-ui')['NDropdown']
44-
NDynamicTags: typeof import('naive-ui')['NDynamicTags']
4543
NForm: typeof import('naive-ui')['NForm']
4644
NFormItem: typeof import('naive-ui')['NFormItem']
4745
NIcon: typeof import('naive-ui')['NIcon']
@@ -51,25 +49,24 @@ declare module 'vue' {
5149
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
5250
NMenu: typeof import('naive-ui')['NMenu']
5351
NMessageProvider: typeof import('naive-ui')['NMessageProvider']
54-
NModal: typeof import('naive-ui')['NModal']
5552
NNotificationProvider: typeof import('naive-ui')['NNotificationProvider']
5653
Notifications: typeof import('./components/Notifications.vue')['default']
5754
NPageHeader: typeof import('naive-ui')['NPageHeader']
5855
NPopselect: typeof import('naive-ui')['NPopselect']
59-
NSelect: typeof import('naive-ui')['NSelect']
6056
NSpace: typeof import('naive-ui')['NSpace']
61-
NSwitch: typeof import('naive-ui')['NSwitch']
6257
NTooltip: typeof import('naive-ui')['NTooltip']
6358
NTreeSelect: typeof import('naive-ui')['NTreeSelect']
64-
NUpload: typeof import('naive-ui')['NUpload']
6559
OrderManagement: typeof import('./components/Orders/OrderManagement.vue')['default']
6660
PersianIcon: typeof import('./components/CountryIcons/PersianIcon.vue')['default']
6761
ProductsManagement: typeof import('./components/Products/ProductsManagement.vue')['default']
62+
RecentOrders: typeof import('./components/Dahboard/RecentOrders.vue')['default']
63+
RecentReviews: typeof import('./components/Dahboard/RecentReviews.vue')['default']
6864
ReviewManagement: typeof import('./components/Review/ReviewManagement.vue')['default']
6965
RouterLink: typeof import('vue-router')['RouterLink']
7066
RouterView: typeof import('vue-router')['RouterView']
7167
Sidebar: typeof import('./components/Sidebar.vue')['default']
7268
ThemeSwitch: typeof import('./components/ThemeSwitch.vue')['default']
69+
TrendingProducts: typeof import('./components/Dahboard/TrendingProducts.vue')['default']
7370
TurkishIcon: typeof import('./components/CountryIcons/TurkishIcon.vue')['default']
7471
UserProfile: typeof import('./components/UserProfile.vue')['default']
7572
}

0 commit comments

Comments
 (0)