-
Notifications
You must be signed in to change notification settings - Fork 0
/
component---src-pages-gov-news-js-f615caaa64c84aa1cf4f.js.map
1 lines (1 loc) · 3.22 KB
/
component---src-pages-gov-news-js-f615caaa64c84aa1cf4f.js.map
1
{"version":3,"sources":["webpack:///./src/pages/gov-news.js"],"names":["NewsCard","styled","BasicCard","NewsPage","props","data","useTranslation","i18n","t","item","node","href","withLanguage","rel","target","variant","color","date","title","_get","allGovNews","edges","map","index","key","children","GovNewsQuery"],"mappings":"2FAAA,kMAYMA,EAAWC,YAAOC,KAAV,wEAAGD,CAAH,uCAiDCE,UA5CE,SAAAC,GAAU,IACjBC,EAASD,EAATC,KADgB,EAEJC,cAAZC,EAFgB,EAEhBA,KAAMC,EAFU,EAEVA,EAERC,EAAO,SAAC,GAAc,IAAZC,EAAW,EAAXA,KACd,OACE,kBAACV,EAAD,KAEE,uBACEW,KAAMC,YAAaL,EAAMG,EAAM,QAC/BG,IAAI,sBACJC,OAAO,UAEP,kBAAC,IAAD,CAAYC,QAAQ,QAAQC,MAAM,eAC/BN,EAAKO,MAER,kBAAC,IAAD,CAAYF,QAAQ,KAAKC,MAAM,eAC5BJ,YAAaL,EAAMG,EAAM,aAOpC,OACE,kBAAC,IAAD,KACE,kBAAC,IAAD,CAAKQ,MAAM,aACX,kBAAC,IAAD,CAAYH,QAAQ,MAAMP,EAAE,mBAC5B,kBAAC,IAAD,CAAYO,QAAQ,SAClB,kBAAC,IAAD,CAAMJ,KAAMH,EAAE,gBAAiBM,OAAO,UACnCN,EAAE,qBAGP,kBAAC,IAAD,CAAYO,QAAQ,SACjBP,EAAE,6BACFW,IAAKd,EAAKe,WAAY,qBAAsB,KAE9Cf,EAAKe,WAAWC,MAAMC,KAAI,SAACZ,EAAMa,GAAP,OACzB,yBAAKC,IAAKD,EAAOE,SAAUhB,EAAKC,UAQjC,IAAMgB,EAAY","file":"component---src-pages-gov-news-js-f615caaa64c84aa1cf4f.js","sourcesContent":["import React from \"react\"\nimport { useTranslation } from \"react-i18next\"\nimport SEO from \"@/components/templates/SEO\"\nimport Layout from \"@components/templates/Layout\"\nimport Typography from \"@material-ui/core/Typography\"\nimport { graphql } from \"gatsby\"\nimport Link from \"@material-ui/core/Link\"\nimport { BasicCard } from \"@components/atoms/Card\"\nimport styled from \"styled-components\"\nimport { withLanguage } from \"../utils/i18n\"\nimport _get from \"lodash.get\"\n\nconst NewsCard = styled(BasicCard)`\n margin-top: 8px;\n margin-bottom: 8px;\n`\n\nconst NewsPage = props => {\n const { data } = props\n const { i18n, t } = useTranslation()\n\n const item = ({ node }) => {\n return (\n <NewsCard>\n {/* TODO: Using Link will render a wrong URL (en/zh) */}\n <a\n href={withLanguage(i18n, node, \"link\")}\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n >\n <Typography variant=\"body2\" color=\"textPrimary\">\n {node.date}\n </Typography>\n <Typography variant=\"h6\" color=\"textPrimary\">\n {withLanguage(i18n, node, \"title\")}\n </Typography>\n </a>\n </NewsCard>\n )\n }\n\n return (\n <Layout>\n <SEO title=\"NewsPage\" />\n <Typography variant=\"h2\">{t(\"gov_news.title\")}</Typography>\n <Typography variant=\"body2\">\n <Link href={t(\"gov_news.url\")} target=\"_blank\">\n {t(\"gov_news.source\")}\n </Link>\n </Typography>\n <Typography variant=\"body2\">\n {t(\"waiting_time.last_updated\")}\n {_get(data.allGovNews, \"edges[0].node.date\", \"\")}\n </Typography>\n {data.allGovNews.edges.map((node, index) => (\n <div key={index} children={item(node)} />\n ))}\n </Layout>\n )\n}\n\nexport default NewsPage\n\nexport const GovNewsQuery = graphql`\n query {\n allGovNews(sort: { order: DESC, fields: date }) {\n edges {\n node {\n title_en\n title_zh\n link_en\n link_zh\n date\n }\n }\n }\n }\n`\n"],"sourceRoot":""}