Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MERGE] dev-fe to prod-fe #267

Merged
merged 24 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9ecbfa0
feat: ์•ˆ์“ฐ๋Š” ๋ผ์šฐํ„ฐ ์ œ๊ฑฐ ๋ฐ ์—๋ŸฌํŽ˜์ด์ง€ ์ถ”๊ฐ€
spearStr Nov 28, 2024
55ab95e
fix: ๊ฒ€์ƒ‰์ฐฝ ์ œ๊ฑฐ
spearStr Nov 30, 2024
8389eee
fix: ์ „์ฒด ์ œ๊ฑฐ
spearStr Nov 30, 2024
856d0e9
feat: ๋”๋ณด๊ธฐ, ์ ‘๊ธฐ grid๋ฐฉ์‹์œผ๋กœ ์ ์šฉ
spearStr Nov 30, 2024
4930f42
fix: grid height ์ˆ˜์ •
spearStr Nov 30, 2024
fee6be7
feat: ์—๋Ÿฌ ํŽ˜์ด์ง€
spearStr Nov 30, 2024
f2a7bab
feat: ์ž˜๋ชป๋œ ์ฃผ์†Œ์˜ id๋กœ ์ ‘๊ทผ์‹œ ์—๋Ÿฌ ์ปดํฌ๋„ŒํŠธ ๋ Œ๋”๋ง
spearStr Nov 30, 2024
d0f31c6
feat: ์„œ๋ฒ„์™€ ban ์ด๋ฒคํŠธ ์ถ”๊ฐ€ ์—ฐ๊ฒฐ
gominzip Nov 30, 2024
cf3ea05
feat: ์œ ์ € ์ •๋ณด ํŒ์—… ๋ฐ context state ์ถ”๊ฐ€
gominzip Nov 30, 2024
ba31e13
feat: hoc๋ฅผ ํ™œ์šฉํ•˜์—ฌ errorpage๋กœ navigate
spearStr Dec 1, 2024
db26c03
fix: exited -> existed๋กœ API ์ˆ˜์ •
spearStr Dec 1, 2024
8e6e22c
fix: console ์‚ญ์ œ
spearStr Dec 1, 2024
9abd73d
feat: ๋‹ค์‹œ๋ณด๊ธฐ ํŽ˜์ด์ง€์—๋„ ๊ฐ™์ด ์ ์šฉ
spearStr Dec 1, 2024
5d28b41
Merge branch 'dev-fe' of https://github.com/boostcampwm-2024/web22-Liโ€ฆ
spearStr Dec 1, 2024
4917abe
fix: lint ์ˆ˜์ •
spearStr Dec 1, 2024
42e5d7a
Merge pull request #256 from boostcampwm-2024/feature-fe-#233-error_page
jsk3342 Dec 2, 2024
0d9979a
chore: ๋ถˆํ•„์š”ํ•œ ํŒŒ์ผ ์ œ๊ฑฐ
gominzip Dec 2, 2024
1c235b5
feat: Date ๋ฌธ์ž์—ด ํŒŒ์‹ฑ ์œ ํ‹ธ ํ•จ์ˆ˜ ๊ตฌํ˜„
gominzip Dec 2, 2024
f620ca2
feat: exception์— ๋Œ€ํ•œ ์ด๋ฒคํŠธ ์ •์˜ ์ถ”๊ฐ€ ๋ฐ ์˜ˆ์™ธ UI ๊ตฌํ˜„
gominzip Dec 2, 2024
e94d3d5
feat: ์œ ์ € ์ •๋ณด ํŒ์—… ๋””์ž์ธ ๊ฐœ์„  ๋ฐ ์กฐ๊ฑด ์ถ”๊ฐ€
gominzip Dec 2, 2024
be8e3be
feat: ConfirmModal ๊ตฌํ˜„
gominzip Dec 2, 2024
9184629
feat: ์‚ฌ์šฉ์ž ์ฐจ๋‹จ confirm ๊ณผ์ • ์ถ”๊ฐ€ ๊ตฌํ˜„
gominzip Dec 2, 2024
f51e8d3
chore: lint ํ•ด๊ฒฐ
gominzip Dec 2, 2024
a58b3b5
Merge pull request #266 from boostcampwm-2024/feature-fe-#249-chat_ban
gominzip Dec 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
import { ThemeProvider } from 'styled-components';
import { theme } from './styles/theme';
import { MainPage, ClientPage, HostPage } from './pages';
import { ClientPage, ErrorPage, HostPage, MainPage, ReplayPage } from './pages';
import { QueryClientProvider } from '@tanstack/react-query';
import { queryClient } from '@apis/index';
import withUserId from '@hocs/withUserId';
import ReplayPage from '@pages/ReplayPage';

function AppComponent() {
return (
Expand All @@ -19,12 +18,10 @@ function AppComponent() {
>
<Routes>
<Route path="/" element={<MainPage />} />
<Route path="/live" element={<ClientPage />} />
<Route path="/live/:id" element={<ClientPage />} />
<Route path="/replay" element={<ReplayPage />} />
<Route path="/replay/:id" element={<ReplayPage />} />
<Route path="/host" element={<HostPage />} />
<Route path="/host/:id" element={<HostPage />} />
<Route path="*" element={<ErrorPage />} />
</Routes>
</Router>
</ThemeProvider>
Expand Down
13 changes: 13 additions & 0 deletions frontend/src/apis/checkLiveExist.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { AxiosResponse } from 'axios';
import { fetchInstance } from '.';
import { LiveExistenceResponse } from '@type/live';

export const checkLiveExist = async ({ liveId }: { liveId: string }): Promise<LiveExistenceResponse> => {
const response: AxiosResponse<LiveExistenceResponse> = await fetchInstance().get('/streams/existence', {
params: {
sessionKey: liveId
}
});

return response.data;
};
13 changes: 13 additions & 0 deletions frontend/src/apis/checkReplayExist.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { AxiosResponse } from 'axios';
import { fetchInstance } from '.';
import { ReplayExistenceResponse } from '@type/replay';

export const checkReplayExist = async ({ videoId }: { videoId: string }): Promise<ReplayExistenceResponse> => {
const response: AxiosResponse<ReplayExistenceResponse> = await fetchInstance().get('/replay/existence', {
params: {
videoId
}
});

return response.data;
};
25 changes: 13 additions & 12 deletions frontend/src/apis/fetchLive.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import { AxiosResponse } from 'axios';
import { fetchInstance } from '.';
import { ClientLive } from '@type/live';
import { ClientLiveResponse } from '@type/live';

type ClientLiveResponse = {
info: ClientLive;
};

export const fetchLive = async ({ liveId }: { liveId: string }): Promise<ClientLive> => {
const response: AxiosResponse<ClientLiveResponse> = await fetchInstance().get('/streams/live', {
params: {
liveId
export const fetchLive = async ({ liveId }: { liveId: string }): Promise<ClientLiveResponse> => {
try {
const response: AxiosResponse = await fetchInstance().get('/streams/live', {
params: { liveId }
});
return response.data;
} catch (error: any) {
if (error.response && error.response.status === 400) {
console.log('error', error);
throw error;
}
});

return response.data.info;
throw error;
}
};
27 changes: 15 additions & 12 deletions frontend/src/apis/fetchReplay.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import { AxiosResponse } from 'axios';
import { fetchInstance } from '.';
import { ReplayStream } from '@type/replay';
import { ClientReplayResponse } from '@type/replay';

type ReplayStreamResponse = {
info: ReplayStream;
};

export const fetchReplay = async ({ videoId }: { videoId: string }): Promise<ReplayStream> => {
const response: AxiosResponse<ReplayStreamResponse> = await fetchInstance().get('/replay/video', {
params: {
videoId
export const fetchReplay = async ({ videoId }: { videoId: string }): Promise<ClientReplayResponse> => {
try {
const response: AxiosResponse = await fetchInstance().get('/replay/video', {
params: {
videoId
}
});
return response.data;
} catch (error: any) {
if (error.response && error.response.status === 400) {
console.log('error', error);
throw error;
}
});

return response.data.info;
throw error;
}
};
13 changes: 13 additions & 0 deletions frontend/src/apis/queries/client/useCheckLiveExist.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { useQuery } from '@tanstack/react-query';

import { checkLiveExist } from '@apis/checkLiveExist';
import { LiveExistenceResponse } from '@type/live';

export const useCheckLiveExist = ({ liveId }: { liveId: string }) => {
return useQuery<LiveExistenceResponse, Error>({
queryKey: ['checkLiveExist'],
queryFn: () => checkLiveExist({ liveId }),
refetchOnWindowFocus: false,
initialData: { existed: true }
});
};
12 changes: 7 additions & 5 deletions frontend/src/apis/queries/client/useFetchLive.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { useQuery } from '@tanstack/react-query';

import { fetchLive } from '@apis/fetchLive';
import { ClientLive } from '@type/live';
import { ClientLive, ClientLiveResponse } from '@type/live';

export const useClientLive = ({ liveId }: { liveId: string }) => {
return useQuery<ClientLive, Error>({
return useQuery<ClientLiveResponse, Error>({
queryKey: ['clientLive'],
queryFn: () => fetchLive({ liveId: liveId }),
refetchOnWindowFocus: false
queryFn: () => fetchLive({ liveId }),
refetchOnWindowFocus: false,
initialData: { info: {} as ClientLive },
throwOnError: true,
retry: 0,
});
};
13 changes: 13 additions & 0 deletions frontend/src/apis/queries/replay/useCheckReplayExist.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { useQuery } from '@tanstack/react-query';

import { checkReplayExist } from '@apis/checkReplayExist';
import { ReplayExistenceResponse } from '@type/replay';

export const useCheckReplayExist = ({ videoId }: { videoId: string }) => {
return useQuery<ReplayExistenceResponse, Error>({
queryKey: ['checkReplayExist'],
queryFn: () => checkReplayExist({ videoId }),
refetchOnWindowFocus: false,
initialData: { existed: true }
});
};
11 changes: 7 additions & 4 deletions frontend/src/apis/queries/replay/useFetchReplay.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { useQuery } from '@tanstack/react-query';

import { fetchReplay } from '@apis/fetchReplay';
import { ReplayStream } from '@type/replay';
import { ClientReplayResponse, ReplayStream } from '@type/replay';

export const useClientReplay = ({ videoId }: { videoId: string }) => {
return useQuery<ReplayStream, Error>({
return useQuery<ClientReplayResponse, Error>({
queryKey: ['clientReplay'],
queryFn: () => fetchReplay({ videoId: videoId }),
refetchOnWindowFocus: false
queryFn: () => fetchReplay({ videoId }),
refetchOnWindowFocus: false,
initialData: { info: {} as ReplayStream },
throwOnError: true,
retry: 0
});
};
3 changes: 3 additions & 0 deletions frontend/src/assets/icons/user-block.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions frontend/src/assets/icons/warning_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions frontend/src/components/chat/ChatInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import SpeakerIcon from '@assets/icons/speaker.svg';
import SendIcon from '@assets/icons/send.svg';
import { useRef, useEffect, useState, ChangeEvent, KeyboardEvent, memo } from 'react';
import { CHATTING_SOCKET_SEND_EVENT, CHATTING_TYPES } from '@constants/chat';
import { ChattingTypes } from '@type/chat';
import { ChattingSendTypes } from '@type/chat';
import { getStoredId } from '@utils/id';
import { UserType } from '@type/user';

Expand All @@ -20,7 +20,7 @@ const INITIAL_TEXTAREA_HEIGHT = 20;
export const ChatInput = ({ worker, userType, roomId }: ChatInputProps) => {
const [hasInput, setHasInput] = useState(false);
const [isFocused, setIsFocused] = useState(false);
const [msgType, setMsgType] = useState<ChattingTypes>(CHATTING_TYPES.NORMAL);
const [msgType, setMsgType] = useState<ChattingSendTypes>(CHATTING_TYPES.NORMAL);
const [message, setMessage] = useState('');
const textareaRef = useRef<HTMLTextAreaElement | null>(null);

Expand Down
Loading
Loading