Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b125c62
✨feat: 드롭다운 정렬 기능 구현
Jun 19, 2025
777d17c
Merge branch 'develop' into feat/NoticeList
Jun 19, 2025
8cb405f
✨feat: 검색기능 구현 및 정렬 기능 구현 완료
Jun 19, 2025
d30fbed
✨feat: 포스트 api 연동 및 공고 클릭시 해당 공고로 이동하게 함
Jun 19, 2025
9f2fc0a
♻️feat: 주석 처리
Jun 19, 2025
a4af561
♻️refactor: 코드 주석 정리 및 일관성 있는 형식으로 수정
minimo-9 Jun 21, 2025
253dca9
🐛 fix: 포스트 카드 모바일에서 시계 위치 수정
minimo-9 Jun 21, 2025
edfd48e
🎨 style: 맞춤 공고 및 전체 공고 섹션 스타일 개선 및 표시 항목 수 조정
minimo-9 Jun 21, 2025
22362fa
Merge branch 'develop' into feat/noticeList
minimo-9 Jun 21, 2025
9885d5b
🐛 fix: getNotices 함수 제거 및 중복 import 삭제
minimo-9 Jun 21, 2025
3398663
🐛 fix: Post 컴포넌트에서 button을 div로 변경
minimo-9 Jun 21, 2025
be8360c
🐛 fix: getNotices 함수 호출 시 쿼리 정리 및 타입 수정
minimo-9 Jun 21, 2025
502f8b5
Merge branch 'develop' into feat/noticeList
minimo-9 Jun 21, 2025
5d1cf6f
🐛 fix: 필터 컴포넌트에서 스크롤바 숨김 추가
minimo-9 Jun 21, 2025
615b800
🐛 fix: 필터 컴포넌트의 max-w 속성을 수정하여 레이아웃 개선
minimo-9 Jun 21, 2025
6f6cbe0
✨ feat: 공고 리스트 페이지 구현
minimo-9 Jun 21, 2025
290b56d
🐛 fix: formatWorkTime 함수에서 종료 시간을 계산하는 로직 수정
minimo-9 Jun 21, 2025
95bd39f
🐛 fix: 시작 시간을 KST에서 UTC로 변환하는 로직 수정
minimo-9 Jun 21, 2025
ed7fb18
🐛 fix: 공고 목록에서 에러 발생 시 모달로 오류 메시지 표시 및 스크롤 카드 선택자 수정
minimo-9 Jun 21, 2025
0c7674d
Merge branch 'develop' into feat/noticeList
minimo-9 Jun 21, 2025
8d427fa
🐛 fix: 내일 날짜 기준으로 필터링 시작 시간 설정 로직 수정
minimo-9 Jun 21, 2025
9d591bb
🐛 fix: 추천 공고 로직 개선 및 자동 스크롤 기능 추가
minimo-9 Jun 22, 2025
af96c14
🐛 fix: 사용자 로그인 상태에 따라 추천 공고 로직 수정
minimo-9 Jun 22, 2025
3295a85
Merge branch 'develop' into feat/noticeList
minimo-9 Jun 22, 2025
50a4750
🐛 fix: NoticeList 컴포넌트의 props 타입 정의 수정 및 불필요한 타입 제거
minimo-9 Jun 22, 2025
0473cb1
🐛 fix: 자동 스크롤 관련 코드 제거 및 피드백 반영
minimo-9 Jun 22, 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
9 changes: 8 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Routes, Route, useLocation } from 'react-router-dom';
import { Routes, Route, useLocation, useSearchParams } from 'react-router-dom';
import Navbar from './components/layout/Navbar';
import Login from './pages/account/Login';
import Signup from './pages/account/Signup';
Expand All @@ -11,6 +11,12 @@ import ProfileForm from './pages/profile/ProfileForm';
import NoticeList from './pages/notice/NoticeList';
import Notice from './pages/notice/Notice';

function SearchPage() {
const [params] = useSearchParams();
const query = params.get('query') || '';
return <NoticeList search={query} />;
}

