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

๐Ÿ”จ fix: ๋ฆด๋ฆฌ์ฆˆ ๋ฐฐํฌ ํ›„ ๋ฒ„๊ทธ ํ•ด๊ฒฐ ๋ฐ ํ•„์š”ํ•œ ๊ธฐ๋Šฅ ์ถ”๊ฐ€ #213

Merged
merged 29 commits into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
13c908a
๐Ÿ”จfix: ๋Œ“๊ธ€ ๊ธด ๋‹จ์–ด ์ž…๋ ฅ์‹œ ๊นจ์ง ํ˜„์ƒ ํ•ด๊ฒฐ
rkdcodus Sep 19, 2024
658359b
๐Ÿ”จfix: ๋ชจ๋ฐ”์ผ ๋ฒ„์ „ ์Šคํฌ๋กค ์‹œ ํ† ์ŠคํŠธ ์ปดํฌ๋„ŒํŠธ ๋ณด์ด๋Š” ํ˜„์ƒ ํ•ด๊ฒฐ
rkdcodus Sep 19, 2024
bf79b0d
๐Ÿ”ฅremove: Callout.style.tsx ์ค‘๋ณต ํŒŒ์ผ ์‚ญ์ œ
rkdcodus Sep 19, 2024
ad8b206
๐Ÿ”จfix: Menu ์ปดํฌ๋„ŒํŠธ ์กฐ๊ฑด ์ˆ˜์ •
rkdcodus Sep 20, 2024
668d385
โœจfeat: ๋Œ“๊ธ€ ๋‹ฌ๊ธฐ ๋ฒ„ํŠผ ์ถ”๊ฐ€
rkdcodus Sep 20, 2024
0340c01
๐Ÿ’„ design: ์Šค๋‚ต๋ฐ”, ํ† ์ŠคํŠธ nowrap ์†์„ฑ ์„ค์ •
rkdcodus Sep 20, 2024
c45f8bc
โœจfeat: ํ—ค๋” ๋ชฉ๋ก๋ฐ” '๋ฆฌ์›Œ๋“œ ๋‚ด์—ญ' ํŽ˜์ด์ง€ ์ด๋™ ๋ฒ„ํŠผ ์ถ”๊ฐ€
rkdcodus Sep 22, 2024
ca90a3f
๐Ÿ’„design: ์Šค๋‚ต๋ฐ” ๋ฐ ํ† ์ŠคํŠธ ๋ชจ๋ฐ”์ผ UI ๊ตฌํ˜„
rkdcodus Sep 22, 2024
387565f
๐Ÿ’„design: ํ† ์ŠคํŠธ ๋ชจ๋ฐ”์ผ ํ…์ŠคํŠธ ํฌ๊ธฐ ์ˆ˜์ •
rkdcodus Sep 22, 2024
6f473a7
โœจfeat: Footer์— ์ด์šฉ์•ฝ๊ด€ ๋ฐ ๊ฐœ์ธ์ •๋ณด์ฒ˜๋ฆฌ๋ฐฉ์นจ ๋‚ด์šฉ ํ™•์ธ ๊ธฐ๋Šฅ ๊ตฌํ˜„
rkdcodus Sep 22, 2024
90790cc
โœจfeat: ์„ค์ •ํŽ˜์ด์ง€ ์ค€๋น„ ์ค‘ ๋ชจ๋‹ฌ ๊ตฌํ˜„
rkdcodus Sep 22, 2024
a83e35b
โœจfeat: ํ—ค๋” ๋กœ๊ทธ์ธ ๋ฒ„ํŠผ ํด๋ฆญ ์‹œ ๋กœ๊ทธ์ธ ๋ชจ๋‹ฌ๋กœ ๋Œ€์ฒด
rkdcodus Sep 22, 2024
9a657f5
โœจfeat: ๋กœ๊ทธ์ธ ๋ชจ๋‹ฌ '์„œ๋น„์Šค ์ด์šฉ์•ฝ๊ด€' ํŽ˜์ด์ง€ ์—ฐ๊ฒฐ
rkdcodus Sep 22, 2024
30223d1
๐Ÿ”จfix: ๋กœ๊ทธ์ธ ๋ชจ๋‹ฌ ์ด์šฉ์•ฝ๊ด€ ์ƒˆ๋กœ์šด ํŽ˜์ด์ง€๋กœ ์ƒ์„ฑ
rkdcodus Sep 22, 2024
aa53b28
๐Ÿ”จfix: ๋น„๋กœ๊ทธ์ธ ์‹œ, ๊ณต์œ ํŽ˜์ด์ง€ ๋กœ๊ทธ์ธ ๋ชจ๋‹ฌ ๋„์šฐ๊ธฐ
rkdcodus Sep 22, 2024
6361f82
๐Ÿ’„design: '์ด๋ฒˆ์ฃผ ์ธ๊ธฐ ์ผ๊ธฐ' ๋ฐฐ๊ฒฝ์ƒ‰ ๋ณ€๊ฒฝ
rkdcodus Sep 22, 2024
18e79bc
๐Ÿ”จfix: svg width, height ๊ฒฝ๊ณ  ๋ฉ”์‹œ์ง€ ํ•ด๊ฒฐ
rkdcodus Sep 22, 2024
904303e
๐Ÿ”จfix: ๋ฆฌ์›Œ๋“œ ์Šค๋‚ต๋ฐ” ๋ฒ„ํŠผ ์ด๋ฒคํŠธ ์ˆ˜์ •
rkdcodus Sep 22, 2024
107425b
โœจfeat: ์—๋ŸฌํŽ˜์ด์ง€ ์ƒ์„ฑ
rkdcodus Sep 22, 2024
02c944e
โœจfeat: useError ํ›… ์ƒ์„ฑ
rkdcodus Sep 22, 2024
3c658f9
โœจfeat: api์— useError ํ›… ์ ์šฉ
rkdcodus Sep 22, 2024
c225b88
Merge pull request #7 from rkdcodus/errorpage
rkdcodus Sep 23, 2024
202907d
โœจfeat: ๋กœ๊ทธ์ธ ๋งŒ๋ฃŒ ๋ชจ๋‹ฌ ๊ตฌํ˜„
rkdcodus Sep 23, 2024
543502a
Merge remote-tracking branch 'upstream/dev' into hotfix
rkdcodus Sep 23, 2024
0b0b6c0
๐Ÿ”ฅ remove: Modal.tsx ๋ถˆํ•„์š” ๋ชจ๋‹ฌ ์‚ญ์ œ
rkdcodus Sep 24, 2024
90fde13
๐Ÿ”จfix: ์ˆ˜์ •ํŽ˜์ด์ง€ ์ด๋ฏธ์ง€ ํŒŒ์ผ ์ด๋ฆ„ ๋ฐ ์šฉ๋Ÿ‰ ํ‘œ๊ธฐ
rkdcodus Sep 25, 2024
23f8b49
๐Ÿ”จfix: ๋กœ๊ทธ์ธ ๋งŒ๋ฃŒ ๋ชจ๋‹ฌ ๋ฉ”์‹œ์ง€ '10๋ถ„' -> '30๋ถ„'์œผ๋กœ ์ •์ •
rkdcodus Sep 25, 2024
a8c7e82
๐Ÿ’„design: ํ† ์ŠคํŠธ ๋™์ž‘ ์‹œ๊ฐ„ 3์ดˆ๋กœ ์ˆ˜์ •
rkdcodus Sep 25, 2024
1d7ca37
Merge branch 'dev' into hotfix
rkdcodus Sep 29, 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
5 changes: 5 additions & 0 deletions grass-diary/src/assets/svg/history.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: 3 additions & 1 deletion grass-diary/src/components/Button/Menus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ const Menus = ({ children, icon }: MenusProps) => {
}
};

