diff --git a/src/app/participate/page.tsx b/src/app/participate/page.tsx index 4775c2e99..50215d972 100644 --- a/src/app/participate/page.tsx +++ b/src/app/participate/page.tsx @@ -27,14 +27,20 @@ import { // import Typography from '@mui/material/Typography' // import CardContent from '@mui/material/CardContent' -// ** THREED GARDEN Imports -// import ThreeDGarden from '#/lib/threed/ThreeDGarden' -const ThreeDGarden = dynamic(() => import('#/lib/threed/ThreeDGarden'), { ssr: false }) +// ** THREED Imports +// import ThreeD from '~/src/lib/threed/threed' +const ThreeD = dynamic(() => import('#/lib/threed/threed'), { ssr: false }) +// import ThreeDControls from '~/src/lib/threed/Controls' +// const ThreeDControls = dynamic(() => import('#/lib/threed/Controls'), { ssr: false }) +// import ThreeDGarden from '~/src/lib/threed/ThreeDGarden' +// const ThreeDGarden = dynamic(() => import('#/lib/threed/ThreeDGarden'), { ssr: false }) +// import ThreeDControls from '#/lib/threed/components/controls/Controls' +// const ThreeDControls = dynamic(() => import('#/lib/threed/components/controls/Controls'), { ssr: false }) // ** HELPER Imports -// // import Spinner from '#/layout/ui/spinner' +import Spinner from '#/layout/ui/spinner' // ** HELPFUL UTIL: COLORFUL CONSOLE MESSAGES (ccm) -import ccm from '#/lib/utils/console-colors' +// import ccm from '#/lib/utils/console-colors' const ParticipatePage: TNextPageWithProps = (): JSX.Element => { // const ParticipatePage: TNextPageWithProps = async () => { @@ -67,7 +73,7 @@ const ParticipatePage: TNextPageWithProps = (): JSX.Element => { return ( <> - {/* }> */} + }> { > {/* [MM] HEY HEY HEY -- ThreeDGarden Component */} - + + {/* */} + {/* */} {/* [MM] HEY HEY HEY -- End ThreeDGarden Component */} - {/* {ability?.can('read', 'analytics') && ( */} - {/* { + { )} - */} + + */} - {/* */} + ) } diff --git a/src/lib/threed/ThreeDGarden.tsx b/src/lib/threed/ThreeDGarden.tsx index b8e35b9bc..73ed55d5a 100644 --- a/src/lib/threed/ThreeDGarden.tsx +++ b/src/lib/threed/ThreeDGarden.tsx @@ -1,4 +1,4 @@ -// 'use client' +'use client' // ^ needs the 'use client' pragma (inheriting from parent page) // ============================================================== // ** RESOURCES @@ -91,7 +91,7 @@ import ThreeDCanvasViewer from '#/lib/threed/components/canvas/CanvasViewer' // import { ThreeDEnvironment } from '#/lib/threed/components/canvas/Canvas' // ** ThreeD Controls Imports -import ThreeDControls from '#/lib/threed/components/controls/Controls' +// import ThreeDControls from '~/src/lib/threed/Controls' // // ** ThreeD using Leva GUI // import { ThreeDLevaControls, ThreeDLevaComponent } from '#/lib/threed/components/controls/LevaControls' @@ -455,7 +455,7 @@ const ThreeDGarden = (): React.ReactNode => { // // borderTop: '1px solid darkgreen', // }} > - + {/* */} {/* THREED CONTROLS: LEVA GUI + CUSTOMIZED */} {/* 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