Skip to content

Commit

Permalink
fixed build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
stan-dot committed Sep 12, 2023
1 parent 059dc88 commit ff2892d
Show file tree
Hide file tree
Showing 8 changed files with 211 additions and 202 deletions.
2 changes: 1 addition & 1 deletion snekden/app/games/canvas-interactive/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function CanvasInteractive() {
return () => {
c.removeEventListener('click', clickHandler);
}
}, [])
}, [shapes])

return <>
<p>Stars</p>
Expand Down
2 changes: 1 addition & 1 deletion snekden/app/games/eliza/BotsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function BotsList(props: { callback: React.Dispatch<React.SetStateAction<
console.log('calling callback')
return () => {
}
}, [chosen])
}, [chosen, props])

const handleRemoteClick = (v: React.MouseEvent<HTMLButtonElement, MouseEvent>): void => {
console.log('clicked remote button', v);
Expand Down
12 changes: 6 additions & 6 deletions snekden/app/games/eliza/useTerminal.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import { useRef, useEffect, useState } from 'react';
import { Terminal } from 'xterm';
import { useEffect, useRef, useState } from "react";
import { Terminal } from "xterm";

export const useTerminal = (say?: any) => {
const terminalRef = useRef({} as HTMLDivElement);
const term = new Terminal();
const [first, setfirst] = useState(true);
useEffect(() => {
const term = new Terminal();
if (first) {
term.open(document.getElementById('terminal')!);
term.open(document.getElementById("terminal")!);
setfirst(false);
}
const render = () => {
term.write('Hello from \x1B[1;3;31mxterm.js\x1B[0m $ ');
term.write("Hello from \x1B[1;3;31mxterm.js\x1B[0m $ ");
};
render();
return () => {
// window.cancelAnimationFrame(animationFrameId);
};
}, [say]);
}, [first, say]);

return terminalRef;
};
15 changes: 6 additions & 9 deletions snekden/app/games/face/useWebcam.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,22 @@
import { useEffect, useRef, useState } from "react";

export function useWebcam(
ref: React.MutableRefObject<HTMLVideoElement>): HTMLVideoElement {
ref: React.MutableRefObject<HTMLVideoElement>,
): HTMLVideoElement {
const [source, setSource] = useState({} as MediaStream);

function getVideoNow() {
useEffect(() => {
navigator.mediaDevices.getUserMedia(
{ video: {} }
{ video: {} },
)
.then((stream) => {
setSource(stream);
ref.current.srcObject = source;
})
.catch(
(err) => console.error(err)
(err) => console.error(err),
);
}

useEffect(() => {
getVideoNow();
}, []);
}, [ref, source]);

return ref.current;
}
Expand Down
4 changes: 2 additions & 2 deletions snekden/app/games/ur/(components)/Background.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";
import { actions, interpret } from "xstate";
import { STARTING_PIECES, urMachine } from "../(logic)/machine";
import { STARTING_PIECES, } from "../(logic)/machine";
import Board from "./Board";
import PiecesCounter from "./PiecesCounter";
import { useEffect, useState } from "react";
Expand All @@ -10,7 +10,7 @@ import { useInterpret, useMachine } from "@xstate/react";
import { PlayerAssets } from "../(logic)/types";

function Background() {
const actor = useInterpret(urMachine);
// const actor = useInterpret(urMachine);

// useEffect(() => {
// actor.start();
Expand Down
4 changes: 2 additions & 2 deletions snekden/app/games/ur/(components)/Graphic.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useCallback, useRef } from "react";
import { Graphics, Stage, Text } from "@pixi/react";
import { Graphics, Stage, Text, _ReactPixi } from "@pixi/react";

interface RectangleProps {
lineWidth: number;
Expand All @@ -10,7 +10,7 @@ interface RectangleProps {
}

function Rectangle(props: RectangleProps) {
const draw = useCallback((g) => {
const draw = useCallback((g: any) => {
g.clear();
g.lineStyle(props.lineWidth, props.color);
g.drawRect(
Expand Down
Loading

1 comment on commit ff2892d

@vercel
Copy link

@vercel vercel bot commented on ff2892d Sep 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

snekden – ./

snekden.vercel.app
snekden-stan-dot.vercel.app
snekden-git-main-stan-dot.vercel.app

Please sign in to comment.