forked from Yoast/javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWizardWrapper.js
More file actions
32 lines (26 loc) · 784 Bytes
/
WizardWrapper.js
File metadata and controls
32 lines (26 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import React from "react";
import Config from "../../packages/configuration-wizard/tools/config/production-config";
import apiConfig from "../../packages/configuration-wizard/tools/config/api-config";
import { default as Wizard } from "@yoast/configuration-wizard";
/**
* Returns a deep clone of an object.
*
* @param {object} object The object to clone.
*
* @returns {object} The cloned object.
*/
function cloneDeep( object ) {
return JSON.parse( JSON.stringify( object ) );
}
/**
* The wizard component.
*
* @returns {React.component} A wizard.
*/
const WizardWrapper = () => {
const config = cloneDeep( Config );
config.customComponents = Config.customComponents;
config.endpoint = apiConfig;
return <Wizard { ...config } />;
};
export default WizardWrapper;