| 1 |
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; |
| 2 |
import { addFilter } from "@wordpress/hooks"; |
| 3 |
import React from "react"; |
| 4 |
import { createRoot } from "react-dom/client"; |
| 5 |
import { ToastContainer } from "react-toastify"; |
| 6 |
import QuickBuildWrapper from "./quickbuilder/QuickBuildWrapper"; |
| 7 |
import QuickSetupHeader from "./QuickSetupHeader"; |
| 8 |
|
| 9 |
import Field from "./fields/Field"; |
| 10 |
|
| 11 |
addFilter("custom_field", "BetterDocs", Field); |
| 12 |
|
| 13 |
const BetterDocsQuickSetupApp = () => { |
| 14 |
return ( |
| 15 |
<> |
| 16 |
<QuickSetupHeader /> |
| 17 |
<div className="betterdocs-settings-wrapper"> |
| 18 |
<QuickBuildWrapper /> |
| 19 |
</div> |
| 20 |
</> |
| 21 |
); |
| 22 |
}; |
| 23 |
|
| 24 |
const queryClient = new QueryClient(); |
| 25 |
|
| 26 |
// style |
| 27 |
import "../scss/setup-wizard.scss"; |
| 28 |
|
| 29 |
const quickSetupContainer = document.getElementById("betterdocsQuickSetupBuilder"); |
| 30 |
if (quickSetupContainer) { |
| 31 |
createRoot(quickSetupContainer).render( |
| 32 |
<QueryClientProvider client={queryClient}> |
| 33 |
<ToastContainer |
| 34 |
position="bottom-right" |
| 35 |
autoClose={3000} |
| 36 |
hideProgressBar={false} |
| 37 |
closeOnClick={true} |
| 38 |
pauseOnHover={true} |
| 39 |
draggable={true} |
| 40 |
progress={undefined} |
| 41 |
theme="colored" |
| 42 |
limit={4} |
| 43 |
/> |
| 44 |
<BetterDocsQuickSetupApp /> |
| 45 |
</QueryClientProvider> |
| 46 |
); |
| 47 |
} |
| 48 |
|