generated from nim-od/softeer-mono-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from softeerbootcamp4th/TASK-135
[Feature][Task-135] 로그인 모달 구현 및 API 연동 & 로그인이 선행되어야 하는 기능을 위해 공통 Protected 로직 구현 (HOC) & 그 외 다수의 관련된 에러 해결
- Loading branch information
Showing
22 changed files
with
332 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
import { ChatList } from '@softeer/common/components'; | ||
import { memo } from 'react'; | ||
import ChatInput from 'src/components/event/chatting/inputArea/input/index.tsx'; | ||
import { UseChatSocketReturnType } from 'src/hooks/socket/useChatSocket.ts'; | ||
import Chat from './Chat.tsx'; | ||
import ChatInputArea from './inputArea/index.tsx'; | ||
|
||
/** 실시간 기대평 섹션 */ | ||
|
||
export default function RealTimeChatting({ onSendMessage, messages }: UseChatSocketReturnType) { | ||
return ( | ||
<section className="container flex max-w-[1200px] snap-start flex-col items-center pb-[115px] pt-[50px]"> | ||
<h6 className="text-heading-10 mb-[25px] font-medium">기대평을 남겨보세요!</h6> | ||
<ChatInputArea onSend={onSendMessage} /> | ||
<div className="h-[1000px] w-full overflow-y-auto rounded-[10px] bg-neutral-800 py-10"> | ||
<ChatList> | ||
{messages.map((message) => ( | ||
<Chat key={message.id} {...message} /> | ||
))} | ||
</ChatList> | ||
</div> | ||
</section> | ||
); | ||
} | ||
const RealTimeChatting = memo(({ onSendMessage, messages }: UseChatSocketReturnType) => ( | ||
<section className="container flex max-w-[1200px] snap-start flex-col items-center pb-[115px] pt-[50px]"> | ||
<h6 className="text-heading-10 mb-[25px] font-medium">기대평을 남겨보세요!</h6> | ||
<ChatInputArea> | ||
<ChatInput onSend={onSendMessage} /> | ||
</ChatInputArea> | ||
<div className="h-[1000px] w-full overflow-y-auto rounded-[10px] bg-neutral-800 py-10"> | ||
<ChatList> | ||
{messages.map((message) => ( | ||
<Chat key={message.id} {...message} /> | ||
))} | ||
</ChatList> | ||
</div> | ||
</section> | ||
)); | ||
|
||
export default RealTimeChatting; |
9 changes: 3 additions & 6 deletions
9
packages/user/src/components/event/chatting/inputArea/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
import ChatInput from './input/index.tsx'; | ||
import { PropsWithChildren } from 'react'; | ||
|
||
interface ChatInputAreaProps { | ||
onSend: (message: string) => void; | ||
} | ||
export default function ChatInputArea({ onSend }: ChatInputAreaProps) { | ||
export default function ChatInputArea({ children }: PropsWithChildren) { | ||
return ( | ||
<div className="mb-[54px] flex flex-col items-center gap-3"> | ||
{/* Todo: 비속어 작성 횟수 불러오기 */} | ||
<p className="text-detail-2 text-[#FF3C76]"> | ||
비속어 혹은 부적절한 기대평을 5회 이상 작성할 경우, 댓글 작성이 제한됩니다. | ||
</p> | ||
<ChatInput onSend={onSend} /> | ||
{children} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 18 additions & 26 deletions
44
packages/user/src/components/layout/fcfsController/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 11 additions & 15 deletions
26
packages/user/src/components/layout/header/user/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,19 @@ | ||
import UserIcon from 'src/assets/icons/user.svg?react'; | ||
import useAuth from 'src/hooks/useAuth.tsx'; | ||
import withAuth from 'src/components/shared/withAuthHOC.tsx'; | ||
import SpeechBubble from './SpeechBubble.tsx'; | ||
|
||
export default function User() { | ||
const { user } = useAuth(); | ||
const UserGreeting = withAuth(() => <p className="text-detail-1">김보민님 반갑습니다</p>); | ||
|
||
// TODO: 로그인, 로그아웃 | ||
// TODO: 로그아웃 | ||
export default function User() { | ||
return ( | ||
<div className="flex items-center gap-2"> | ||
{user ? ( | ||
<p className="text-detail-1">김보민님 반갑습니다</p> | ||
) : ( | ||
<> | ||
<UserGreeting | ||
unauthenticatedDisplay={ | ||
<div className="flex items-center gap-2"> | ||
<SpeechBubble /> | ||
<button type="button" aria-label="user-icon" className="p-[10px]"> | ||
<UserIcon /> | ||
</button> | ||
</> | ||
)} | ||
</div> | ||
<UserIcon /> | ||
</div> | ||
} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.