Skip to content

Commit 542fff4

Browse files
authored
Merge pull request #88 from spacesvr/dev
v2.0.1
2 parents c161368 + bbd1b30 commit 542fff4

File tree

9 files changed

+18
-36
lines changed

9 files changed

+18
-36
lines changed

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "spacesvr",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"private": true,
55
"description": "A standardized reality for future of the 3D Web",
66
"keywords": [
@@ -61,8 +61,7 @@
6161
"peerDependencies": {
6262
"react": ">=18.1",
6363
"react-dom": ">=18.1",
64-
"three": ">=0.139.2",
65-
"three-stdlib": ">=2.0"
64+
"three": ">=0.139.2"
6665
},
6766
"devDependencies": {
6867
"@babel/core": "^7.18.2",

src/layers/Environment/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { Props as ContainerProps } from "@react-three/fiber/dist/declarations/sr
99
import { VRCanvas } from "@react-three/xr";
1010
import { defaultCanvasProps } from "./logic/canvas";
1111
import { EnvironmentContext, useEnvironmentState } from "./logic/environment";
12-
import KillEnterVRButton from "./ui/KillEnterVRButton";
1312
export * from "./logic/environment";
1413

1514
export type EnvironmentProps = {
@@ -46,7 +45,6 @@ export function Environment(props: EnvironmentLayerProps) {
4645
<Crosshair />
4746
</EnvironmentContext.Provider>
4847
<VRCanvas {...defaultCanvasProps} {...canvasProps}>
49-
<KillEnterVRButton />
5048
<EnvironmentContext.Provider value={state}>
5149
<RegisterMenuItems />
5250
{children}

src/layers/Environment/logic/environment.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ import {
66
useRef,
77
useState,
88
} from "react";
9-
import { MenuItem } from "./menu";
109
import { Device, DeviceState, useDevice } from "./device";
1110

11+
export type MenuItem = { text: string; action: () => void };
12+
1213
export type PauseEvent = (p: boolean) => void;
1314
export type EnvironmentState = {
1415
paused: boolean;

src/layers/Environment/logic/menu.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import { useEnvironment } from "../logic/environment";
1+
import { MenuItem, useEnvironment } from "../logic/environment";
22
import { useThree } from "@react-three/fiber";
33
import { XRSession } from "three";
44
import { useEffect, useRef, useState } from "react";
55
import { isMobile } from "react-device-detect";
66

7-
export type MenuItem = { text: string; action: () => void };
8-
97
/**
108
* Component to register menu items to the environment.
119
* Needs to be a component because it needs access to the three context to run
@@ -17,8 +15,6 @@ export function RegisterMenuItems() {
1715
const vrMenu = useVRMenuItem();
1816
const fsMenu = useFsMenuItem();
1917

20-
//TODO: too many re-renders
21-
2218
useEffect(() => {
2319
const arr: MenuItem[] = [];
2420

src/layers/Environment/ui/GlobalStyles.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ const globalStyles = css`
2828
font-size: 24px;
2929
}
3030
}
31+
32+
// used to remove the "enter vr" button from react-xr
33+
body > button,
34+
body > a {
35+
display: none;
36+
pointer-events: none;
37+
}
3138
`;
3239

3340
export default function GlobalStyles() {

src/layers/Environment/ui/KillEnterVRButton.tsx

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/layers/Environment/ui/PauseMenu/index.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ import {
1010
Title,
1111
Window,
1212
} from "./components/components";
13-
import { MenuItem } from "../../logic/menu";
14-
import { useKeyboardLayout } from "./logic/keyboard";
15-
import { useEnvironment } from "../../logic/environment";
13+
import { useKeyboardLayout } from "../../../../logic/keyboard";
14+
import { MenuItem, useEnvironment } from "../../logic/environment";
1615
import { Idea } from "../../../basis";
1716

1817
type PauseItem = Omit<MenuItem, "action"> & {
@@ -49,7 +48,7 @@ export default function PauseMenu(props: PauseMenuProps) {
4948
const PAUSE_ITEMS: PauseItem[] = [
5049
...pauseMenuItems,
5150
{
52-
text: "v2.0.0",
51+
text: "v2.0.1",
5352
link: "https://www.npmjs.com/package/spacesvr",
5453
},
5554
...menuItems,

src/logic/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
export * from "./collision";
2+
export * from "./dom";
3+
export * from "./keyboard";
4+
export * from "./keys";
25
export * from "./limiter";
File renamed without changes.

0 commit comments

Comments
 (0)