Skip to content

Commit

Permalink
fix. #66-글쓰기, 프로젝트 상세에서도 getlayout적용
Browse files Browse the repository at this point in the history
  • Loading branch information
ji-hunc committed Jan 24, 2025
1 parent cc53fa3 commit a7c9543
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/components/Navigation/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const Navigation: React.FC = () => {
<Logo href="/">POFO</Logo>
<NavItems>
<StyledNavLink href="/">Home</StyledNavLink>
{/* <StyledNavLink href="/mypage">MyPage</StyledNavLink> */}
<StyledNavLink href="/newpost">NewPost</StyledNavLink>
</NavItems>
</div>
</div>
Expand Down
6 changes: 4 additions & 2 deletions src/components/Newpost/Newpost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ function CreateProjectButton({ categories, stackNames }: NewpostProps) {
);
}

export default function NewpostComponents() {
const NewpostComponents = () => {
const {
title,
bio,
Expand Down Expand Up @@ -228,4 +228,6 @@ export default function NewpostComponents() {
/>
</Styles.NewpostContainer>
);
}
};

export default NewpostComponents;
17 changes: 1 addition & 16 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@ export default function App({ Component, pageProps }: AppPropsWithLayout) {
}
}, [isLoggedIn, isAuthLoading, router]);

const getLayout = Component.getLayout ?? ((page) => <Layout>{page}</Layout>);
// return getLayout(
// <ApolloProvider client={client}>
// <Component {...pageProps} />
// </ApolloProvider>,
// );
const getLayout = Component.getLayout ?? ((page) => page);

return (
<ApolloProvider client={client}>
Expand All @@ -55,14 +50,4 @@ export default function App({ Component, pageProps }: AppPropsWithLayout) {
</div>
</ApolloProvider>
);

return (
<div className={myFont.className}>
<Layout>
<ApolloProvider client={client}>
<Component {...pageProps} />
</ApolloProvider>
</Layout>
</div>
);
}
12 changes: 10 additions & 2 deletions src/pages/newpost/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import Layout from "@/components/Layout/Layout";
import NewpostComponents from "@/components/Newpost/Newpost";
import { ReactElement } from "react";

export default function Newpost() {
const Newpost = () => {
return (
<div>
<NewpostComponents />
</div>
);
}
};

Newpost.getLayout = (page: ReactElement) => {
return <Layout>{page}</Layout>;
};

export default Newpost;
11 changes: 9 additions & 2 deletions src/pages/project/[id]/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import Layout from "@/components/Layout/Layout";
import ProjectComponents from "@/components/Project/Project";
import { ReactElement } from "react";

export default function Project() {
const Project = () => {
return <ProjectComponents />;
}
};

Project.getLayout = (page: ReactElement) => {
return <Layout>{page}</Layout>;
};
export default Project;

0 comments on commit a7c9543

Please sign in to comment.