-
Notifications
You must be signed in to change notification settings - Fork 0
/
component---src-pages-notice-tsx-e0a28c02d7f116d8798b.js.map
1 lines (1 loc) · 6.71 KB
/
component---src-pages-notice-tsx-e0a28c02d7f116d8798b.js.map
1
{"version":3,"file":"component---src-pages-notice-tsx-e0a28c02d7f116d8798b.js","mappings":"uMAUA,MAyGMA,GAAOC,EAAAA,EAAAA,GAAA,WAAAC,OAAA,YAAAD,CAAA,CAAAE,KAAA,UAAAC,OAAA,0DAMb,UA/GgDC,IAC9C,MAAM,KAAEC,GAASD,GACX,MAAEE,GAAUD,EAAKE,mBACjB,EAACC,EAAM,EAAEC,IAAaC,EAAAA,EAAAA,UAAS,IAE/BC,GAAQC,EAAAA,EAAAA,UACZ,KACEC,EAAAA,EAAAA,IAAgBP,GAAOQ,MAAK,CAACC,EAAGC,KAC9B,MAAMC,GAAOC,EAAAA,EAAAA,IAAOH,EAAEI,YAAYC,MAGlC,OAFeF,EAAAA,EAAAA,IAAOF,EAAEG,YAAYC,MAEtBC,UAAYJ,EAAKI,SAAS,KAE5C,CAACf,IAGGgB,GAAYV,EAAAA,EAAAA,UAChB,IACED,EAAMY,KAAKC,IACT,MAAM,KAAEC,GAASD,EAAGE,QACd,KAAEN,EAAMO,MAAOzB,GAASsB,EAAGL,aAC1B,CAAES,EAAOC,IAAOR,EAAAA,EAAAA,IAAQD,GAG/B,MAAO,CACLU,MAHWZ,EAAAA,EAAAA,IAAOE,GAGPC,UACXD,KAASW,OAAOH,GAAM,KAAKG,OAAOF,GAAI,IACtC3B,OACAuB,OACD,KAEL,CAACd,IAGGqB,GAAQpB,EAAAA,EAAAA,UAAQ,KACpB,MAAMqB,EAAStB,EAAMuB,QAA4E,CAACC,EAAKC,KACrG,MAAM,KAAEX,GAASW,EAAKV,QAChB,KAAEN,EAAMO,MAAOzB,GAASkC,EAAKjB,aAC5BkB,EAAMT,EAAOC,IAAOR,EAAAA,EAAAA,IAAQD,GAUnC,OARKe,EAAIE,KAAOF,EAAIE,GAAQ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OAAOuC,KAAMvB,IAG1CX,EAAMT,KAAKC,IACTyB,EAAAA,EAAAA,MAACC,EAAAA,GAAS,CAAAC,SAAA,EACRC,EAAAA,EAAAA,KAAA,OAAAD,UACEC,EAAAA,EAAAA,KAACY,EAAAA,EAAS,CAACrC,MAAOH,EAAGa,KAAM6B,KAAM1C,EAAGb,MAAOsD,WAAS,OAEtDb,EAAAA,EAAAA,KAACO,EAAAA,GAAM,CAACC,EAAG,MAJGpC,EAAGa,aASf,C","sources":["webpack://@portfolio/blog/./src/pages/notice.tsx"],"sourcesContent":["import styled from '@emotion/styled'\nimport { Container, Spacer, Text, SearchInput } from '@justsloth/core'\nimport { graphql } from 'gatsby'\nimport { FC, useMemo, useState } from 'react'\n\nimport { ListTable } from '../components/ListTable'\nimport { Seo } from '../components/Seo'\nimport { IndexQuery, PageProps } from '../types/type'\nimport { toDate, getTime, filteredByDraft } from '../utils'\n\nconst NoticesPage: FC<PageProps<IndexQuery>> = (props) => {\n const { data } = props\n const { nodes } = data.allMarkdownRemark\n const [search, setSearch] = useState('')\n\n const posts = useMemo(\n () =>\n filteredByDraft(nodes).sort((a, b) => {\n const base = toDate(a.frontmatter.date)\n const target = toDate(b.frontmatter.date)\n\n return target.getTime() - base.getTime()\n }),\n [nodes]\n )\n\n const sortPosts = useMemo(\n () =>\n posts.map((it) => {\n const { slug } = it.fields\n const { date, title: name } = it.frontmatter\n const [, month, day] = getTime(date)\n const time = toDate(date)\n\n return {\n time: time.getTime(),\n date: `${Number(month)}월 ${Number(day)}일`,\n name,\n slug\n }\n }),\n [posts]\n )\n\n const views = useMemo(() => {\n const remake = posts.reduce<Record<string, Array<{ name: string; date: string; slug: string }>>>((acc, curr) => {\n const { slug } = curr.fields\n const { date, title: name } = curr.frontmatter\n const [year, month, day] = getTime(date)\n\n if (!acc[year]) acc[year] = []\n\n acc[year].push({\n name,\n date: `${Number(month)}월 ${Number(day)}일`,\n slug\n })\n\n return acc\n }, {})\n\n const values = Object.values(remake)\n return Object.keys(remake)\n .map((it, idx) => ({\n year: it,\n posts: values[idx]\n }))\n .sort((a, b) => Number(b.year) - Number(a.year))\n }, [nodes])\n\n const filteredSearchPosts = useMemo(\n () => sortPosts.filter((it) => it.name.toLocaleUpperCase().includes(search.toLocaleUpperCase())),\n [sortPosts, search]\n )\n\n const hasSearchText = search.length !== 0\n\n return (\n <Container>\n <Seo name='공지사항 목록' />\n <Wrapper>\n <Container>\n <div>\n <SearchInput value={search} onChange={setSearch} size='large' placeholder='검색할 텍스트를 입력하세요.' />\n </div>\n <Spacer y={2} />\n </Container>\n {hasSearchText ? (\n filteredSearchPosts.length === 0 ? (\n <>\n <Text size={20} weight={600}>\n 검색된 결과가 없어요 :(\n </Text>\n <Text size={20} weight={600}>\n 다른 결과를 검색해보시겠어요?\n </Text>\n </>\n ) : (\n <ListTable underline title='검색결과' list={filteredSearchPosts} />\n )\n ) : (\n views.map((it) => (\n <Container key={it.year}>\n <div>\n <ListTable title={it.year} list={it.posts} underline />\n </div>\n <Spacer y={2} />\n </Container>\n ))\n )}\n </Wrapper>\n </Container>\n )\n}\n\nconst Wrapper = styled.section`\n margin: 0 auto;\n width: 100%;\n max-width: 900px;\n padding: 2rem;\n`\nexport default NoticesPage\n\nexport const pageQuery = graphql`\n query BlogPostsQuery {\n allMarkdownRemark(sort: { frontmatter: { date: DESC } }) {\n nodes {\n fields {\n slug\n }\n frontmatter {\n title\n date\n image {\n publicURL\n }\n draft\n }\n }\n }\n }\n`\n"],"names":["Wrapper","_styled","target","name","styles","props","data","nodes","allMarkdownRemark","search","setSearch","useState","posts","useMemo","filteredByDraft","sort","a","b","base","toDate","frontmatter","date","getTime","sortPosts","map","it","slug","fields","title","month","day","time","Number","views","remake","reduce","acc","curr","year","push","values","Object","keys","idx","filteredSearchPosts","filter","toLocaleUpperCase","includes","hasSearchText","length","_jsxs","Container","children","_jsx","Seo","SearchInput","value","onChange","size","placeholder","Spacer","y","_Fragment","Text","weight","ListTable","underline","list"],"sourceRoot":""}