diff --git a/pages/[username]/[post].tsx b/pages/[username]/[post].tsx new file mode 100644 index 0000000..d048700 --- /dev/null +++ b/pages/[username]/[post].tsx @@ -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 ( + + Post title: {post} + + ); +}; + +// export const getServerSideProps = async (context: GetServerSidePropsContext) => { +// const client = initializeApollo({ headers: context?.req?.headers }); + +// try { +// await client.query({ +// query: CURRENT_USER, +// }); + +// return addApolloState(client, { +// props: {}, +// }); +// } catch { +// return { +// props: {}, +// redirect: { +// destination: "/login", +// permanent: false, +// }, +// }; +// } +// }; + +export default Profile; diff --git a/pages/[username].tsx b/pages/[username]/index.tsx similarity index 100% rename from pages/[username].tsx rename to pages/[username]/index.tsx diff --git a/public/images/banner.webp b/public/images/banner.webp new file mode 100644 index 0000000..163a7cd Binary files /dev/null and b/public/images/banner.webp differ diff --git a/src/components/card-article/index.tsx b/src/components/card-article/index.tsx index ea92a48..e56d80d 100644 --- a/src/components/card-article/index.tsx +++ b/src/components/card-article/index.tsx @@ -1,95 +1,74 @@ -import { CardHeader, Flex, Avatar, Heading, IconButton, CardBody, CardFooter, Button, Box, Card, Text, Image, HStack, TagLeftIcon, TagLabel, Tag, VStack } from "@chakra-ui/react"; +import { CardHeader, Flex, Avatar, Heading, IconButton, CardBody, CardFooter, Button, Box, Card, Text, Img, HStack, TagLeftIcon, TagLabel, Tag, VStack, Menu, MenuButton, MenuItem, MenuList } from "@chakra-ui/react"; import { BsThreeDotsVertical } from "react-icons/bs"; import { BiChat, BiLike, BiBookmark } from "react-icons/bi"; import { HiHashtag } from "react-icons/hi"; export const TopCardArticle = () => { return ( - - - - - - - - Segun Adebayo - Jan 1 (3 days ago) - - - {/* Only show if the logged-in user owns the post */} - } /> - - - - - Some Title that awesome! - - - With Chakra UI, I wanted to sync the speed of development with the speed of design. I wanted the developer to be just as excited as the designer to create a screen. - + + Yagami Light + + + + + Segun Adebayo + + Jan 1 (3 days ago) + + + + + Loremm ipsum Dolor Siet Amet! + - Rust + NodeJs - Microservice + Typescript - Docker + Backend + + + {/* hide like and comment sentence in mobile mode for responsive purpose :D */} + + + + + 3 min read + } /> + + - - Chakra UI - - button": { - minW: "136px", - }, - }} - > - {/* hide like and comment sentence in mobile mode for responsive purpose :D */} - - - - - + + ); }; export const CardArticle = () => { // only show total statistic but not allow user to mutate data from statistic, only mutate on detail post. except for bookmark return ( - - - - - - - - Segun Adebayo - Jan 1 (3 days ago) - - - {/* Only show if the logged-in user owns the post */} - } /> - - - - - Some Title that awesome! - + + + + + Segun Adebayo + + Jan 1 (3 days ago) + + + + + Loremm ipsum Dolor Siet Amet! @@ -104,27 +83,22 @@ export const CardArticle = () => { Backend - - button": { - minW: "136px", - }, - }} - > - {/* hide like and comment sentence in mobile mode for responsive purpose :D */} - - - - - + + + {/* hide like and comment sentence in mobile mode for responsive purpose :D */} + + + + + 3 min read + } /> + + + + ); };