Skip to content

Commit 16a9be0

Browse files
Copilotabernier
andcommitted
Remove SayCheese component, rely on chromatic.delay parameter
Co-authored-by: abernier <[email protected]>
1 parent f5fe2c1 commit 16a9be0

File tree

1 file changed

+1
-28
lines changed

1 file changed

+1
-28
lines changed

.storybook/Setup.tsx

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
import * as React from 'react'
44
import { Vector3 } from 'three'
5-
import { Canvas, CanvasProps, useThree } from '@react-three/fiber'
6-
import isChromatic from 'chromatic/isChromatic'
7-
import { useEffect } from 'react'
5+
import { Canvas, CanvasProps } from '@react-three/fiber'
86

97
import { OrbitControls } from '../src'
108

@@ -39,31 +37,6 @@ export const Setup = ({
3937
</>
4038
)}
4139
{controls && <OrbitControls makeDefault />}
42-
43-
{isChromatic() && <SayCheese />}
4440
</Canvas>
4541
)
4642
}
47-
48-
/**
49-
* A helper component to wait and pause the frameloop
50-
*/
51-
function SayCheese({ pauseAt = 3000 }) {
52-
const { clock, advance, setFrameloop, invalidate, gl, scene, camera } = useThree()
53-
54-
useEffect(() => {
55-
// console.log(`😬 Say cheeese (shooting photo in ${pauseAt}ms)`)
56-
57-
setFrameloop('never')
58-
59-
const timestamp = pauseAt / 1000 // Convert ms to seconds
60-
advance(timestamp, true)
61-
62-
// Wait for render to complete
63-
requestAnimationFrame(() => {
64-
gl.getContext().finish()
65-
})
66-
}, [pauseAt, clock, advance, invalidate, gl, scene, camera, setFrameloop])
67-
68-
return null
69-
}

0 commit comments

Comments
 (0)