Skip to content

Commit 1935268

Browse files
committed
[FE] feat: 채널에 따른 채팅 혹은 미디어창 렌더링 로직 추가 (#74)
1 parent dcf6160 commit 1935268

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/frontend/src/pages/FriendsPage/index.tsx

+20-1
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,36 @@
11
import CategorySection from '@/pages/FriendsPage/components/CategorySection';
2+
import { useGuildInfoStore } from '@/stores/guildInfo';
23

34
import GuildList from '../../components/guild/GuildList';
5+
import VideoPage from '../VideoPage';
46

57
import ChattingSection from './components/ChattingSection';
68
import * as S from './styles';
79

810
const FriendsPage = () => {
11+
const { guildId } = useGuildInfoStore();
12+
13+
const renderCategoryComponent = () => {
14+
const channelInfoStr = localStorage.getItem('channelInfo');
15+
16+
if (!guildId) return <ChattingSection />;
17+
18+
if (channelInfoStr) {
19+
const channelData = JSON.parse(channelInfoStr);
20+
const channelType = channelData.state.selectedChannel.type;
21+
22+
if (channelType === 'VOICE') return <VideoPage />;
23+
24+
// 텍스트 채널시 채팅창 주가 예정
25+
}
26+
};
27+
928
return (
1029
<S.FriendsPage>
1130
<S.ContentContainer>
1231
<GuildList />
1332
<CategorySection />
14-
<ChattingSection />
33+
{renderCategoryComponent()}
1534
</S.ContentContainer>
1635
</S.FriendsPage>
1736
);

0 commit comments

Comments
 (0)