From 8081cceafa40ecb84779df0d9eb4555547d99b98 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Wed, 25 Jan 2023 12:02:29 +0700 Subject: Skeleton --- src/components/elements/Skeleton.js | 18 +++++ src/pages/my/transactions/[id].js | 135 +++++++++++++++++++----------------- 2 files changed, 90 insertions(+), 63 deletions(-) create mode 100644 src/components/elements/Skeleton.js diff --git a/src/components/elements/Skeleton.js b/src/components/elements/Skeleton.js new file mode 100644 index 00000000..843b200f --- /dev/null +++ b/src/components/elements/Skeleton.js @@ -0,0 +1,18 @@ +const SkeletonList = ({ number }) => ( +
+ { Array.from(Array(number), (e, i) => ( +
+
+
+
+
+
+
+ )) } + Loading... +
+); + +export { + SkeletonList +}; \ No newline at end of file diff --git a/src/pages/my/transactions/[id].js b/src/pages/my/transactions/[id].js index 79337a29..c56493ad 100644 --- a/src/pages/my/transactions/[id].js +++ b/src/pages/my/transactions/[id].js @@ -11,6 +11,7 @@ import currencyFormat from "@/core/utils/currencyFormat"; import Disclosure from "@/components/elements/Disclosure"; import DescriptionRow from "@/components/elements/DescriptionRow"; import { CustomerSection } from "@/components/transactions/TransactionDetail"; +import { SkeletonList } from "@/components/elements/Skeleton"; export default function DetailTransactions() { const router = useRouter(); @@ -44,79 +45,87 @@ export default function DetailTransactions() { - -
- - Pending Quotation - - - { transaction?.name } - - - { transaction?.po_name || '-' } - - - { transaction?.payment_term } - - - { transaction?.sales } - - - { transaction?.date_order } - -
+ + { transaction ? ( + <> +
+ + Pending Quotation + + + { transaction?.name } + + + { transaction?.po_name || '-' } + + + { transaction?.payment_term } + + + { transaction?.sales } + + + { transaction?.date_order } + +
- + - - -
- { transaction?.products?.map((product, index) => ( - - )) } -
-

Total Belanja

-

{ currencyFormat(transaction?.amount_total || 0) }

-
-
+
+ { transaction?.products?.map((product, index) => ( + + )) } +
+

Total Belanja

+

{ currencyFormat(transaction?.amount_total || 0) }

+
+
- - toggleSection('purchase')} - /> - { activeSection.purchase && ( - - ) } + - + toggleSection('purchase')} + /> + { activeSection.purchase && ( + + ) } - toggleSection('shipping')} - /> - { activeSection.shipping && ( - - ) } + - + toggleSection('shipping')} + /> + { activeSection.shipping && ( + + ) } + + - toggleSection('invoice')} - /> - { activeSection.invoice && ( - + toggleSection('invoice')} + /> + { activeSection.invoice && ( + + ) } + + ) : ( +
+ +
) }
-- cgit v1.2.3