document.addEventListener('click', closeMenus);
if (open) {
document.addEventListener('click', closeMenus);
}

return () => document.removeEventListener('click', closeMenus);
}, [open]);
Expand Down
33 changes: 14 additions & 19 deletions grass-diary/src/components/Comment/CommentDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,11 @@ import { COMMENT } from '@constants/message';

const CommentDisplay = ({ comment, parentId }: CommentDisplayProps) => {
const { data: writer } = useWriterProfile(comment.memberId);
const memberId = useUser();
const { memberId } = useUser();
const { setReplyId } = useCommentActions();
const { date } = useTodayDate();
const setting = useRef<HTMLDivElement>(null);
const [isToday, setIsToday] = useState(false);

const reply = (e: React.MouseEvent<HTMLElement, MouseEvent>) => {
if (setting.current) {
if (setting.current.contains(e.target as HTMLElement)) return;
}
setReplyId(parentId);
};

useEffect(() => {
if (date && comment.createdDate) {
if (
Expand All @@ -43,7 +35,7 @@ const CommentDisplay = ({ comment, parentId }: CommentDisplayProps) => {
</S.WriterBox>
</S.CommentItem>
) : (
<S.CommentItem onClick={reply} $isMe={memberId === comment.memberId}>
<S.CommentItem $isMe={memberId === comment.memberId}>
<S.TopBox>
<S.WriterBox>
{comment.depth ? <ReplyIcon /> : null}
Expand All @@ -59,16 +51,19 @@ const CommentDisplay = ({ comment, parentId }: CommentDisplayProps) => {
: ''}
</S.TimeText>
</S.WriterBox>
<div ref={setting}>
<CommentSetting
commentId={comment.commentId}
writerId={comment.memberId}
/>
</div>
<CommentSetting
commentId={comment.commentId}
writerId={comment.memberId}
/>
</S.TopBox>
<S.ContentBox $isReply={comment.depth ? true : false}>
{comment.content}
</S.ContentBox>
<S.BottomBox>
<S.ContentText $isReply={comment.depth ? true : false}>
{comment.content}
</S.ContentText>
<S.ReplyButton onClick={() => setReplyId(parentId)}>
๋Œ“๊ธ€ ๋‹ฌ๊ธฐ
</S.ReplyButton>
</S.BottomBox>
</S.CommentItem>
);
};
Expand Down
2 changes: 1 addition & 1 deletion grass-diary/src/components/Comment/CommentSetting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Menus, Menu } from '@components/index';

const CommentSetting = ({ commentId, writerId }: CommentSettingProps) => {
const diaryId = useParamsId();
const memberId = useUser();
const { memberId } = useUser();
const { detail } = useDiaryDetail(diaryId);
const { setEditId } = useCommentActions();
const { mutate: deleteComment } = useDeleteComment(diaryId);
Expand Down
17 changes: 9 additions & 8 deletions grass-diary/src/components/Comment/Input.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as S from '@styles/component/Comment/Input.style';
import { useEffect, useState } from 'react';
import { useEffect, useRef, useState } from 'react';

import { useParamsId } from '@hooks/useParamsId';
import { useUser } from '@state/user/useUser';
Expand All @@ -18,10 +18,10 @@ const CommentInput = ({
isCancelBtn,
isPatch,
}: CommentInputProps) => {
const textareaRef = useRef<HTMLTextAreaElement>(null);
const { profileImageURL, nickname } = useProfile();
const { resetEditId, resetReplyId } = useCommentActions();
const [focus, setFocus] = useState(false);
const [rows, setRows] = useState(1);

// focus ๋  ๋•Œ
const onFocus = () => setFocus(true);
Expand All @@ -31,7 +31,6 @@ const CommentInput = ({

const commentHandler = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
setText(e.target.value);
setRows(e.target.value.split('\n').length);
};

const cancel = () => {
Expand All @@ -41,12 +40,13 @@ const CommentInput = ({

const submitBtn = (e: React.MouseEvent<HTMLElement, MouseEvent>) => {
submit(e);
setRows(1);
};

useEffect(() => {
if (text) {
setRows(text.split('\n').length);
if (textareaRef.current) {
textareaRef.current.style.height = 'auto';
textareaRef.current.style.height =
textareaRef.current.scrollHeight + 'px';
}
}, [text]);

Expand All @@ -61,7 +61,8 @@ const CommentInput = ({
</S.TopBox>
<S.InputBox>
<S.Input
rows={rows}
rows={1}
ref={textareaRef}
value={text}
onFocus={onFocus}
onBlur={onBlur}
Expand All @@ -84,7 +85,7 @@ const CommentInput = ({
// parentId๊ฐ€ null์ด๋ผ๋ฉด ๋Œ“๊ธ€, ์•„๋‹ˆ๋ผ๋ฉด ๋Œ€๋Œ“๊ธ€
const PostInput = ({ parentId }: PostInputProps) => {
const diaryId = useParamsId();
const memberId = useUser();
const { memberId } = useUser();
const { mutate: postComment } = usePostComment(diaryId);
const { resetReplyId } = useCommentActions();
const [text, setText] = useState('');
Expand Down
6 changes: 3 additions & 3 deletions grass-diary/src/components/Feed/Feed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ interface IFeedProps {

const Feed = ({ feed, isTop }: IFeedProps) => {
const navigate = useNavigate();
const memberId = useUser();
const { memberId } = useUser();
const { data: writer } = useWriterProfile(feed.memberId);
const { modal } = useModal();
const { modal, loginModal } = useModal();

const title =
`${feed.createdAt.slice(2, 4)}๋…„ ` +
Expand Down Expand Up @@ -56,7 +56,7 @@ const Feed = ({ feed, isTop }: IFeedProps) => {
const button2 = {
active: true,
text: MODAL.login_induce.button,
clickHandler: handleGoogleLogin,
clickHandler: loginModal,
color: semantic.light.accent.solid.hero,
interaction: INTERACTION.accent.subtle(),
};
Expand Down
28 changes: 23 additions & 5 deletions grass-diary/src/components/Layout/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,32 @@ import logoIcon from '@image/sampleLogo_white.png';
import { FOOTER } from '@constants/message';

const Footer = () => {
const moving = (url: string) => {
window.open(url, '_blank', 'noopener, noreferrer');
};

return (
<S.Footer>
<S.Container>
<S.LogoBox>
<S.LogoIcon src={logoIcon} />
<LogoText fill={semantic.light.base.solid.white} />
</S.LogoBox>
<S.CopyRightText>{FOOTER.copyright}</S.CopyRightText>
<S.TopBox>
<S.LogoBox>
<S.LogoIcon src={logoIcon} />
<LogoText fill={semantic.light.base.solid.white} />
</S.LogoBox>
<S.ButtonContainer>
<S.FooterButton onClick={() => moving(FOOTER.terms_of_use_url)}>
์ด์šฉ์•ฝ๊ด€
</S.FooterButton>
<S.FooterButton onClick={() => moving(FOOTER.privacy_policy_url)}>
๊ฐœ์ธ์ •๋ณด ์ฒ˜๋ฆฌ๋ฐฉ์นจ
</S.FooterButton>
</S.ButtonContainer>
</S.TopBox>

<S.CopyRightContainer>
<S.Text>{FOOTER.copyright_front}</S.Text>
<S.Text> {FOOTER.copyright_back}</S.Text>
</S.CopyRightContainer>
</S.Container>
</S.Footer>
);
Expand Down
33 changes: 27 additions & 6 deletions grass-diary/src/components/Layout/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,35 @@ import MenuBar from './MenuBar';
import { Profile } from '@components/index';
import { useNavigate } from 'react-router-dom';
import { useUser } from '@state/user/useUser';
import { API_URI } from '@services/index';
import { useModal } from '@state/modal/useModal';
import { useEffect } from 'react';
import { MODAL } from '@constants/message';
import { semantic } from '@styles/semantic';
import { INTERACTION } from '@styles/interaction';

const Header = () => {
const memberId = useUser();
const { memberId, isError } = useUser();
const { modal, loginModal } = useModal();
const navigate = useNavigate();
const handleGoogleLogin: TGoogleLogin = () => {
window.open(`${API_URI}/api/auth/google`, '_self');
};

useEffect(() => {
const manualLogout = localStorage.getItem('manualLogout');
if (isError && manualLogout === null) {
const setting = {
title: MODAL.login_expiration.title,
content: MODAL.login_expiration.content,
};

const button1 = {
active: true,
text: MODAL.confirm,
color: semantic.light.accent.solid.hero,
interaction: INTERACTION.accent.subtle(),
};

modal(setting, button1);
}
}, [isError]);

return (
<S.Header>
Expand All @@ -29,7 +50,7 @@ const Header = () => {
<MenuBar />
</S.MenuBarBox>
) : (
<S.LoginButton onClick={handleGoogleLogin}>๋กœ๊ทธ์ธ</S.LoginButton>
<S.LoginButton onClick={loginModal}>๋กœ๊ทธ์ธ</S.LoginButton>
)}
</S.Container>
</S.Header>
Expand Down
3 changes: 1 addition & 2 deletions grass-diary/src/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Outlet } from 'react-router-dom';
import Header from './Header';
import Footer from './Footer';
import SnackBar from './SnackBar';
import { Toast, Modal } from '@components/index';
import { Toast, Modal, SnackBar } from '@components/index';

const Layout = () => {
return (
Expand Down
6 changes: 6 additions & 0 deletions grass-diary/src/components/Layout/MenuBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import setting from '@svg/settings.svg';
import logout from '@svg/logout.svg';
import arrow from '@svg/arrow_drop_down.svg';
import useLogout from '@hooks/useLogout';
import history from '@svg/history.svg';
import { useQueryClient } from '@tanstack/react-query';
import { useNavigate } from 'react-router-dom';
import { Menus, Menu } from '@components/index';
Expand All @@ -23,6 +24,11 @@ const MenuBar = () => {
onClick={() => navigate('/mypage')}
text={'๋งˆ์ดํŽ˜์ด์ง€'}
svg={person}
/>
<Menu
onClick={() => navigate('/rewardpage')}
text={'๋ฆฌ์›Œ๋“œ ๋‚ด์—ญ'}
svg={history}
line={0.25}
/>
<Menu
Expand Down
Loading
Loading