Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
bb0f1e5
Feat/Feed_UI 구현 (#11)
CJewon Dec 16, 2024
ada1818
Feat/좋아요 싫어요 기능 (#16)
CJewon Dec 17, 2024
8f3c4e4
Feat/좋아요 싫어요 기능 (#31)
CJewon Dec 18, 2024
f311990
Feat/무한스크롤 구현 (#37)
CJewon Dec 18, 2024
0749b56
Feat/modal 연동 (#40)
CJewon Dec 19, 2024
9ee415d
Feat/modal 외부 스크롤 방지 (#44)
ToKyun02 Dec 19, 2024
8242989
Feat/feed페이지 공용컴포넌트 적용 (#47)
ToKyun02 Dec 20, 2024
7ca256b
Refactor/좋아요 기능 개선 (#48)
ToKyun02 Dec 21, 2024
c3a077a
Feat/공유하기 기능 구현 (#50)
ToKyun02 Dec 21, 2024
13e3446
Refactor/feed 스타일 개선 (#52)
ToKyun02 Dec 22, 2024
4a7b062
Fix/feed redirection (#54)
ToKyun02 Dec 22, 2024
e7abe97
:twisted_rightwards_arrows: merge : merge 브랜치 병합
ToKyun02 Dec 22, 2024
94a6bba
:twisted_rightwards_arrows: merge : merge 브랜치 병합
ToKyun02 Dec 22, 2024
4ae7e83
:bug: fix : 무한스크롤 버그 수정
ToKyun02 Dec 22, 2024
8a07e8d
:recycle: refactor : 디바이스 높이 별 limit 값 동적 설정
ToKyun02 Dec 22, 2024
f12a5a1
:bug: fix : questionList 상태 감지 오류 해결
ToKyun02 Dec 22, 2024
f3a0bfa
:lipstick: art : 싫어요 아이콘과 텍스트 컬러 변경
CJewon Dec 23, 2024
4a3aaea
:zap: fix : Header의 svg 이미지 로드 관련 밀림 현상 처리 및 질문 등록했을때 토스트 기능 구현
CJewon Dec 24, 2024
fa529de
:lipstick: art : 모달 화면 열릴 때 애니메이션 구현
CJewon Dec 24, 2024
83c7a5a
:twisted_rightwards_arrows: merge : merge 브랜치 충돌 해결
CJewon Dec 24, 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
9 changes: 3 additions & 6 deletions src/components/AnswerContent/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,12 @@ const AnswerContent = ({ answer, name, imageSource, id, onAnswerSubmit }) => {
let response;
try {
setIsLoading(true);
// setError(null);
response = await postAnswer(id, postBody);
setUpdatedAnswer(response);
onAnswerSubmit(id, response);
} catch (err) {
// setError(`${response} : 답변을 등록하던 중 오류가 발생했습니다. 페이지를 새로고침합니다.`);
// setTimeout(() => {
// window.location.reload();
// }, 2000);
// eslint-disable-next-line
console.error(err);
} finally {
setIsLoading(false);
}
Expand All @@ -64,7 +61,7 @@ const AnswerContent = ({ answer, name, imageSource, id, onAnswerSubmit }) => {

const renderAnswerHeader = () => (
<div className='flex items-center mb-[4px]'>
<p className='mr-[8px] inline-block text-sm leading-[18px] md:text-lg md:leading-[24px]'>{name}</p>
<p className='mr-[8px] inline-block text-sm leading-[18px] md:text-lg md:leading-[24px] font-actor'>{name}</p>
<p className='text-sm font-medium leading-[18px] text-gray-40'>{formatCreatedAt(updatedAnswer.createdAt)}</p>
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/CountFavorite/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ const CountFavorite = ({ like, dislike, id }) => {
<p className={`text-sm leading-[18px] font-medium ${clickFavorite ? 'text-blue-50' : 'text-gray-40'}`}>좋아요 {`${favoriteCount || ''}`}</p>
</button>
<button type='button' onClick={countingHandleUnFavorite} className='flex justify-center items-center gap-[6px]'>
<ThumbsDownIcon className={`${clickUnFavorite ? 'fill-red-50' : 'fill-gray-40'}`} />
<p className={`text-sm leading-[18px] font-medium ${clickUnFavorite ? 'text-red-50' : 'text-gray-40'} `}>싫어요 {`${unFavoriteCount || ''}`}</p>
<ThumbsDownIcon className={`${clickUnFavorite ? 'fill-gray-60' : 'fill-gray-40'}`} />
<p className={`text-sm leading-[18px] font-medium ${clickUnFavorite ? 'text-gray-60' : 'text-gray-40'} `}>싫어요 {`${unFavoriteCount || ''}`}</p>
</button>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/DeleteIdBtn/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const DeleteIdBtn = ({ onClick, id }) => {
};

return (
<div className='relative w-full md:max-w-[704px] desktop:max-w-[716px] min-w-[144px] h-[25px] md:h-[35px]'>
<div className='relative w-full max-w-[716px] min-w-[144px] h-[25px] md:h-[35px] mx-6 mb-1.5 md:mx-8 md:mb-[9px]'>
<button
type='button'
className='absolute right-0 w-[70px] min-w-[70px] h-[25px] md:w-[100px] md:h-[35px] shadow-[0_4px_4px_0_rgba(0,0,0,0.25)] px-[17.5px] md:px-[24px] md:py-[5px] rounded-[200px] bg-brown-40 font-normal text-gray-10 text-[10px]/[25px] md:text-[15px]/[25px]'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const Header = ({ imageSource, name }) => {
<header className={`w-[calc(100vw - ${scrollBarWidth}px)] bg-white`}>
<div className='flex justify-center relative'>
<div className='w-screen overflow-hidden flex justify-center'>
<img className='min-w-[906px] md:min-w-[1200px]' src={headerImg} alt='Header_Image' />
<object className='min-w-[906px] md:min-w-[1200px] h-100' data={headerImg} aria-labelledby='Header_Image' type='image/svg+xml' />
</div>
<div className='flex flex-col items-center absolute gap-3 top-[40px] md:top-[50px]'>
<Link to='/'>
Expand Down
6 changes: 5 additions & 1 deletion src/components/Modals/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ const Modal = () => {
if (!isModalOpen) return null;
return (
<div className='fixed inset-0 flex flex-col justify-center items-center px-6 bg-dim' onClick={clickOutsideModal} role='presentation'>
<form action='POST' onSubmit={postFormHandler} className=' flex flex-col w-full h-3/5 rounded-3xl p-6 bg-gray-10 shadow-3pt md:max-w-lg md:h-2/5'>
<form
action='POST'
onSubmit={postFormHandler}
className=' flex fixed flex-col w-full h-3/5 rounded-3xl p-6 bg-gray-10 left-1/2 -translate-x-1/2 shadow-3pt md:max-w-lg md:h-2/5 animate-slide-up-fade-modal'
>
<label htmlFor='questionContent' className='flex flex-col flex-1'>
<div className='flex w-full items-center gap-2'>
<MessagesIcon className='w-[22px] h-[22px] fill-gray-60 md:w-[24px] md:h-[24px]' />
Expand Down
6 changes: 6 additions & 0 deletions src/components/ToastPostQuestion/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const ToastPostQuestion = () => (
<div className='fixed bottom-[100px] md:bottom-[60px] left-1/2 px-5 py-3 bg-black rounded-lg text-sm/[18px] font-medium text-white -translate-x-1/2 shadow-2pt animate-slide-up-fade-delete'>
질문이 등록되었습니다.
</div>
);
export default ToastPostQuestion;
10 changes: 10 additions & 0 deletions src/pages/Feed/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { AppContext } from 'components/Context';
import Header from 'components/Header';
import CountQuestion from 'components/CountQuestion';
import QnAList from 'components/QnAList';
import ToastPostQuestion from 'components/ToastPostQuestion';

const getDynamicLimit = () => {
const screenHeight = window.innerHeight;
Expand All @@ -31,6 +32,8 @@ const Feed = () => {

const [listLoading, setListLoading] = useState(false);

const [isToastState, setIsToastState] = useState(false);

const [offset, setOffset] = useState(0);
const [hasMore, setHasMore] = useState(false);

Expand Down Expand Up @@ -91,6 +94,12 @@ const Feed = () => {
// 새 질문이 추가되면 질문 리스트 맨 앞에 삽입
useEffect(() => {
if (postObject) {
setIsToastState(true);

setTimeout(() => {
setIsToastState(false);
}, 3000);

setQuestionList((prev) => {
const alreadyExists = prev.some((question) => question.id === postObject.id);
if (alreadyExists) {
Expand Down Expand Up @@ -173,6 +182,7 @@ const Feed = () => {
<span className='hidden md:block'>질문 작성하기</span>
</button>
</div>
{isToastState && <ToastPostQuestion />}
</div>
);
};
Expand Down
1 change: 1 addition & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ module.exports = {
animation: {
'slide-up-fade-urlCopy': 'slideUpFade 0.5s ease-out, fadeOut 0.5s ease-out 4.6s',
'slide-up-fade-delete': 'slideUpFade 0.5s ease-out, fadeOut 0.5s ease-out 2.6s',
'slide-up-fade-modal': 'slideUpFade 0.5s ease-out',
},
gridTemplateColumns: {
mobileLow: 'repeat(2, 1fr)',
Expand Down
Loading