import('#/lib/threed/components/controls/ControlPanels'), { ssr: false })
-
-// ** ThreeD Toolbar
-import ThreeDToolbar from '#//lib/threed/components/controls/Toolbar'
-
-
-
-const ThreeDControls = () => {
-
- // ** THREED CONTROL(S)
- console.debug('THREED CONTROL(S)')
- return (
- <>
- {/* ThreeD Controls
*/}
-
- >
- )
-}
-
-export default ThreeDControls
diff --git a/src/lib/threed/components/controls/LevaControls.tsx b/src/lib/threed/components/controls/LevaControls.tsx
index afd4a2211..a83a7067f 100644
--- a/src/lib/threed/components/controls/LevaControls.tsx
+++ b/src/lib/threed/components/controls/LevaControls.tsx
@@ -404,7 +404,7 @@ export function ThreeDLevaControls() {
// hideTitleBar={true} // default = false. true hides the GUI header
theme={theme} // you can pass a custom theme (see the styling section)
collapsed={false} // default = false. true makes the GUI collapsed to start
- fill={true} // default = false. true makes the pane fill the parent dom node it's rendered in
+ fill={false} // default = false. true makes the pane fill the parent dom node it's rendered in
flat={true} // default = false. true removes border radius and shadow
hidden={false} // default = false. true hides the GUI
neverHide={true} // default = true. false allows hiding of the GUI
@@ -437,42 +437,54 @@ export function ThreeDLevaControls() {
)
}
-export const ThreeDLevaComponent = ({ projectName, setProjectName }) => {
+export const ThreeDLevaComponent = (
+ {
+ projectName,
+ setProjectName,
+ projectNameFromLeva,
+ setProjectNameFromLeva,
+ }:
+ {
+ projectName: string,
+ setProjectName: Function,
+ projectNameFromLeva: string,
+ setProjectNameFromLeva: Function,
+ }
+) => {
// **
const word = `[MM] ThreeDLevaComponent @ ${new Date().toISOString()}`
// **
- // var [{ projectNameFromLeva }, set] = useControls(
+ // const [{ projectNameFromLeva }, set] = useControls(
// () => (
// {
- // // projectNameFromLeva: projectName,
// projectName: projectName,
- // doAutoLoadData: doAutoLoadData,
- // doAutoRotate: doAutoRotate,
+ // projectNameFromLeva: projectName,
// word: word,
// }
// )
// )
- // // ** onMount (on component loaded)
- // useEffect(() => {
- // // leva set store (from react state)
- // set({ projectNameFromLeva: projectName })
- // // react set state
- // setProjectName(projectName)
- // // **
- // }, [projectName, set])
- // // }, [projectName])
-
- // // console.debug('MyComponent')
- // useEffect(() => {
- // setProjectName(projectName)
- // // console.debug('MyComponent onMount')
- // // return () => {
- // // console.debug('MyComponent onUnmount')
- // // }
- // }, [projectName])
-
- // return {projectNameFromLeva}: {projectName}
+ // ** onMount (on component loaded)
+ useEffect(() => {
+ // react set state
+ // setProjectName(projectName)
+ setProjectName(projectNameFromLeva)
+ // leva set store (from react state)
+ setProjectNameFromLeva(projectName)
+ // setProjectNameFromLeva(projectNameFromLeva)
+ // **
+ }, [projectName, projectNameFromLeva])
+
+ return (
+ <>
+ {/*
+ {projectNameFromLeva}: {projectName}
+
+
+ {projectName}: {projectNameFromLeva}
+
*/}
+ >
+ )
}
export default ThreeDLevaControls
diff --git a/src/lib/threed/components/controls/Toolbar.tsx b/src/lib/threed/components/controls/Toolbar.tsx
index ccd4c3928..b84764d57 100644
--- a/src/lib/threed/components/controls/Toolbar.tsx
+++ b/src/lib/threed/components/controls/Toolbar.tsx
@@ -1102,7 +1102,10 @@ const ThreeDToolbar: FC = (): React.ReactNode => {
import('#/lib/threed/components/controls/ControlPanels'), { ssr: false })
+
+// ** ThreeD Toolbar
+import ThreeDToolbar from '#/lib/threed/components/controls/Toolbar'
+
+// ** ThreeD : JSX Export
+// export default
+const ThreeDControls = () => {
+
+ // ** THREED CONTROL(S)
+ // console.debug('THREED CONTROL[S]: ALL')
+ return (
+ <>
+
+
+
+
+ (<>>)}
+ projectNameFromLeva={'ThreeD: MM projectName'}
+ setProjectNameFromLeva={() => (<>>)}
+ />
+ {/* ThreeD Control[s]: All
*/}
+ >
+ )
+}
+
+export default ThreeDControls