Skip to content

Commit

Permalink
Updating deps
Browse files Browse the repository at this point in the history
  • Loading branch information
marklundin committed Dec 11, 2024
1 parent 92a49d7 commit 38684bc
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 235 deletions.
8 changes: 2 additions & 6 deletions packages/docs/src/app/docs/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ title: Introduction

import { Cards } from 'nextra/components'
import { Icons } from '@/components/icons'
import { CodeSandbox } from '@/utils/code-sandbox'
import { Terminal, CodesandboxIcon } from 'lucide-react'
import { HomePageExample } from '@/components/HomePageExample'
import { PCReactCodeSandBoxButton } from '@/utils/code-sandbox'

# `@playcanvas/react`

A react library for for creating 3D apps, with an extensible Entity-Component System supporting physics, interaction, and scripting.

import { Tabs, Code } from 'nextra/components'
import CodeSandboxer from 'react-codesandboxer';
import dedent from 'dedent';

<Tabs items={['Demo', 'Code']}>
Expand All @@ -40,8 +39,7 @@ import dedent from 'dedent';
/>
</Cards>



<PCReactCodeSandBoxButton name="Basic Demo" examplePath="packages/docs/src/components/HomePageExample.tsx" />

## How does it work?

Expand Down Expand Up @@ -69,8 +67,6 @@ const App = (car) => {
}
```

<CodeSandbox path="packages/docs/components/HomePageExample.tsx" />

## Features

PlayCanvas comes with a number of built in components and scripts that you can use. This makes it easy to get started building your app.
Expand Down
5 changes: 4 additions & 1 deletion packages/docs/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Banner, Head } from 'nextra/components'
import { getPageMap } from 'nextra/page-map'
import './globals.css'
import { CodeXml } from 'lucide-react'
import ReactQueryProvider from '@/components/react-query-provider'

export const { viewport } = Head

Expand Down Expand Up @@ -62,7 +63,9 @@ export default async function RootLayout({ children }: { children: React.ReactNo
}}
pageMap={await getPageMap()}
>
{children}
<ReactQueryProvider>
{children}
</ReactQueryProvider>
</Layout>
</body>
</html>
Expand Down
15 changes: 3 additions & 12 deletions packages/docs/src/app/playground/[[...mdxPath]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { generateStaticParamsFor, importPage } from 'nextra/pages'
import { readFile } from 'node:fs/promises'
import path from 'node:path'
import Playground from '@/components/playground'
import ReactQueryProvider from '@/components/react-query-provider'
// import { useLayoutEffect } from 'react'

export const generateStaticParams = generateStaticParamsFor('mdxPath')
Expand All @@ -17,7 +16,6 @@ export async function generateMetadata(props: PageProps) {
} catch (error) {

Check failure on line 16 in packages/docs/src/app/playground/[[...mdxPath]]/page.tsx

View workflow job for this annotation

GitHub Actions / lint

'error' is defined but never used
// If the meta file is not found, use the default metadata
const { metadata } = await importPage(params.mdxPath)
console.log('error', error)
return metadata
}
}
Expand All @@ -37,16 +35,9 @@ export default async function Page(props: PageProps) {
'utf-8'
)

// useLayoutEffect(() => {
// // If the page is a playground, hide the footer

// }, [])

return (
<ReactQueryProvider>
<div className='absolute top-0 left-0 w-screen h-screen'>
<Playground name={`./${params.mdxPath}.tsx`} code={source} path={metadata.filePath}/>
</div>
</ReactQueryProvider>
<div className='absolute top-0 left-0 w-screen h-screen'>
<Playground name={`./${params.mdxPath}.tsx`} code={source} path={metadata.filePath}/>
</div>
)
}
2 changes: 1 addition & 1 deletion packages/docs/src/components/HomePageExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const HomePageExample = () => {
<Entity name='camera' position={[4, 1, 4]}>
<Camera clearColor='#090707' fov={28} />
<OrbitControls inertiaFactor={0.07} distanceMin={6} distanceMax={10} pitchAngleMin={1} pitchAngleMax={90}/>
<StaticPostEffects />
{/* <StaticPostEffects /> */}
<AutoRotate />
</Entity>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { useMemo } from "react";
export const usePostControls = () => {

const app = useApp();

const tint = useMemo(() => new Color(), [app]);
const fogColor = useMemo(() =>new Color(), [app]);

Expand Down
Loading

0 comments on commit 38684bc

Please sign in to comment.