diff --git a/src/components/chat/Header.tsx b/src/components/chat/Header.tsx index b3d4a7c..c0f9e13 100644 --- a/src/components/chat/Header.tsx +++ b/src/components/chat/Header.tsx @@ -4,19 +4,13 @@ import useSocketStore from '@/store/socket'; import useChatStore from '@/store/chat'; import color from '@/styles/color'; import { useSession } from 'next-auth/react'; +import { CharacterStateProps } from '@/types/characterInfo'; import FriendShip from './characterHeader/FriendShip'; import CharacterInfo from './characterHeader/CharacterInfo'; -interface CharacterState { - characterId: number, - characterName: string, - hashTag: string, - imageUrl: string, -} - // TODO: Back 버튼을 누르면 지금 홈으로 돌아가지만 채팅 리스트뷰가 완성되면 그쪽으로 Link 될 예정 -const Header : FC = ({ - characterId, characterName, hashTag, imageUrl, +const Header : FC = ({ + characterId, characterName, hashTag, profileImageUrl, }) => { // TODO: 친밀도를 API로 받아와야 작업이 가능함! const [userStatus, setUserStatus] = useState({ @@ -42,7 +36,7 @@ const Header : FC = ({ }, [session]); return (
- + = ({ characterId, characterName, imageUrl }) => { +const Main:FC = ({ characterId, characterName, profileImageUrl }) => { const { chatContents, clearChatContents, initChatContents } = useChatStore(); const messageEndRef = useRef(null); const [loadingHistory, setLoadingHistory] = useState(false); @@ -42,7 +42,7 @@ const Main:FC = ({ characterId, characterName, imageUrl }) => { = ({ - characterName, hashTag, imageUrl, link, + characterName, hashTag, profileImageUrl, link, }) => ( <> @@ -28,7 +28,7 @@ const CharacterInfo: FC = ({
{`/${characterName}`} = ({ - speaker, content, timestamp, imageUrl, loading = false, + speaker, content, timestamp, profileImageUrl, loading = false, }) => (
{speaker} { >
diff --git a/src/components/community/CommunityHeader.tsx b/src/components/community/CommunityHeader.tsx index a9ce92a..ed7b030 100644 --- a/src/components/community/CommunityHeader.tsx +++ b/src/components/community/CommunityHeader.tsx @@ -30,7 +30,7 @@ const CommunityHeader = () => { characterInfo ? ( { characterInfo ? ( {
diff --git a/src/components/friends/Friends.tsx b/src/components/friends/Friends.tsx index f668b5a..1697d65 100644 --- a/src/components/friends/Friends.tsx +++ b/src/components/friends/Friends.tsx @@ -31,7 +31,7 @@ const Friends = () => { diff --git a/src/components/friends/Recommends.tsx b/src/components/friends/Recommends.tsx index d56d274..6afb845 100644 --- a/src/components/friends/Recommends.tsx +++ b/src/components/friends/Recommends.tsx @@ -26,7 +26,7 @@ const Recommends = () => { characterId={characterInfo.characterId} hashTag={characterInfo.hashTag} statusMessage={characterInfo.statusMessage} - imageUrl={characterInfo.profileImageUrl} + profileImageUrl={characterInfo.profileImageUrl} /> ))}
diff --git a/src/components/friends/friend/FriendInfo.tsx b/src/components/friends/friend/FriendInfo.tsx index 3d631ed..a7faf99 100644 --- a/src/components/friends/friend/FriendInfo.tsx +++ b/src/components/friends/friend/FriendInfo.tsx @@ -6,14 +6,14 @@ import color from '@/styles/color'; interface FriendInfoProps { characterName: string, message: string, - imageUrl: string, + profileImageUrl: string, } -const FriendInfo: FC = ({ characterName, message, imageUrl }) => ( +const FriendInfo: FC = ({ characterName, message, profileImageUrl }) => (
{characterName} = ({ - characterName, characterId, hashTag, statusMessage, imageUrl, +const RecommendBox:FC = ({ + characterName, characterId, hashTag, statusMessage, profileImageUrl: imageUrl, }) => ( diff --git a/src/components/profile/CharacterProfileInfo.tsx b/src/components/profile/CharacterProfileInfo.tsx index d80f79f..03c4bcd 100644 --- a/src/components/profile/CharacterProfileInfo.tsx +++ b/src/components/profile/CharacterProfileInfo.tsx @@ -6,17 +6,17 @@ import color from '@/styles/color'; interface CharacterProfileInfoProps { characterName: string, hashTag: string, - imageUrl: string, + profileImageUrl: string, statusMessage: string, } const CharacterProfileInfo: FC = ({ - characterName, hashTag, imageUrl, statusMessage, + characterName, hashTag, profileImageUrl, statusMessage, }) => (
{`/${characterName}`} {
{ diff --git a/src/types/characterInfo.d.ts b/src/types/characterInfo.d.ts index 23c3131..8007048 100644 --- a/src/types/characterInfo.d.ts +++ b/src/types/characterInfo.d.ts @@ -6,3 +6,7 @@ export interface CharacterInfo { profileImageUrl: string, backgroundImageUrl: string, } + +export type CharacterStateProps = Omit; + +export type RecommendCharacterProps = Omit;