{applierCnt}명이 지원했어요!
+
{email.length > 0 && ( - + {emailMessage} )}
-
{password.length > 0 && (
-
+
{passwordMessage}
)}
@@ -244,10 +249,10 @@ export const LoginBtn = styled(Btn)`
font: inherit;
color: ${(props) => props.theme.textColor_btn};
background-color: ${(props) =>
- props.disabled ? "#E1E1E1" : props.theme.keyColor};
+ props.disabled ? '#E1E1E1' : props.theme.keyColor};
:hover {
- background-color: ${(props) => (props.disabled ? "#E1E1E1" : "#FF891C")};
- cursor: ${(props) => (props.disabled ? "default" : "pointer")};
+ background-color: ${(props) => (props.disabled ? '#E1E1E1' : '#FF891C')};
+ cursor: ${(props) => (props.disabled ? 'default' : 'pointer')};
}
`;
diff --git a/src/components/MyPagePostList.js b/src/components/MyPagePostList.js
index 655a361..263509a 100644
--- a/src/components/MyPagePostList.js
+++ b/src/components/MyPagePostList.js
@@ -1,100 +1,131 @@
-import { Btn, GrayLineBtn, LineBtn, ListProfilePic, ListStack, ListTitle, PostBody } from "../styles/style"
-import { useRecoilValue } from "recoil";
-import { UserInfoAtom } from "../atom/atom";
-import { useMatch, useNavigate } from "react-router-dom";
-import styled from "styled-components";
-import DefaultProfile from "../styles/icon/global/profile.svg"
-import { ReactComponent as CommentCnt } from "../styles/icon/post/commentCnt.svg";
-import { ReactComponent as BookmarkCnt } from "../styles/icon/post/bookmarkCnt.svg"
-import UserBookmark from "./UserBookmark";
-import { usePostApply } from "../hook/useApplyMutation";
-import AlertModal from "./AlertModal";
-import { Content } from "./ApplyBtn";
-import { useState } from "react";
-
-const MyPagePostList = ({
- data,
- viewApplyModal,
- currentTab
-}) => {
-//console.log(data)
- const isMypage = useMatch("/mypage")
- const [modalOpen, setModalOpen] = useState(false);
- //console.log(currentTab)
- const navigate = useNavigate()
- const { mutate: postApply } = usePostApply()
-
- // const cancelApply = () => {
- // if(confirm('지원을 취소하시겠어요?'))
- // };
-
- const openModal = () => {
- setModalOpen(true);
- };
- const closeModal = () => {
+import {
+ Btn,
+ GrayLineBtn,
+ LineBtn,
+ ListProfilePic,
+ ListStack,
+ ListTitle,
+ PostBody,
+} from '../styles/style';
+import { useRecoilValue } from 'recoil';
+import { UserInfoAtom } from '../atom/atom';
+import { useMatch, useNavigate } from 'react-router-dom';
+import styled from 'styled-components';
+import DefaultProfile from '../styles/icon/global/profile.svg';
+import { ReactComponent as CommentCnt } from '../styles/icon/post/commentCnt.svg';
+import { ReactComponent as BookmarkCnt } from '../styles/icon/post/bookmarkCnt.svg';
+import UserBookmark from './UserBookmark';
+import { usePostApply } from '../hook/useApplyMutation';
+import AlertModal from './AlertModal';
+import { Content } from './ApplyBtn';
+import { useState } from 'react';
+import { useQueryClient } from 'react-query';
+
+const MyPagePostList = ({ data, viewApplyModal, currentTab }) => {
+ //console.log(data)
+ const [completeMessage, setCompleteMessage] = useState('');
+ const [completeModal, setCompleteModal] = useState(false);
+ const queryClient = useQueryClient();
+ const postId = data.postId;
+ const isMypage = useMatch('/mypage');
+ const [modalOpen, setModalOpen] = useState(false);
+ //console.log(currentTab)
+ const navigate = useNavigate();
+ const { mutateAsync: postApply } = usePostApply();
+
+ // const cancelApply = () => {
+ // if(confirm('지원을 취소하시겠어요?'))
+ // };
+
+ const applyBtn = async () => {
+ try {
+ const response = await postApply(postId);
+ console.log(response);
+ if (response.status === 200) {
setModalOpen(false);
- };
-
- return (
- <>
- 프로젝트 지원을 취소하시겠습니까?
- {postList?.data.title}
게시글을 삭제하시겠습니까?
- {" "}
-
{" "}
-
{' '}
+
{' '}
+
{" "}
+ {' '}
+
{' '}
{" "}
+ {' '}
+
{' '}