Fakultas Ilmu Komputer UI

Commit 83b02253 authored by Muhammad Fairuzi Teguh's avatar Muhammad Fairuzi Teguh
Browse files

[REFACTOR] fix build fail caused by apexchart

parent c30bcf98
Pipeline #44944 passed with stages
in 2 minutes and 21 seconds
......@@ -17130,6 +17130,14 @@
"resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz",
"integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA=="
},
"react-loadable": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/react-loadable/-/react-loadable-5.5.0.tgz",
"integrity": "sha512-C8Aui0ZpMd4KokxRdVAm2bQtI03k2RMRNzOB+IipV3yxFTSVICv7WoUr5L9ALB5BmKO1iHgZtWM8EvYG83otdg==",
"requires": {
"prop-types": "^15.5.0"
}
},
"react-overlays": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/react-overlays/-/react-overlays-2.1.1.tgz",
......
......@@ -19,14 +19,15 @@
"inquirer": "^6.5.2",
"moment": "2.24.0",
"prop-types": "^15.7.2",
"react-apexcharts": "^1.3.7",
"react": "^16.13.0",
"react-apexcharts": "^1.3.7",
"react-bootstrap": "^1.0.0-beta.16",
"react-calendar": "^2.19.2",
"react-dom": "^16.13.0",
"react-google-login": "^5.1.1",
"react-helmet": "^5.2.1",
"react-hook-form": "^5.3.1",
"react-loadable": "^5.5.0",
"react-phone-input-2": "^2.12.0",
"react-query": "^1.2.7",
"react-use": "^14.0.0",
......
import React from "react"
import ReactApexChart from "react-apexcharts"
import Col from "react-bootstrap/Col"
import Row from "react-bootstrap/Row"
import { useQuery } from "react-query"
......@@ -8,6 +7,14 @@ import { apexOptions } from "../config"
import "./stokdonorchart.css"
import Spinner from "./spinner"
import ErrorRetry from "./error-retry"
import Loadable from "react-loadable"
const LoadableApexChart = Loadable({
loader: () => import("react-apexcharts"),
loading() {
return <Spinner />
},
})
export default function StokDonorChart() {
const { status, data, refetch, isFetching } = useQuery(
......@@ -33,7 +40,7 @@ export default function StokDonorChart() {
) : status === "error" ? (
<ErrorRetry retry={refetch} />
) : (
<ReactApexChart
<LoadableApexChart
options={apexOptions}
series={series}
type="bar"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment