Skip to content

Commit

Permalink
Merge pull request #108 from 42ence/main
Browse files Browse the repository at this point in the history
[deploy] 반영
  • Loading branch information
ppparkta authored Jun 26, 2023
2 parents a49875f + 724a31e commit df0b741
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/components/myPage/Comments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { StarRating } from "../../hooks/StarRating";
import Modal from "../modal/Modal";
import { modal } from "../../utils/recoil/modal";
import { ConvertTime } from "../../hooks/ConvertTime";
import { useParams } from "react-router";

export interface CommentProps {
comment: Comment;
Expand All @@ -29,6 +30,8 @@ const Comments = ({ comment, isLikeComment }: CommentProps) => {
const [userState, setProfileState] = useRecoilState(profileState);
const [isLike, setIsLike] = useState<Boolean>();
const [{ modalName }, setModal] = useRecoilState(modal);
const params = useParams() as { profile: string; intraId: string };
const intraId = params.intraId;

const clickLikeButton = (commentId?: Number, intraId?: String) => {
fetch(`${baseUrl}/like.${commentId}/${intraId}`, {
Expand Down Expand Up @@ -57,7 +60,7 @@ const Comments = ({ comment, isLikeComment }: CommentProps) => {
)}
{isLikeComment && <span className={styles_star.divide}>|</span>}
<span className={styles.commentTime}>{getTime(comment.update_time)}</span>
{comment.intra_id === userState.intra_id || isLikeComment === false ? (
{comment.intra_id === userState.intra_id || (isLikeComment === false && intraId === userState.intra_id) ? (
<button
style={{"all":"unset"}}
className={styles.commentEditBtn}
Expand Down
9 changes: 5 additions & 4 deletions src/components/myPage/MyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default function MyComment() {
<span className={styles.userLevel}>레벨{profileUser.user_level}</span>
</div>
<div>
<span className={styles.userUpdate}>회원정보 업데이트</span>
{userState.intra_id === intraId ?(<span className={styles.userUpdate}>회원정보 업데이트</span>):(null)}
</div>
</div>
);
Expand Down Expand Up @@ -155,9 +155,10 @@ export default function MyComment() {
<CommentList comments={likeComments} isLikeComment={true} />
)}
</div>
<div className={styles.logout} onClick={onClick}>
로그아웃
</div>
{userState.intra_id === intraId ? (<div className={styles.logout} onClick={onClick}>
로그아웃
</div>):(null)
}
</div>
);
}

0 comments on commit df0b741

Please sign in to comment.