Skip to content

Commit

Permalink
chore: 디렉토리 구조 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
Cllaude99 committed Dec 2, 2024
1 parent 95adf1f commit 3fd0e13
Show file tree
Hide file tree
Showing 29 changed files with 48 additions and 50 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState, useEffect } from 'react';
import { useRoomStore } from '@/states/store/roomStore';
import { useRoomStore } from '@/store/roomStore';
import StartButton from './GameButtons/StartButton';
import ReadyButton from './GameButtons/ReadyButton';
import { GAME_PHASE, GamePhase } from '@/constants';
Expand All @@ -9,15 +9,15 @@ import { useGameSocket } from '@/hooks/useGameSocket';
import useGuessing from '@/hooks/useGuessing';
import useEnding from '@/hooks/useEnding';
import useVoteResult from '@/hooks/useVoteResult';
import { useAuthStore } from '@/states/store/authStore';
import { useAuthStore } from '@/store/authStore';
import Countdown from './Countdown';
import WordDisplay from './WordDisplay';
import Voting from './GamePhases/Voting';
import VoteResult from './GamePhases/VoteResult';
import EndingResult from './GamePhases/EndingResult';
import { usePeerConnectionStore } from '@/states/store/peerConnectionStore';
import { usePeerConnectionStore } from '@/store/peerConnectionStore';
import VideoStream from '@/components/gamePage/stream/VideoStream';
import { useLocalStreamStore } from '@/states/store/localStreamStore';
import { useLocalStreamStore } from '@/store/localStreamStore';
import { useSpeakingControl } from '@/hooks/useSpeakingControl';

export default function MainDisplay() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useRef, useEffect } from 'react';
import VideoStream from '@/components/gamePage/stream/VideoStream';
import { useAuthStore } from '@/states/store/authStore';
import { useLocalStreamStore } from '@/states/store/localStreamStore';
import { usePeerConnectionStore } from '@/states/store/peerConnectionStore';
import { useAuthStore } from '@/store/authStore';
import { useLocalStreamStore } from '@/store/localStreamStore';
import { usePeerConnectionStore } from '@/store/peerConnectionStore';
import { useReadyStatus } from '@/hooks/useReadyStatus';

export default function VideoFeed() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useState, useEffect, useRef } from 'react';
import { useParams } from 'react-router-dom';
import { useChatSocket } from '@/hooks/useChatSocket';
import { useAuthStore } from '@/states/store/authStore';
import { useChatStore } from '@/states/store/chatStore';
import { useAuthStore } from '@/store/authStore';
import { useChatStore } from '@/store/chatStore';
import { ChatType } from '@/constants/chatState';
import ArrowDownIcon from '@/assets/images/ArrowDownIcon.svg?react';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Leave from '@/assets/images/Leave.svg?react';
import { useNavigate } from 'react-router-dom';
import { useSocketStore } from '@/states/store/socketStore';
import { useChatStore } from '@/states/store/chatStore';
import { useRoomStore } from '@/states/store/roomStore';
import { useSignalingSocketStore } from '@/states/store/signalingSocketStore';
import { useSocketStore } from '@/store/socketStore';
import { useChatStore } from '@/store/chatStore';
import { useRoomStore } from '@/store/roomStore';
import { useSignalingSocketStore } from '@/store/signalingSocketStore';
import { useState } from 'react';
import LeaveConfirmModal from './LeaveConfirmModal';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState, useEffect } from 'react';
import CameraOn from '@/assets/images/CameraOn.svg?react';
import CameraOff from '@/assets/images/CameraOff.svg?react';
import { useLocalStreamStore } from '@/states/store/localStreamStore';
import { useLocalStreamStore } from '@/store/localStreamStore';

export default function CameraSettingButton({ iconColor }: { iconColor: string }) {
const { localStream } = useLocalStreamStore();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState, useEffect } from 'react';
import MikeOn from '@/assets/images/MikeOn.svg?react';
import MikeOff from '@/assets/images/MikeOff.svg?react';
import { useLocalStreamStore } from '@/states/store/localStreamStore';
import { useLocalStreamStore } from '@/store/localStreamStore';

export default function MikeSettingButton({ iconColor }: { iconColor: string }) {
const { localStream } = useLocalStreamStore();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import Button from '@/components/common/Button';
import NicknameModal from './NicknameModal';
import { useNavigate } from 'react-router-dom';
import { getGuestLogin } from '@/apis/login';
import { useAuthStore } from '@/states/store/authStore';
import { useSocketStore } from '@/states/store/socketStore';
import { useSignalingSocketStore } from '@/states/store/signalingSocketStore';
import { useAuthStore } from '@/store/authStore';
import { useSocketStore } from '@/store/socketStore';
import { useSignalingSocketStore } from '@/store/signalingSocketStore';

export default function GuestLoginButton() {
const navigate = useNavigate();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import VideoStream from '@/components/gamePage/stream/VideoStream';
import { useLocalStreamStore } from '@/states/store/localStreamStore';
import { useLocalStreamStore } from '@/store/localStreamStore';
import CameraSettingButton from '@/components/gamePage/stream/CameraSettingButton';
import MikeSettingButton from '@/components/gamePage/stream/MikeSettingButton';

Expand Down
8 changes: 4 additions & 4 deletions packages/frontend/src/hooks/useChatSocket.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useEffect } from 'react';
import { useChatStore } from '@/states/store/chatStore';
import { useSocketStore } from '@/states/store/socketStore';
import { useRoomStore } from '@/states/store/roomStore';
import { useChatStore } from '@/store/chatStore';
import { useSocketStore } from '@/store/socketStore';
import { useRoomStore } from '@/store/roomStore';
import { ChatType } from '@/constants/chatState';
import { useAuthStore } from '@/states/store/authStore';
import { useAuthStore } from '@/store/authStore';

interface IChatEntry {
userId: string;
Expand Down
8 changes: 4 additions & 4 deletions packages/frontend/src/hooks/useCreateRoom.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useNavigate } from 'react-router-dom';
import { useAuthStore } from '@/states/store/authStore';
import { useRoomStore } from '@/states/store/roomStore';
import { useSocketStore } from '@/states/store/socketStore';
import { useSignalingSocketStore } from '@/states/store/signalingSocketStore';
import { useAuthStore } from '@/store/authStore';
import { useRoomStore } from '@/store/roomStore';
import { useSocketStore } from '@/store/socketStore';
import { useSignalingSocketStore } from '@/store/signalingSocketStore';

export default function useCreateRoom() {
const navigate = useNavigate();
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/hooks/useEnding.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useState } from 'react';
import { useSocketStore } from '@/states/store/socketStore';
import { useSocketStore } from '@/store/socketStore';
import { GAME_PHASE, GamePhase } from '@/constants';

interface IEndingResult {
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/hooks/useGameSocket.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react';
import { useSocketStore } from '@/states/store/socketStore';
import { useRoomStore } from '@/states/store/roomStore';
import { useSocketStore } from '@/store/socketStore';
import { useRoomStore } from '@/store/roomStore';
import { GAME_PHASE, GamePhase } from '@/constants';

interface IReadyUsers {
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/hooks/useGuessing.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect } from 'react';
import { useSocketStore } from '@/states/store/socketStore';
import { useSocketStore } from '@/store/socketStore';
import { GAME_PHASE, GamePhase } from '@/constants';

export default function useGuessing(isPinoco: boolean, setGamePhase: (phase: GamePhase) => void) {
Expand Down
8 changes: 4 additions & 4 deletions packages/frontend/src/hooks/useJoinRoom.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useNavigate } from 'react-router-dom';
import { useAuthStore } from '@/states/store/authStore';
import { useRoomStore } from '@/states/store/roomStore';
import { useSocketStore } from '@/states/store/socketStore';
import { useSignalingSocketStore } from '@/states/store/signalingSocketStore';
import { useAuthStore } from '@/store/authStore';
import { useRoomStore } from '@/store/roomStore';
import { useSocketStore } from '@/store/socketStore';
import { useSignalingSocketStore } from '@/store/signalingSocketStore';

export default function useJoinRoom() {
const navigate = useNavigate();
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/hooks/useSpeakingControl.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect } from 'react';
import { useSocketStore } from '@/states/store/socketStore';
import { useSocketStore } from '@/store/socketStore';

export const useSpeakingControl = (currentSpeaker: string | null, userId: string | null) => {
const socket = useSocketStore((state) => state.socket);
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/hooks/useVoteResult.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect, useState } from 'react';
import { useSocketStore } from '@/states/store/socketStore';
import { useSocketStore } from '@/store/socketStore';
import { GAME_PHASE, GamePhase } from '@/constants';
import { useRoomStore } from '@/states/store/roomStore';
import { useRoomStore } from '@/store/roomStore';

interface IVoteResult {
voteResult: Record<string, number>;
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/pages/gamePage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import LeftGameSection from '@/components/gamePage/leftSection/LeftGameSection';
import RightGameSection from '@/components/gamePage/rightSection/RightGameSection';
import Header from '@/components/layout/Header';
import GameManual from '@/components/gamePage/GameManual';
import { useSocketStore } from '@/states/store/socketStore';
import { useRoomStore } from '@/states/store/roomStore';
import { useSocketStore } from '@/store/socketStore';
import { useRoomStore } from '@/store/roomStore';

export default function GamePage() {
const { socket } = useSocketStore();
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/pages/landingPage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import GuestLoginButton from '@/components/landingPage/GuestLoginButton';
import BackgroundImage from '@/components/layout/BackgroundImage';
import MainLogo from '@/assets/images/MainLogo.svg?react';
import { useSocketStore } from '@/states/store/socketStore';
import { useSocketStore } from '@/store/socketStore';

export default function LandingPage() {
const { socket } = useSocketStore();
Expand Down
8 changes: 4 additions & 4 deletions packages/frontend/src/pages/lobbyPage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { useEffect } from 'react';
import { useSocketStore } from '@/states/store/socketStore';
import { useSocketStore } from '@/store/socketStore';
import BackgroundImage from '@/components/layout/BackgroundImage';
import MainLogo from '@/assets/images/MainLogo.svg?react';
import RoomCreationButton from '@/components/lobbyPage/RoomCreationButton';
import RoomJoinButton from '@/components/lobbyPage/RoomJoinButton';
import VideoAudioTestButton from '@/components/lobbyPage/VideoAudioTestButton';
import Header from '@/components/layout/Header';
import { useRoomStore } from '@/states/store/roomStore';
import { useChatStore } from '@/states/store/chatStore';
import { useLocalStreamStore } from '@/states/store/localStreamStore';
import { useRoomStore } from '@/store/roomStore';
import { useChatStore } from '@/store/chatStore';
import { useLocalStreamStore } from '@/store/localStreamStore';
import { getVideoStream } from '@/utils/videoStreamUtils';

export default function LobbyPage() {
Expand Down
1 change: 0 additions & 1 deletion packages/frontend/src/states/mutations/index.tsx

This file was deleted.

1 change: 0 additions & 1 deletion packages/frontend/src/states/queries/index.tsx

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { create } from 'zustand';
import { Socket, io } from 'socket.io-client';
import { useLocalStreamStore } from '@/states/store/localStreamStore';
import { usePeerConnectionStore } from '@/states/store/peerConnectionStore';
import { useLocalStreamStore } from '@/store/localStreamStore';
import { usePeerConnectionStore } from '@/store/peerConnectionStore';
import { getVideoStream } from '@/utils/videoStreamUtils';

interface ISignalingSocketStore {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/frontend/src/utils/videoStreamUtils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useLocalStreamStore } from '@/states/store/localStreamStore';
import { useLocalStreamStore } from '@/store/localStreamStore';

export async function getVideoStream() {
const videoConfig = {
Expand Down

0 comments on commit 3fd0e13

Please sign in to comment.