-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomponent---node-modules-pitayan-gatsby-theme-pitayan-src-templates-category-posts-index-tsx-12fa93780de0966bd243.js.map
1 lines (1 loc) · 10.8 KB
/
component---node-modules-pitayan-gatsby-theme-pitayan-src-templates-category-posts-index-tsx-12fa93780de0966bd243.js.map
1
{"version":3,"file":"component---node-modules-pitayan-gatsby-theme-pitayan-src-templates-category-posts-index-tsx-12fa93780de0966bd243.js","mappings":"uHAQA,MAAMA,EAA4CC,IAG3C,IAH4C,WACjDC,EAAU,UACVC,GACDF,EACC,OAAKC,GAAeA,EAAWE,OAG7BC,EAAAA,cAAA,OAAKF,UAAS,wBAA0BA,GACrCD,EAAWI,KAAI,CAACC,EAAkBC,IAE/BH,EAAAA,cAACI,EAAAA,GAAI,CAACN,UAAU,iBAAiBK,IAAKA,EAAKE,GAAE,eAAiBH,GAC3DA,MAPmCF,EAAAA,cAAAA,EAAAA,SAAA,KAWtC,EAIV,KAAeM,EAAAA,EAAAA,MAAKX,E,+CCZpB,MAAMY,EAAwCX,IAGvC,IAFLY,UAAU,YAAEC,EAAW,YAAEC,EAAW,gBAAEC,EAAe,UAAEC,GAAW,KAClEC,GACDjB,EACC,MAAMkB,EAAaC,GACjBN,GAAeM,EAAI,EAAI,yBAA2B,kBACpD,OACEf,EAAAA,cAAA,MAAIF,UAAU,0BACXa,EACCX,EAAAA,cAAA,MAAIF,UAAU,mBACZE,EAAAA,cAACI,EAAAA,GAAI,CAACC,GAAE,IAAMQ,EAAI,KAAIJ,EAAc,IAAK,SAEzC,KACHO,MAAMC,KAAK,CAAElB,OAAQa,IAAaX,KAAI,CAACiB,EAAGH,IAEvCf,EAAAA,cAAA,MAAIG,IAAKY,EAAI,EAAGjB,UAAWgB,EAAUC,IACnCf,EAAAA,cAACI,EAAAA,GAAI,CAACC,GAAE,IAAMQ,EAAI,KAAIE,EAAI,IAAMA,EAAI,MAIzCL,EACCV,EAAAA,cAAA,MAAIF,UAAU,mBACZE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AW,KAAEC,EAAI,MAAEF,GACpDc,QAAQ,KAAEX,IACXQ,EAAA,OACCpC,EAAAA,cAACwB,EAAS,CACRrB,IAAKkC,EACLZ,MAAOA,EACPC,YAAaA,EACbL,KAAMA,EACNxB,WAAYA,EACZ8B,KAAMA,EACNC,KAAMA,EACNR,WAAYA,GACZ,IAGF,EAIV,OAAed,EAAAA,EAAAA,MAAK4B,E,oFCFpB,UA3BoDtC,IAK1B,IAJxB4C,MACEC,QAAUC,MAAOP,EAAK,WAAEQ,EAAU,SAAEnC,IAEtCoC,aAAa,SAAE1C,IACIN,EACnB,MAAM,QAAEiD,IAAYC,EAAAA,EAAAA,MAEpB,OACE9C,EAAAA,cAAC+C,EAAAA,EAAa,CACZC,QAAYH,EAAO,eAAe3C,EAClC+C,UAAS,aAAe/C,GAExBF,EAAAA,cAAA,MAAIF,UAAU,yEACXI,EAAS,KAAGyC,EAAW,KAE1B3C,EAAAA,cAACkC,EAAAA,EAAU,CACTC,MAAOA,EACPrC,UAAU,mDAEZE,EAAAA,cAAA,OAAKF,UAAU,SACbE,EAAAA,cAACO,EAAAA,EAAU,CAACC,SAAUA,EAAUK,KAAI,cAAgBX,KAExC,C","sources":["webpack://www/./node_modules/@pitayan/gatsby-theme-pitayan/src/components/CategoryTags/index.tsx","webpack://www/./node_modules/@pitayan/gatsby-theme-pitayan/src/components/Pagination/index.tsx","webpack://www/./node_modules/@pitayan/gatsby-theme-pitayan/src/components/PostMeta/index.tsx","webpack://www/./node_modules/@pitayan/gatsby-theme-pitayan/src/components/PostPanel/index.tsx","webpack://www/./node_modules/@pitayan/gatsby-theme-pitayan/src/components/PostsGroup/index.tsx","webpack://www/./node_modules/@pitayan/gatsby-theme-pitayan/src/templates/categoryPosts/index.tsx"],"sourcesContent":["import React, { memo } from \"react\"\nimport { Link } from \"gatsby\"\n\ntype CategoryTagsProps = {\n categories: string[]\n className?: string\n}\n\nconst CategoryTags: React.FC<CategoryTagsProps> = ({\n categories,\n className\n}) => {\n if (!categories || !categories.length) return <></>\n\n return (\n <div className={`flex flex-wrap gap-3 ${className}`}>\n {categories.map((category: string, key: number) => {\n return (\n <Link className=\"site-tag block\" key={key} to={`/categories/${category}`}>\n {category}\n </Link>\n )\n })}\n </div>\n )\n}\n\nexport default memo(CategoryTags)\n","import React, { memo } from \"react\"\nimport { Link } from \"gatsby\"\n\nexport type PageInfo = {\n currentPage: number\n hasNextPage: boolean\n hasPreviousPage: boolean\n pageCount: number\n}\n\ntype PaginationProps = {\n pageInfo: PageInfo\n path: string\n}\n\nconst Pagination: React.FC<PaginationProps> = ({\n pageInfo: { currentPage, hasNextPage, hasPreviousPage, pageCount },\n path,\n}) => {\n const itemClass = (i: number) =>\n currentPage == i + 1 ? \"pagination-item active\" : \"pagination-item\"\n return (\n <ul className=\"pagination text-center\">\n {hasPreviousPage ? (\n <li className=\"pagination-item\">\n <Link to={`/${path}/${currentPage - 1}`}>Prev</Link>\n </li>\n ) : null}\n {Array.from({ length: pageCount }).map((_, i: number): any => {\n return (\n <li key={i + 1} className={itemClass(i)}>\n <Link to={`/${path}/${i + 1}`}>{i + 1}</Link>\n </li>\n )\n })}\n {hasNextPage ? (\n <li className=\"pagination-item\">\n <Link to={`/${path}/${currentPage + 1}`}>Next</Link>\n </li>\n ) : null}\n </ul>\n )\n}\n\nexport default memo(Pagination)\n","import React, { memo } from \"react\"\n\ntype PostMetaProps = {\n timeToRead: number\n date: string\n className?: string\n}\n\nconst PostMeta: React.FC<PostMetaProps> = ({\n timeToRead,\n date,\n className = \"\",\n}) => {\n return (\n <span className={`text-gray-500 ${className}`}>\n {date} • {Math.round(timeToRead)} min read\n </span>\n )\n}\n\nexport default memo(PostMeta)\n","import React, { memo } from \"react\"\nimport { Link } from \"gatsby\"\nimport { GatsbyImage, getImage, ImageDataLike } from \"gatsby-plugin-image\"\n\nimport CategoryTags from \"@pitayan/gatsby-theme-pitayan/src/components/CategoryTags\"\nimport PostMeta from \"@pitayan/gatsby-theme-pitayan/src/components/PostMeta\"\n\nexport type PostPanelProps = {\n title: string\n description: string\n date: string\n categories: string[]\n hero?: {\n normal: ImageDataLike\n }\n slug: string\n timeToRead: number\n}\n\nconst PostPanel: React.FC<PostPanelProps> = ({\n title,\n description,\n date,\n categories,\n hero,\n timeToRead,\n slug,\n}) => {\n const image = getImage(hero?.normal)\n\n return (\n <div className=\"panel\">\n <Link to={slug}>\n {image ? (\n <div className=\"panel-image\">\n <GatsbyImage image={image} alt=\"\" />\n </div>\n ) : null}\n <h3>{title}</h3>\n </Link>\n <p className=\"panel-content\">{description}</p>\n <CategoryTags categories={categories} />\n <br />\n <span className=\"panel-footer\">\n <PostMeta timeToRead={timeToRead} date={date} />\n </span>\n </div>\n )\n}\n\nexport default memo(PostPanel)\n","import React, { memo } from \"react\"\nimport PostPanel from \"@pitayan/gatsby-theme-pitayan/src/components/PostPanel\"\nimport { ImageDataLike } from \"gatsby-plugin-image\"\n\nexport type PostNode = {\n id: string\n timeToRead: number\n frontmatter: {\n categories: string[]\n date: string\n description: string\n hero: {\n normal: ImageDataLike\n }\n title: string\n }\n fields: {\n slug: string\n }\n}\n\ntype PostsProps = {\n posts: PostNode[]\n className?: string\n}\n\nconst PostsGroup: React.FC<PostsProps> = ({\n posts,\n className = \"\",\n}) => {\n return (\n <div className={className}>\n {posts.map(\n ({\n id,\n timeToRead,\n frontmatter: { categories, date, description, hero, title },\n fields: { slug },\n }) => (\n <PostPanel\n key={id}\n title={title}\n description={description}\n date={date}\n categories={categories}\n hero={hero}\n slug={slug}\n timeToRead={timeToRead}\n />\n )\n )}\n </div>\n )\n}\n\nexport default memo(PostsGroup)\n","import { graphql } from \"gatsby\"\nimport React from \"react\"\n\nimport DefaultLayout from \"@pitayan/gatsby-theme-pitayan/src/layouts/Default\"\nimport Pagination, {\n PageInfo,\n} from \"@pitayan/gatsby-theme-pitayan/src/components/Pagination\"\nimport PostsGroup, {\n PostNode,\n} from \"@pitayan/gatsby-theme-pitayan/src/components/PostsGroup\"\n\nimport { useSiteMetadata } from \"@pitayan/gatsby-theme-pitayan/src/hooks\"\n\ntype CategoryPostsProps = {\n data: {\n allMdx: {\n nodes: PostNode[]\n totalCount: number\n pageInfo: PageInfo\n }\n }\n pageContext: {\n category: string\n }\n}\n\nconst CategoryPosts: React.FC<CategoryPostsProps> = ({\n data: {\n allMdx: { nodes: posts, totalCount, pageInfo },\n },\n pageContext: { category },\n}: CategoryPostsProps) => {\n const { siteUrl } = useSiteMetadata()\n\n return (\n <DefaultLayout\n pageUrl={`${siteUrl}/categories/${category}`}\n pageTitle={`Category: ${category}`}\n >\n <h1 className=\"leading-tight md:leading-tight md:text-4xl text-3xl text-center mb-32\">\n {category} ({totalCount})\n </h1>\n <PostsGroup\n posts={posts}\n className=\"grid relative grid-cols-1 md:grid-cols-2 gap-8\"\n />\n <div className=\"my-24\">\n <Pagination pageInfo={pageInfo} path={`categories/${category}`} />\n </div>\n </DefaultLayout>\n )\n}\n\nexport default CategoryPosts\n\nexport const pageQuery = graphql`\n query ($limit: Int!, $skip: Int!, $category: String!) {\n allMdx(\n sort: {\n frontmatter: {\n date: DESC\n }\n }\n filter: {\n frontmatter: { categories: { in: [$category] } }\n internal: {\n contentFilePath: { regex: \"/content/posts/\" }\n }\n }\n limit: $limit\n skip: $skip\n ) {\n totalCount\n pageInfo {\n currentPage\n hasNextPage\n hasPreviousPage\n pageCount\n }\n nodes {\n id\n timeToRead\n fields {\n slug\n }\n frontmatter {\n title\n categories\n date(formatString: \"MMMM Do, YYYY\")\n hero {\n normal: childImageSharp {\n gatsbyImageData(\n width: 768\n placeholder: BLURRED\n formats: [AUTO]\n )\n }\n }\n description\n }\n }\n }\n }\n`\n"],"names":["CategoryTags","_ref","categories","className","length","React","map","category","key","Link","to","memo","Pagination","pageInfo","currentPage","hasNextPage","hasPreviousPage","pageCount","path","itemClass","i","Array","from","_","PostMeta","timeToRead","date","Math","round","PostPanel","title","description","hero","slug","image","getImage","normal","GatsbyImage","alt","PostsGroup","posts","_ref2","id","frontmatter","fields","data","allMdx","nodes","totalCount","pageContext","siteUrl","useSiteMetadata","DefaultLayout","pageUrl","pageTitle"],"sourceRoot":""}