Skip to content

Commit

Permalink
Merge branch 'deploy' of https://github.com/5wonju/frontend into deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
3o14 committed May 19, 2024
2 parents 8e1f5e7 + 0582c36 commit ddeab95
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
'use client'

import LobbyChatLog from './LobbyChatLog'
import SendLobbyChat from './SendLobbyChat'
import ChatLog from './ChatLog'
import SendChat from './SendChat'
import { useRef } from 'react'

const LobbyChat = () => {
const Chat = () => {
const chatEndRef = useRef(null)

return (
<>
<div className="bg-[#000000] opacity-80 absolute top-0 left-0 w-full h-full"></div>
<div className="absolute top-0 left-0 w-full h-full z-10 flex flex-col justify-end gap-2">
<LobbyChatLog chatEndRef={chatEndRef} />
<SendLobbyChat />
<ChatLog chatEndRef={chatEndRef} />
<SendChat />
</div>
</>
)
}

export default LobbyChat
export default Chat
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useChat } from '@/app/hooks/useSocket'
import React, { useEffect } from 'react'

interface LobbyChatLogProps {
interface ChatLogProps {
chatEndRef: React.RefObject<HTMLDivElement>
}

const LobbyChatLog = ({ chatEndRef }: LobbyChatLogProps) => {
const ChatLog = ({ chatEndRef }: ChatLogProps) => {
const { chatLogs } = useChat()

useEffect(() => {
Expand All @@ -30,4 +30,4 @@ const LobbyChatLog = ({ chatEndRef }: LobbyChatLogProps) => {
)
}

export default LobbyChatLog
export default ChatLog
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
'use client'
import { useAuth } from '@/app/hooks/useAuth'

import { useChat } from '@/app/hooks/useSocket'
import { useSearchParams } from 'next/navigation'
import React, { useEffect, useMemo, useState } from 'react'

const MAX_CHAT_LEN = 50

const SendLobbyChat = () => {
const SendChat = () => {
const { sendChat } = useChat()
const [message, setMessage] = useState('')
const searchParams = useSearchParams()
Expand Down Expand Up @@ -63,4 +63,4 @@ const SendLobbyChat = () => {
)
}

export default SendLobbyChat
export default SendChat
4 changes: 2 additions & 2 deletions frontend/app/(page)/(needProtection)/lobby/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import WaitingRoomList from './component/WaitingRoomList'
import UserInfo from '@/app/component/UserInfo'
import { useSetupSocket } from './../../../hooks/useSetupSocket'
import { useMainSocketStore } from '@/app/lib/store'
import LobbyChat from './component/LobbyChat/LobbyChat'
import Chat from './component/Chat/Chat'

// overflow-y-scroll box-border
const Lobby = () => {
Expand All @@ -22,7 +22,7 @@ const Lobby = () => {
<UserInfo />
</section>
<section className="col-span-2 relative rounded overflow-hidden">
<LobbyChat />
<Chat />
</section>
</div>
</main>
Expand Down

0 comments on commit ddeab95

Please sign in to comment.