summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/api/rajaOngkirApi.js15
-rw-r--r--src/core/components/elements/Popup/BottomPopup.jsx16
2 files changed, 25 insertions, 6 deletions
diff --git a/src/core/api/rajaOngkirApi.js b/src/core/api/rajaOngkirApi.js
new file mode 100644
index 00000000..3faa3210
--- /dev/null
+++ b/src/core/api/rajaOngkirApi.js
@@ -0,0 +1,15 @@
+import axios from 'axios'
+
+const rajaOngkir = async (method, url, body) => {
+ let axiosParameter = {
+ method,
+ url: process.env.NEXT_PUBLIC_RAJA_ONGKIR_HOST + url,
+ headers: { key: process.env.NEXT_PUBLIC_RAJA_ONGKIR_KEY },
+ data : body
+ }
+ const dataOngkir = await axios(axiosParameter)
+
+ return dataOngkir
+}
+
+export default rajaOngkir \ No newline at end of file
diff --git a/src/core/components/elements/Popup/BottomPopup.jsx b/src/core/components/elements/Popup/BottomPopup.jsx
index 80afa8d9..0f4088d4 100644
--- a/src/core/components/elements/Popup/BottomPopup.jsx
+++ b/src/core/components/elements/Popup/BottomPopup.jsx
@@ -39,9 +39,11 @@ const BottomPopup = ({ children, active = false, title, close, className = '' })
>
<div className='flex justify-between py-4'>
<div className='font-semibold text-h-sm'>{title}</div>
- <button type='button' onClick={close}>
- <XMarkIcon className='w-5 stroke-2' />
- </button>
+ {close && (
+ <button type='button' onClick={close}>
+ <XMarkIcon className='w-5 stroke-2' />
+ </button>
+ )}
</div>
{children}
</motion.div>
@@ -57,9 +59,11 @@ const BottomPopup = ({ children, active = false, title, close, className = '' })
>
<div className='flex justify-between py-4'>
<div className='font-semibold text-h-sm'>{title}</div>
- <button type='button' onClick={close}>
- <XMarkIcon className='w-5 stroke-2' />
- </button>
+ {close && (
+ <button type='button' onClick={close}>
+ <XMarkIcon className='w-5 stroke-2' />
+ </button>
+ )}
</div>
{children}
</motion.div>