-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update homepage and refactor code
- Loading branch information
1 parent
bd9bd4d
commit 95abde5
Showing
4 changed files
with
108 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { GetServerSidePropsContext } from "next"; | ||
import { Heading } from "@chakra-ui/react"; | ||
import MainLayout from "components/layout/main.layout"; | ||
import { Query } from "generated-types"; | ||
import { addApolloState, initializeApollo } from "lib/GraphQL/apollo"; | ||
import { CURRENT_USER } from "lib/GraphQL/Queries"; | ||
import { useRouter } from "next/router"; | ||
import { withWrapper } from "src/hooks/withWrapper"; | ||
|
||
const Profile = () => { | ||
const router = useRouter(); | ||
const { post } = router.query; | ||
|
||
return ( | ||
<MainLayout title={post as string}> | ||
<Heading>Post title: {post}</Heading> | ||
</MainLayout> | ||
); | ||
}; | ||
|
||
// export const getServerSideProps = async (context: GetServerSidePropsContext) => { | ||
// const client = initializeApollo({ headers: context?.req?.headers }); | ||
|
||
// try { | ||
// await client.query<Query>({ | ||
// query: CURRENT_USER, | ||
// }); | ||
|
||
// return addApolloState(client, { | ||
// props: {}, | ||
// }); | ||
// } catch { | ||
// return { | ||
// props: {}, | ||
// redirect: { | ||
// destination: "/login", | ||
// permanent: false, | ||
// }, | ||
// }; | ||
// } | ||
// }; | ||
|
||
export default Profile; |
File renamed without changes.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters