Skip to content

Commit

Permalink
feat/#49/myprojects 카드 스타일 설정 완료
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmj12 committed Jan 15, 2025
1 parent 3fcd105 commit 13c3883
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 16 deletions.
11 changes: 10 additions & 1 deletion src/components/Mypage/MyProjects/MyProjects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,16 @@ export default function MyProjectComponents() {
) : (
<div>
{projects.map((project, index) => (
<MypageProjectCard key={index} projectCard={project} />
<div key={index}>
<MypageProjectCard projectCard={project} />
<hr
style={{
marginTop: "50px",
marginBottom: "50px",
borderColor: "black",
}}
></hr>
</div>
))}

<div
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navigation/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const Navigation: React.FC = () => {
>
<Logo href="/">POFO</Logo>
<NavItems>
<StyledNavLink href="/newpost">Home</StyledNavLink>
<StyledNavLink href="/">Home</StyledNavLink>
{/* <StyledNavLink href="/mypage">MyPage</StyledNavLink> */}
</NavItems>
</div>
Expand Down
2 changes: 0 additions & 2 deletions src/components/Project/Project.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ function ProjectIntroduction({ project }: IProjectProps) {
function ProjectLikeShare({ project }: IProjectProps) {
const { user } = useAuthStore();

console.log("authorName: ", project.authorName);

return (
<div>
<div
Expand Down
1 change: 0 additions & 1 deletion src/components/ProjectCard/Mypage/MypageProjectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export default function MypageProjectCard(projectCard: IProjectCardProps) {
};

const { id, title, imageUrls, bio } = projectCard.projectCard;
console.log(projectCard);
return (
<Link style={{ width: "100%" }} href={`/project/${id}`}>
<Styles.Card>
Expand Down
4 changes: 1 addition & 3 deletions src/components/ProjectCard/Mypage/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ import styled from "@emotion/styled";
export const Card = styled.div`
display: flex;
align-items: center;
border-bottom: 1px solid black;
gap: 50px;
padding-top: 50px;
padding-bottom: 50px;
overflow: hidden;
cursor: pointer;
`;
Expand Down
4 changes: 1 addition & 3 deletions src/pages/mypage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ export default function Mypage() {
useEffect(() => {
if (isLoggedIn) {
router.replace("/mypage/myprojects");
} else {
alert("로그인이 필요합니다");
router.replace("/");
console.log(isLoggedIn);
}
}, [isLoggedIn, router]);

Expand Down
16 changes: 11 additions & 5 deletions src/pages/mypage/myprojects.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import React from "react";
import MypageLayout from "@/components/Mypage/MypageLayout";
import MyProjectComponents from "@/components/Mypage/MyProjects/MyProjects";
import { useAuthStore } from "@/stores/authStore";

const MyProjects: React.FC = () => {
return (
<MypageLayout>
<MyProjectComponents />
</MypageLayout>
);
const { isLoggedIn } = useAuthStore();
if (isLoggedIn) {
return (
<MypageLayout>
<MyProjectComponents />
</MypageLayout>
);
} else {
return null;
}
};

export default MyProjects;

0 comments on commit 13c3883

Please sign in to comment.