Skip to content

Commit

Permalink
Merge pull request #163 from jaeyo03/main
Browse files Browse the repository at this point in the history
feat : 마이페이지 빈 일정시 이동 기능 추가
  • Loading branch information
jaeyo03 authored Feb 9, 2025
2 parents 6481c50 + 5e2c619 commit bb2f712
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/pages/MyPage/components/main/common/NoContent.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import PropTypes from 'prop-types';

const NoContent = ({ children }) => {
const NoContent = ({ onClick, children }) => {
return (
<div className="flex flex-col justify-center items-center w-full p-10 mt-16 border border-gray-6 border-dashed min-h-80px gap-8">
<img src="/images/harbang.png" alt="한라봉 캐릭터 이미지" className="w-150" />
<img src="/images/harbang.png" alt="한라봉 캐릭터 이미지" className={`w-150 ${onClick && 'cursor-pointer'}`} onClick={onClick} />
<p className="text-gray-7 pb-12">{children}</p>
</div>
);
Expand All @@ -12,5 +12,6 @@ const NoContent = ({ children }) => {
export default NoContent;

NoContent.propTypes = {
onClick: PropTypes.func,
children: PropTypes.node,
};
5 changes: 3 additions & 2 deletions src/pages/MyPage/components/main/schedule/ScheduleSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import { deleteTripApi, getAllTripsApi } from '@/apis/supabaseApi';
import MyPageHeader from '../common/MyPageHeader';
import NoContent from '../common/NoContent';
import Schedule from './Schedule';
import { useNavigate } from 'react-router-dom';

const ScheduleSection = () => {
const [scheduleData, setScheduleData] = useState([]);

const { userId } = useSelector(state => state.user);
const navigate = useNavigate();

const fetchScheduleData = async userId => {
try {
Expand Down Expand Up @@ -54,7 +55,7 @@ const ScheduleSection = () => {
></Schedule>
))
) : (
<NoContent>일정을 등록해주세요!</NoContent>
<NoContent onClick={() => navigate('/trip/add-trip')}>아이콘을 눌러 일정을 등록해주세요!</NoContent>
)}
</div>
</>
Expand Down

0 comments on commit bb2f712

Please sign in to comment.