Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
eb73890
[Refactor] ๋””๋ ‰ํ† ๋ฆฌ ์ •๋ฆฌ, ์ปดํฌ๋„ŒํŠธ ๊ตฌ์กฐ ๊ฐœ์„  (#171)
JaeHye0k Mar 27, 2025
b554ba3
[Refactor] ์ฑ„ํŒ…ํŽ˜์ด์ง€ UI ๋ฐ˜์‘ํ˜• ๊ฐœ์„  (#172)
JaeHye0k Mar 27, 2025
aa8556c
[Docs] CHANGELOG
JaeHye0k Mar 27, 2025
93b5e0f
[Refactor] Suspense ์™€ ErrorBoundary ๋ฅผ ์ด์šฉํ•˜์—ฌ ๋กœ๋”ฉ๊ณผ ์—๋Ÿฌ ์ฒ˜๋ฆฌ๋ฅผ ์„ ์–ธ์ ์œผ๋กœ ๊ด€๋ฆฌ
JaeHye0k Mar 27, 2025
3a5b702
[Refactor] ์ฑ„๋„ ํ—ค๋” ๋ฐ˜์‘ํ˜• ๊ฐœ์„ 
JaeHye0k Mar 27, 2025
8f34da9
[Fix] ํ”ผ๋“œ, ํ”„๋กœ์ ํŠธ ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ ํ‘œ์‹œ์•ˆ๋˜๋Š” ๋ฌธ์ œ ํ•ด๊ฒฐ
JaeHye0k Mar 28, 2025
0794200
[Merge] branch 'hotfix' into develop
JaeHye0k Mar 28, 2025
5a99ab9
[Fix] ํƒญ ๋ฒ„ํŠผ ํŒจ๋”ฉ ์ˆ˜์ •
chaeyun-sim Mar 28, 2025
6a784b1
[Bugfix] ๊ฒ€์ƒ‰ ๊ธฐ๋Šฅ ๊ด€๋ จ ์˜ค๋ฅ˜ ์ˆ˜์ • (#176)
chaeyun-sim Mar 29, 2025
d5679b3
[Fix] ๋กœ๊ทธ์•„์›ƒ ์‹œ ํ™ˆ ํŽ˜์ด์ง€์œผ๋กœ ์ด๋™ํ•˜๋„๋ก ์ˆ˜์ •
JaeHye0k Mar 29, 2025
c1cfb9c
[Bugfix] ์ฑ„ํŒ…๋ฐฉ ์ด๋ฏธ์ง€ ์ „์†ก ์•ˆ ๋˜๋Š” ๋ฌธ์ œ ํ•ด๊ฒฐ (#178)
JaeHye0k Mar 30, 2025
ffe8aa8
[Style] ์ฑ„ํŒ…๋ฐฉ ๋ฐ˜์‘ํ˜• ๊ฐœ์„  (#179)
JaeHye0k Mar 31, 2025
1235153
[Docs] CHANGELOG
JaeHye0k Mar 31, 2025
af46058
[Fix] ๊ฐœ์ธ ์ฑ„ํŒ…๋ฐฉ ์ฑ„ํŒ…๋ฐฉ ์ด๋ฆ„ 'default_channel_title'๋กœ ์ถœ๋ ฅ๋˜๋˜ ๋ฌธ์ œ ํ•ด๊ฒฐ
JaeHye0k Apr 1, 2025
4bae753
[Merge] branch 'main' into develop
JaeHye0k Apr 1, 2025
8776396
[Fix] ์ƒˆ๋กœ์šด ๋ฉ”์‹œ์ง€๊ฐ€ ์™”์Šต๋‹ˆ๋‹ค ๋ฒ„ํŠผ ํด๋ฆญํ•ด๋„ ์‚ฌ๋ผ์ง€์ง€ ์•Š๋Š” ๋ฌธ์ œ ํ•ด๊ฒฐ
JaeHye0k Apr 2, 2025
d02da60
[Feat] ์ฑ„ํŒ… ํŽ˜์ด์ง€ ํŒŒ์ผ ์ „์†ก ํฌ๊ธฐ ์ œํ•œ 1MB ๋กœ ์„ค์ •
JaeHye0k Apr 3, 2025
117ad47
[Docs] CHANGELOG
JaeHye0k Apr 3, 2025
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: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
### Fixed

- ํ”ผ๋“œ, ํ”„๋กœ์ ํŠธ ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ ํ‘œ์‹œ ์•ˆ ๋˜๋Š” ๋ฌธ์ œ ํ•ด๊ฒฐ

## [0.2.4] - 2025-04-03

### Fixed

- ์ฑ„ํŒ…ํŽ˜์ด์ง€, ์ด๋ฏธ์ง€ ์ „์†ก ์‹œ ํฌ๊ธฐ ์ œํ•œ 1MB๋กœ ์„ค์ •
- "์ƒˆ๋กœ์šด ๋ฉ”์‹œ์ง€๊ฐ€ ์™”์Šต๋‹ˆ๋‹ค."๋ฒ„ํŠผ ํด๋ฆญํ•ด๋„ ์‚ฌ๋ผ์ง€์ง€ ์•Š๋Š” ๋ฒ„๊ทธ ํ•ด๊ฒฐ
9 changes: 9 additions & 0 deletions src/components/molecules/FileUploadButton.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { LIMIT } from '@/constants/limit';
import { useFileContext } from '@/context/useFileContext';
import { optimizeImage } from '@/utils/optimizeImage';
import {
Expand All @@ -23,6 +24,14 @@ const FileUploadButton = ({ accept, children, className, onChange }: Props) => {
if (file) {
if (file.type.match(/image\/*/)) {
const optimizedImage = await optimizeImage(file);
if (optimizedImage.size > LIMIT.MAX_IMAGE_SIZE) {
alert(
`์ด๋ฏธ์ง€ ํฌ๊ธฐ๊ฐ€ ๋„ˆ๋ฌด ํฝ๋‹ˆ๋‹ค. ์ตœ๋Œ€ ${LIMIT.MAX_IMAGE_SIZE / 1e6}MB ๊นŒ์ง€ ์—…๋กœ๋“œ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.`
);
setFile(null);
e.target.value = '';
return;
}
setFile(optimizedImage);
} else {
setFile(file);
Expand Down
8 changes: 7 additions & 1 deletion src/components/molecules/chat/ChatHeaderInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Title from '@/components/atoms/Title';
import ToggleButton from '@/components/molecules/ToggleButton';
import SearchMessage from '@/components/organisms/chat/SearchMessage';
import { useChannel } from '@/hooks/chat/useChannel';
import useAuthStore from '@/store/authStore';
import { useChatStore } from '@/store/chatStore';
import { Channel } from '@/types/channel.type';
import { useEffect, useState } from 'react';
Expand All @@ -13,6 +14,11 @@ interface ChatHeaderInfoProps {
}

const ChannelInfo = ({ channel }: { channel: Channel }) => {
const currentUserId = useAuthStore((state) => state.userInfo.userId);
const channelTitle =
channel.type === 'private'
? channel.users.find((user) => user.userId !== currentUserId)?.name
: channel.title;
return (
<div className='flex flex-col h-full justify-center w-full'>
<Title
Expand All @@ -21,7 +27,7 @@ const ChannelInfo = ({ channel }: { channel: Channel }) => {
lineClamp={1}
className='text-ellipsis w-[90%] md:text-[25px]'
>
{channel.title}
{channelTitle ?? '์ฑ„ํŒ…๋ฐฉ'}
</Title>
<div className='text-caption1 text-[#838383]'>
{channel.users.length}๋ช…์˜ ๋งด๋ฒ„๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.
Expand Down
17 changes: 9 additions & 8 deletions src/components/molecules/chat/NewMessageNotification.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
import { useEffect } from 'react';
import NewMessage from './NewMessage';
import { useChatStore } from '@/store/chatStore';
import { useInView } from 'react-intersection-observer';

interface Props {
onClick: () => void;
hasNewMessage: boolean;
setChatState: (state: Partial<{ hasNewMessage: boolean }>) => void;
}

export const NewMessageNotification = ({ onClick }: Props) => {
const setState = useChatStore((state) => state.setState);

const hasNewMessage = useChatStore((state) => state.hasNewMessage);

export const NewMessageNotification = ({
onClick,
hasNewMessage,
setChatState,
}: Props) => {
const { ref: newMessageRef, inView: isNewMessageInView } = useInView();

useEffect(() => {
if (isNewMessageInView) {
setState({ hasNewMessage: false });
setChatState({ hasNewMessage: false });
}
}, [isNewMessageInView]);

return (
<>
<div ref={newMessageRef} />
<div ref={newMessageRef} className='sr-only w-1 h-1' />
{hasNewMessage && !isNewMessageInView && <NewMessage onClick={onClick} />}
</>
);
Expand Down
15 changes: 14 additions & 1 deletion src/components/organisms/chat/ChatMessages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useMessageScroll } from '@/hooks/chat/useMessageScroll';
import { MessageList } from '@/components/organisms/chat/MessageList';
import { NewMessageNotification } from '@/components/molecules/chat/NewMessageNotification';
import LoadingDots from '@/components/molecules/LoadingDots';
import { useChatStore } from '@/store/chatStore';

interface ChatMessagesProps {
currentChannelId: Channel['channelId'];
Expand Down Expand Up @@ -54,11 +55,19 @@ const ChatMessages = ({ currentChannelId }: ChatMessagesProps) => {
onFetchPrevious: fetchPreviousPage,
});

const { hasNewMessage, setChatState } = useChatStore(
useShallow((state) => ({
hasNewMessage: state.hasNewMessage,
setChatState: state.setState,
}))
);

const handleNewMessageClick = () => {
const scrollContainer = scrollContainerRef.current;
if (!scrollContainer) return;
scrollContainer.scrollTop = scrollContainer.scrollHeight;
setSearchState({ searchMode: false });
setChatState({ hasNewMessage: false });
};

if (isLoading) {
Expand All @@ -82,7 +91,11 @@ const ChatMessages = ({ currentChannelId }: ChatMessagesProps) => {
isFetchingNextPage={isFetchingNextPage}
handleImageLoaded={handleImageLoaded}
/>
<NewMessageNotification onClick={handleNewMessageClick} />
<NewMessageNotification
onClick={handleNewMessageClick}
hasNewMessage={hasNewMessage}
setChatState={setChatState}
/>
</div>
);
};
Expand Down
1 change: 1 addition & 0 deletions src/constants/limit.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const LIMIT = {
SEARCH_MESSAGES: 30,
INFINITE_MESSAGES: 30,
MAX_IMAGE_SIZE: 1e6,
};
4 changes: 1 addition & 3 deletions src/store/authStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const useAuthStore = create(
(set, get) => ({
setAccessToken: (token: string) => {
set({ accessToken: token, isLoggedIn: !!token });
// localStorage.setItem('@token', token);
sessionStorage.setItem('@token', token);
},
login: (user: User, token: string) => {
Expand All @@ -33,8 +32,7 @@ const useAuthStore = create(
accessToken: token,
userInfo: user,
});
// localStorage.setItem('@token', token);
sessionStorage.setItem('@token', token); // ํ…Œ์ŠคํŠธ ํ•˜๊ธฐ ์œ„ํ•ด sessionStorage๋กœ ๋ณ€๊ฒฝํ•จ
sessionStorage.setItem('@token', token);
},
logout: () => {
set({
Expand Down