Skip to content

Commit

Permalink
✨ 自分のアイコンを表示
Browse files Browse the repository at this point in the history
  • Loading branch information
ikura-hamu committed Jan 26, 2025
1 parent 026b42e commit 46a2509
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions client/src/pixi/Canvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import PIXI from "pixi.js";
import { useAtom, useAtomValue } from "jotai";
import dispatcherAtom from "../state/dispatcher";
import userPositionAtom from "../state/userPosition";
import meAtom from "../state/me";
import { traqIconURL } from "../util/icon";

const mountHandler = import.meta.env.DEV
? (app: PIXI.Application) => {
Expand Down Expand Up @@ -44,6 +46,7 @@ const Canvas: React.FC<Props> = (props) => {
const intervalID = useRef<number | null>(null);
const stageRef = useRef<HTMLDivElement>(null);
const dispatcher = useAtomValue(dispatcherAtom);
const me = useAtomValue(meAtom);

useEffect(() => {
const width = (window.innerWidth * 3) / 5;
Expand Down Expand Up @@ -100,7 +103,7 @@ const Canvas: React.FC<Props> = (props) => {
return nextPosition;
});
},
[dispatcher, fieldSize, intervalID],
[dispatcher, fieldSize, setUserPosition],
);

const onFieldClick = useCallback(
Expand Down Expand Up @@ -163,10 +166,10 @@ const Canvas: React.FC<Props> = (props) => {
userDisplayPosition={userDisplayPosition}
/>
<Explorer
imgURL="https://q.trap.jp/api/v3/public/icon/ikura-hamu"
imgURL={traqIconURL(me?.name ?? "")}
position={userDisplayPosition}
isMe
name="ikura-hamu"
name={me?.name ?? ""}
/>
</Stage>
</div>
Expand Down

0 comments on commit 46a2509

Please sign in to comment.