-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore - begin experiment with stat values for placeholders
- Loading branch information
sdubourg
committed
Jul 27, 2023
1 parent
5e75dcb
commit 12a6243
Showing
4 changed files
with
39 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/components/gl/House/HotSpots/AppartmentHotspotStats.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Text } from '@react-three/drei'; | ||
import { useSelector } from '@xstate/react'; | ||
import type { InterpreterFrom } from 'xstate'; | ||
import type { hotspotMachine } from '../../../../machines/hotspot.machine'; | ||
import type { MeshProps } from '@react-three/fiber'; | ||
|
||
type AppartmentHotspotStats = { | ||
service: InterpreterFrom<typeof hotspotMachine>; | ||
textPosition: MeshProps['position']; | ||
}; | ||
|
||
export const AppartmentHotspotStats = ({ | ||
service, | ||
textPosition, | ||
}: AppartmentHotspotStats) => { | ||
const { persons, maxPersons } = useSelector(service, (s) => s.context); | ||
|
||
return ( | ||
<Text position={textPosition} fontSize={0.7}> | ||
{persons.length}/{maxPersons} | ||
<meshStandardMaterial | ||
color="white" | ||
emissive={0xffffff} | ||
emissiveIntensity={2} | ||
toneMapped={false} | ||
/> | ||
</Text> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters