{"version":3,"sources":["webpack:///./src/pages/news-and-events/news-releases.js","webpack:///./src/utils/sorting.js","webpack:///./src/components/PaginationNav/PaginationNav.module.scss","webpack:///./src/components/LinkList/LinkList.js","webpack:///./src/components/PaginationNav/PaginationNav.js","webpack:///./src/components/LinkList/LinkList.module.scss"],"names":["NewsReleasesPage","_ref","data","intl","useIntl","currentPage","setPage","useState","newsArr","markdownArticles","edges","map","link","path","node","frontmatter","title","toLowerCase","replace","text","subtitle","date","moment","format","internal","React","createElement","Layout","header","className","FormattedMessage","id","breadcrumb","SEO","lang","locale","formatMessage","Container","Row","Col","Alert","href","LinkList","links","getPaginatedResults","length","PaginationNav","clickEvt","resultsLength","arr","page","first","last","slice","orderByDate","key","sort","a","b","dateA","Date","getTime","dateB","module","exports","numberedList","props","ListType","ClassNames","componentStyles","linkList","filter","hideFrench","i","Link","to","description","centered","FaExternalLinkAlt","icon","style","fontWeight","numPages","Math","ceil","paginationNav","role","parseInt","disabled","FaAngleDoubleLeft","textLabel","onClick","FaAngleLeft","getPageItems","pageItems","firstPage","lastPage","classes","numberedLink","active","push","FaAngleRight","FaAngleDoubleRight"],"mappings":"wHAAA,qJAmEeA,UArDUC,IAAe,IAAd,KAAEC,GAAMD,EACjC,MAAME,EAAOC,qBACP,EAACC,EAAY,EAACC,GAAWC,mBAAS,GAElCC,EAAUN,EAAKO,iBAAiBC,MAAMC,IAAKC,IAAI,CACpDC,KAAM,kCAAkCD,EAAKE,KAAKC,YAAYC,MAAMC,cAAcC,QAAQ,OAAQ,QAClGC,KAAMP,EAAKE,KAAKC,YAAYC,MAC5BI,SAAUR,EAAKE,KAAKC,YAAYK,SAChCC,KAAMC,IAAOV,EAAKE,KAAKC,YAAYM,MAAME,OAAO,iBAChDC,UAAU,KAGX,OACCC,IAAAC,cAACC,IAAM,CACNC,OACCH,IAAAC,cAAA,QAAMG,UAAU,QACfJ,IAAAC,cAACI,mBAAgB,CAACC,GAAG,sBAGvBC,WAAY,CACXb,KAAMM,IAAAC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C/D,IAAAC,cAAA,QAAMG,UAAWwC,IAAgBqB,WAAW,QAAW,IAACjE,IAAAC,cAAC4E,IAAkB,OAG5E7E,IAAAC,cAAA,MAAI4D,KAAK,QACR7D,IAAAC,cAAA,UAAQiE,QAASA,IAAM5C,EAASmC,IAC/BzD,IAAAC,cAAA,QAAMG,UAAWwC,IAAgBqB,WAAW,QAAW,IAACjE,IAAAC,cAAC4E,IAAkB,Y,qBC/FlFvC,EAAOC,QAAU,CAAC,SAAW,mCAAmC,SAAW,mCAAmC,QAAU,kCAAkC,KAAO,+BAA+B,MAAQ,gCAAgC,YAAc,sCAAsC,SAAW","file":"component---src-pages-news-and-events-news-releases-js-eb7962d8ec7a9d31567c.js","sourcesContent":["import React, { useState } from 'react';\r\nimport { graphql } from 'gatsby';\r\nimport moment from 'moment';\r\nimport { Container, Row, Col } from 'react-grid-system';\r\nimport { useIntl, FormattedMessage } from 'gatsby-plugin-intl';\r\n\r\nimport Layout from '../../components/Layouts/layout';\r\nimport Alert from '../../components/Alert/Alert';\r\nimport SEO from '../../components/seo';\r\nimport LinkList from '../../components/LinkList/LinkList';\r\nimport PaginationNav from '../../components/PaginationNav/PaginationNav';\r\n\r\nimport { getPaginatedResults } from '../../utils/sorting';\r\n\r\nconst NewsReleasesPage = ({ data }) => {\r\n\tconst intl = useIntl();\r\n\tconst [currentPage, setPage] = useState(1);\r\n\r\n\tconst newsArr = data.markdownArticles.edges.map((link) => ({\r\n\t\tpath: `/news-and-events/news-releases/${link.node.frontmatter.title.toLowerCase().replace(/\\s+/g, '-')}/`,\r\n\t\ttext: link.node.frontmatter.title,\r\n\t\tsubtitle: link.node.frontmatter.subtitle,\r\n\t\tdate: moment(link.node.frontmatter.date).format('MMMM Do, YYYY'),\r\n\t\tinternal: true\r\n\t}));\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tbreadcrumb={{\r\n\t\t\t\ttext: ,\r\n\t\t\t\tpath: '/news-and-events/'\r\n\t\t\t}}\r\n\t\t>\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{intl.locale === 'fr' && (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\tPour les services en français, veuillez contacter le Service des licences et à la\r\n\t\t\t\t\t\t\t\t\tclientèle de l’Office de réglementation de la construction des logements au\r\n\t\t\t\t\t\t\t\t\t416-487-HCRA (4272) ou info@hcraontario.ca\r\n\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t{newsArr.length > 10 && (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t\r\n\t);\r\n};\r\nexport default NewsReleasesPage;\r\n\r\nexport const pageQuery = graphql`\r\n\tquery NewsQuery {\r\n\t\tmarkdownArticles: allMarkdownRemark(\r\n\t\t\tfilter: { fileAbsolutePath: { regex: \"/newsevents/\" } }\r\n\t\t\tsort: { order: DESC, fields: frontmatter___date }\r\n\t\t) {\r\n\t\t\tedges {\r\n\t\t\t\tnode {\r\n\t\t\t\t\tid\r\n\t\t\t\t\tfrontmatter {\r\n\t\t\t\t\t\ttitle\r\n\t\t\t\t\t\tsubtitle\r\n\t\t\t\t\t\tdate\r\n\t\t\t\t\t\timage {\r\n\t\t\t\t\t\t\tabsolutePath\r\n\t\t\t\t\t\t\tchildImageSharp {\r\n\t\t\t\t\t\t\t\tfluid {\r\n\t\t\t\t\t\t\t\t\t...GatsbyImageSharpFluid\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n`;\r\n","// SORT ASC\r\n// params: arr, str(key used to sort)\r\nexport const sortAsc = (arr, key) =>\r\n\tarr.sort((a, b) => {\r\n\t\tif (a[key] < b[key]) return -1;\r\n\t\tif (a[key] > b[key]) return 1;\r\n\t\telse if (a[key] === null) return 1;\r\n\t\telse if (b[key] === null) return -1;\r\n\t\telse return 0;\r\n\t});\r\n\r\n// SORT DESC\r\n// params: arr, str(key used to sort)\r\nexport const sortDesc = (arr, key) =>\r\n\tarr.sort((a, b) => {\r\n\t\tif (a[key] < b[key]) return 1;\r\n\t\telse if (a[key] > b[key]) return -1;\r\n\t\telse if (a[key] === null) return 1;\r\n\t\telse if (b[key] === null) return -1;\r\n\t\telse return 0;\r\n\t});\r\n\r\n// getPaginatedResults\r\n// params: arr, active page #\r\n// return: section of original array\r\nexport const getPaginatedResults = (arr, page) => {\r\n\tconst numResults = 10; //TODO have this set in state?\r\n\tconst first = (page - 1) * numResults;\r\n\tconst last = first + numResults;\r\n\treturn arr.slice(first, last);\r\n};\r\n\r\nexport const orderByDate = (arr, key) =>\r\n\tarr.sort((a, b) => {\r\n\t\tconst dateA = new Date(a[key]).getTime();\r\n\t\tconst dateB = new Date(b[key]).getTime();\r\n\t\t// return dateA.getTime() - dateB.getTime()\r\n\t\tif (dateA < dateB) return 1;\r\n\t\telse if (dateA > dateB) return -1;\r\n\t\telse if (dateA === null) return 1;\r\n\t\telse if (dateB === null) return -1;\r\n\t\telse return 0;\r\n\t});\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"gridDemoBlock\":\"PaginationNav-module--gridDemoBlock--3Fr2T\",\"colourSampleGrid\":\"PaginationNav-module--colourSampleGrid--o5YYn\",\"darkStyle\":\"PaginationNav-module--darkStyle--2W3yk\",\"medBgStyle\":\"PaginationNav-module--medBgStyle--3dFHA\",\"strong\":\"PaginationNav-module--strong--1Bv_e\",\"thin\":\"PaginationNav-module--thin--2oVz0\",\"sm\":\"PaginationNav-module--sm--3hPKn\",\"underline\":\"PaginationNav-module--underline--m1fcV\",\"linkHeader\":\"PaginationNav-module--linkHeader--Y8Hmz\",\"pageBody\":\"PaginationNav-module--pageBody--3b68n\",\"homePageBody\":\"PaginationNav-module--homePageBody--2uksK\",\"largeNums\":\"PaginationNav-module--largeNums--oghCX\",\"centered\":\"PaginationNav-module--centered--2BDuM\",\"blockList\":\"PaginationNav-module--blockList--3r5dH\",\"sitemapList\":\"PaginationNav-module--sitemapList--1FRh0\",\"title\":\"PaginationNav-module--title--3Ywao\",\"definition\":\"PaginationNav-module--definition--3ITYb\",\"bold\":\"PaginationNav-module--bold--1cFFf\",\"uppercase\":\"PaginationNav-module--uppercase--W8WL1\",\"sentenceCase\":\"PaginationNav-module--sentenceCase--26z6f\",\"licensed\":\"PaginationNav-module--licensed--283O_\",\"brandPrimary\":\"PaginationNav-module--brandPrimary--29z4d\",\"unlicensed\":\"PaginationNav-module--unlicensed--ZJel8\",\"orange\":\"PaginationNav-module--orange--1NgjU\",\"red\":\"PaginationNav-module--red--14aHH\",\"footnote\":\"PaginationNav-module--footnote--4u06w\",\"noWrap\":\"PaginationNav-module--noWrap--2sBYh\",\"borderRight\":\"PaginationNav-module--borderRight--cQj1H\",\"topAlign\":\"PaginationNav-module--topAlign--2hRQt\",\"summaryRow\":\"PaginationNav-module--summaryRow--1jJzY\",\"overflowContainer\":\"PaginationNav-module--overflowContainer--28DKI\",\"tile\":\"PaginationNav-module--tile--VUfnv\",\"rowCenter\":\"PaginationNav-module--rowCenter--1NDww\",\"pageRow\":\"PaginationNav-module--pageRow--1CNpi\",\"fullWidthRow\":\"PaginationNav-module--fullWidthRow--2JqmX\",\"fieldset\":\"PaginationNav-module--fieldset--3qnCu\",\"resultsListItem\":\"PaginationNav-module--resultsListItem--jP1fX\",\"offsetContainer\":\"PaginationNav-module--offsetContainer--3jnIb\",\"flexContainer\":\"PaginationNav-module--flexContainer--25sVK\",\"loader\":\"PaginationNav-module--loader--3f8Z9\",\"loaderSpinner\":\"PaginationNav-module--loader-spinner--3U8jL\",\"largeIcon\":\"PaginationNav-module--largeIcon--18ukq\",\"paginationNav\":\"PaginationNav-module--paginationNav--3dZva\",\"numberedLink\":\"PaginationNav-module--numberedLink--bQLNb\",\"active\":\"PaginationNav-module--active--2Vj9O\",\"disabled\":\"PaginationNav-module--disabled--1AbLq\",\"textLabel\":\"PaginationNav-module--textLabel--1dUtH\"};","import React from 'react';\r\nimport { Link } from 'gatsby-plugin-intl';\r\nimport ClassNames from 'classnames';\r\nimport componentStyles from './LinkList.module.scss';\r\nimport { FaExternalLinkAlt } from 'react-icons/fa';\r\n\r\nconst LinkList = ({ links, locale, numberedList, ...props }) => {\r\n\tconst ListType = numberedList ? 'ol' : 'ul';\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{links\r\n\t\t\t\t.filter((link) => !locale || locale === 'en' || (locale === 'fr' && !link.hideFrench))\r\n\t\t\t\t.map((link, i) => (\r\n\t\t\t\t\t
  • \r\n\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t{link.internal && (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t\t\t{link.text}\r\n\t\t\t\t\t\t\t\t\t\t{link.description && (\r\n\t\t\t\t\t\t\t\t\t\t\t{link.description}\r\n\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t{link.subtitle && {link.subtitle}}\r\n\t\t\t\t\t\t\t\t\t\t{link.date && {link.date}}\r\n\t\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t\t\t{!link.internal && (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t\t\t{link.text}\r\n\t\t\t\t\t\t\t\t\t\t{link.description && (\r\n\t\t\t\t\t\t\t\t\t\t\t{link.description}\r\n\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t{link.subtitle && {link.subtitle}}\r\n\t\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t
    \r\n\t\t\t\t\t
  • \r\n\t\t\t\t))}\r\n\t\t\r\n\t);\r\n};\r\n\r\nexport default LinkList;\r\n","import React from 'react';\r\nimport componentStyles from './PaginationNav.module.scss';\r\nimport ClassNames from 'classnames';\r\nimport { FaAngleLeft, FaAngleRight, FaAngleDoubleLeft, FaAngleDoubleRight } from 'react-icons/fa';\r\n\r\nconst PaginationNav = ({ currentPage, clickEvt, resultsLength, ...props }) => {\r\n\tconst numPages = Math.ceil(resultsLength / 10);\r\n\r\n\tconst getPageItems = () => {\r\n\t\tlet pageItems = [];\r\n\t\tconst maxNavLength = 5;\r\n\t\tlet firstPage, lastPage;\r\n\t\tif (numPages <= maxNavLength) {\r\n\t\t\t// number pages less than max, so show all pages\r\n\t\t\tfirstPage = 0;\r\n\t\t\tlastPage = numPages;\r\n\t\t} else {\r\n\t\t\t// calculate start and end pages, if num pages more than max\r\n\t\t\tif (parseInt(currentPage) <= 2) {\r\n\t\t\t\t// currentPage near start\r\n\t\t\t\tfirstPage = 0;\r\n\t\t\t\tlastPage = maxNavLength;\r\n\t\t\t} else if (parseInt(currentPage) + 2 >= numPages) {\r\n\t\t\t\t// current page near the end\r\n\t\t\t\tfirstPage = numPages - maxNavLength;\r\n\t\t\t\tlastPage = numPages;\r\n\t\t\t} else {\r\n\t\t\t\t// current page somewhere in the middle\r\n\t\t\t\tfirstPage = parseInt(currentPage) - 3;\r\n\t\t\t\tlastPage = parseInt(currentPage) + 2;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (let i = firstPage; i < lastPage; i++) {\r\n\t\t\tlet classes =\r\n\t\t\t\ti + 1 === parseInt(currentPage)\r\n\t\t\t\t\t? ClassNames(componentStyles.numberedLink, componentStyles.active)\r\n\t\t\t\t\t: componentStyles.numberedLink;\r\n\t\t\tpageItems.push(\r\n\t\t\t\t
  • \r\n\t\t\t\t\t\r\n\t\t\t\t
  • \r\n\t\t\t);\r\n\t\t}\r\n\t\treturn pageItems;\r\n\t};\r\n\r\n\treturn (\r\n\t\t\r\n\t);\r\n};\r\n\r\nexport default PaginationNav;\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"linkList\":\"LinkList-module--linkList--12ux9\",\"centered\":\"LinkList-module--centered--qgu4d\",\"between\":\"LinkList-module--between--vroZH\",\"icon\":\"LinkList-module--icon--2FNYu\",\"title\":\"LinkList-module--title--kxjwE\",\"description\":\"LinkList-module--description--3ZAFb\",\"subtitle\":\"LinkList-module--subtitle--30bpr\"};"],"sourceRoot":""}