export default function App() {
const { pathname } = useLocation();

Expand All @@ -20,6 +26,7 @@ export default function App() {
<Routes>
{/* 공통 페이지 */}
<Route path="/" element={<NoticeList />} />
<Route path="/search" element={<SearchPage />} />
Copy link
Contributor

@Moon-ju-young Moon-ju-young Jun 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ 이미 페이지 구성은 정리된지라 구성을 변경하실 거라면 논의 후에 진행하셨으면 좋았을 것 같습니다~ 그리고 SearchPage 없이 구현이 가능할 것 같은데 어렵나요?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네 알겠습니다 merge이후에 리펙토링때 수정해놓겠습니다

<Route path=":shopId/:noticeId" element={<Notice />} />
<Route path="login" element={<Login />} />
<Route path="signup" element={<Signup />} />
Expand Down
26 changes: 21 additions & 5 deletions src/components/common/Filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,14 @@ export default function Filter({
const [address, setAddress] = useState<string[]>(
defaultValues?.address ?? [],
);
const [startsAt, setStartsAt] = useState<string>(
defaultValues?.startsAt ?? '',
);

const [startsAt, setStartsAt] = useState<string>(() => {
if (!defaultValues?.startsAt) return '';
const utcDate = new Date(defaultValues.startsAt);
const kstDate = new Date(utcDate.getTime() + 9 * 60 * 60 * 1000); // UTC → KST
return kstDate.toISOString().slice(0, 10); // YYYY-MM-DD
});

const [hourlyPay, setHourlyPay] = useState<string>(
defaultValues?.hourlyPay?.toString() ?? '',
);
Expand Down Expand Up @@ -62,9 +67,20 @@ export default function Filter({

const handleApply = () => {
const cleanPay = hourlyPay.replace(/,/g, '');

let startsAtISO: string | null = null;

if (startsAt) {
const [year, month, day] = startsAt.split('-').map(Number);
const kstMidnight = new Date(Date.UTC(year, month - 1, day, 0, 0, 0));
startsAtISO = new Date(
kstMidnight.getTime() - 9 * 60 * 60 * 1000,
).toISOString(); // KST → UTC
}

onApply({
address,
startsAt: startsAt || null,
startsAt: startsAtISO,
hourlyPay: cleanPay ? Number(cleanPay) : null,
});
onClose();
Expand All @@ -73,7 +89,7 @@ export default function Filter({
if (!open) return null;

return (
<div className="fixed inset-0 z-5 flex w-full flex-col gap-24 overflow-y-auto border border-gray-20 bg-white px-12 py-24 shadow-custom md:static md:max-w-390 md:rounded-xl md:px-19">
<div className="fixed inset-0 z-5 scrollbar-hide flex w-full flex-col gap-24 overflow-y-auto border border-gray-20 bg-white px-12 py-24 shadow-custom md:static md:inset-auto md:w-390 md:rounded-xl md:px-19">
<div className="flex flex-row items-center justify-between">
<h3 className="text-h3 font-bold text-black">상세 필터</h3>
<button
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export default function Post({ data }: { data: NoticeShopItem }) {
<div
className={`${isInactive ? 'text-gray-30' : 'text-gray-50'} flex flex-col gap-8 text-caption/16 font-regular md:text-body2/22`}
>
<div className="flex items-center gap-6">
<div className="flex gap-6 md:items-center">
<img
src={clockIcon}
alt="시계 아이콘"
Expand Down
12 changes: 12 additions & 0 deletions src/components/layout/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Link } from 'react-router-dom';
import { useRef, useState, useEffect, useContext } from 'react';
import { useNavigate } from 'react-router-dom';
import { AuthContext } from '@/context/AuthContext';
import NotificationModal from '../common/notification-modal/NotificationModal';
import logo from '@/assets/images/logo.svg';
Expand All @@ -13,6 +14,8 @@ export default function Navbar() {
const [isShowModal, setIsShowModal] = useState(false);
const modalRef = useRef<HTMLDivElement>(null);
const buttonRef = useRef<HTMLButtonElement>(null);
const [searchValue, setSearchValue] = useState('');
const navigate = useNavigate();

const unreadAlarmCount = alarms.items.filter(
(alert) => !alert.item.read,
Expand Down Expand Up @@ -70,6 +73,15 @@ export default function Navbar() {
<input
type="text"
placeholder="가게 이름으로 찾아보세요"
value={searchValue}
onChange={(e) => setSearchValue(e.target.value)}
onKeyDown={(e) => {
if (e.key === 'Enter' && searchValue.trim()) {
navigate(
`/search?query=${encodeURIComponent(searchValue.trim())}`,
);
}
}}
className="h-36 w-full rounded-[10px] bg-gray-10 pt-10 pb-10 pl-40 placeholder:text-body2 placeholder:text-gray-40 md:h-40 md:w-344 lg:w-450"
/>
</div>
Expand Down
Loading