-
Notifications
You must be signed in to change notification settings - Fork 1
/
component---src-pages-index-js-702077bb18e75f5d9c8d.js.map
1 lines (1 loc) · 7.01 KB
/
component---src-pages-index-js-702077bb18e75f5d9c8d.js.map
1
{"version":3,"sources":["webpack:///./src/components/Repos/Repo.js","webpack:///./src/components/Repos/Repos.js","webpack:///./src/components/Repos/index.js","webpack:///./src/pages/index.js","webpack:///./static/star.svg"],"names":["Repo","name","description","stargazers_count","html_url","lang","title","className","PREFIX","to","src","alt","href","target","RepoEnhanced","props","cleanedName","isNull","replace","setCleanName","croppedDescription","maxLength","isCropable","length","isNotCropable","substring","setCropDescription","defaultProps","Repos","repos","map","id","rest","key","ReposEnhanced","stateLang","useContext","Context","data","get","Index","Layout","React","Star","createElement","module","exports","default"],"mappings":"sOAQMA,G,OAAO,SAAC,GAAD,IAAGC,EAAH,EAAGA,KAAMC,EAAT,EAASA,YAAaC,EAAtB,EAAsBA,iBAAkBC,EAAxC,EAAwCA,SAAUC,EAAlD,EAAkDA,KAAMC,EAAxD,EAAwDA,MAAxD,OACX,6BAASC,UAAcC,IAAL,SAChB,kBAAC,IAAD,CAAMD,UAAcC,IAAL,eAA0BA,IAA1B,sBAAuDC,GAAOJ,EAAL,IAAaJ,GACnF,yBAAKM,UAAcC,IAAL,gBAA4BE,IAAG,cAAgBT,EAAhB,OAA4BU,IAAKV,KAEhF,yBAAKM,UAAcC,IAAL,kBACZ,wBAAID,UAAcC,IAAL,gBAA4BF,GACzC,uBAAGC,UAAcC,IAAL,sBAAkCN,GAC9C,0BAAMK,UAAcC,IAAL,gBACb,kBAAC,IAAD,CAAUD,UAAcC,IAAL,qBAClBL,GAEH,yBAAKI,UAAcC,IAAL,gBACZ,uBACED,UAAcC,IAAL,eAA0BA,IAA1B,sBACTI,KAAMR,EACNS,OAAO,SAHT,mBAOA,kBAAC,IAAD,CACEN,UAAcC,IAAL,eAA0BA,IAA1B,uBACTC,GAAOJ,EAAL,IAAaJ,GAFjB,oBA+BFa,EAAe,SAA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AwI,GAAK,UAGhOD,EAAKhB,aAAe,CAAC,QAAU,MAAM,GAAK,SAAS,EAAI,MAAM,EAAI,MAAM,MAAQ,QAAQ,OAAS,QAAQ,QAAU,cAAc,SAAW,WAAW,iBAAmB,mBAEzKkB,EAAOC,QAAUH,EAEjBA,EAAKI,QAAUJ,G","file":"component---src-pages-index-js-702077bb18e75f5d9c8d.js","sourcesContent":["import React from \"react\"\nimport PropTypes from \"prop-types\"\nimport { Link } from \"gatsby\"\nimport { PREFIX } from \"../constants\"\nimport StarIcon from \"../../../static/star.svg\"\nimport \"./repo.scss\"\nimport { isNull } from \"lodash\"\n\nconst Repo = ({ name, description, stargazers_count, html_url, lang, title }) => (\n <article className={`${PREFIX}-repo`}>\n <Link className={`${PREFIX}-repo__link ${PREFIX}-repo__link--avatar`} to={`${lang}/${name}`}>\n <img className={`${PREFIX}-repo__avatar`} src={`repos/logo-${name}.svg`} alt={name} />\n </Link>\n <div className={`${PREFIX}-repo__content`}>\n <h2 className={`${PREFIX}-repo__title`}>{title}</h2>\n <p className={`${PREFIX}-repo__description`}>{description}</p>\n <span className={`${PREFIX}-repo__stars`}>\n <StarIcon className={`${PREFIX}-repo__star-icon`} />\n {stargazers_count}\n </span>\n <div className={`${PREFIX}-repo__links`}>\n <a\n className={`${PREFIX}-repo__link ${PREFIX}-repo__link--github`}\n href={html_url}\n target=\"blank\"\n >\n Voir sur Github\n </a>\n <Link\n className={`${PREFIX}-repo__link ${PREFIX}-repo__link--details`}\n to={`${lang}/${name}`}\n >\n Voir détail\n </Link>\n </div>\n </div>\n </article>\n)\n\nconst setCropDescription = ({ description, maxLength = 100 }) => {\n if (isNull(description)) {\n return \"No description\"\n }\n\n const isCropable = !isNull(description) && description.length > maxLength\n const isNotCropable = !isNull(description) && description.length <= maxLength\n\n return {\n [isCropable]: `${description.substring(0, maxLength)} ...`,\n [isNotCropable]: description,\n }[true]\n}\nconst setCleanName = ({ name }) => {\n if (isNull(name)) {\n return \"No name\"\n }\n return name.replace(/-/gi, \" \")\n}\n\nconst RepoEnhanced = props => {\n const { description, name } = props\n\n const cleanedName = setCleanName({ name })\n const croppedDescription = setCropDescription({ description })\n return <Repo {...props} description={croppedDescription} title={cleanedName} />\n}\n\nRepoEnhanced.propTypes = {\n name: PropTypes.string.isRequired,\n html_url: PropTypes.string.isRequired,\n lang: PropTypes.string.isRequired,\n description: PropTypes.string,\n stargazers_count: PropTypes.number,\n}\n\nRepoEnhanced.defaultProps = {\n description: \"No description\",\n stargazers_count: 0,\n}\n\nexport default RepoEnhanced\n","import React from \"react\"\nimport Repo from \"./Repo\"\n\nconst Repos = ({ repos, lang }) => (\n <section className=\"grid-3-small-2 has-gutter af-repos\">\n {repos &&\n repos.map(({ id, ...rest }) => <Repo key={id} {...rest} lang={lang} />)}\n </section>\n)\n\nexport default Repos\n","import React, { useContext } from \"react\"\nimport { get } from \"lodash\"\nimport { graphql, useStaticQuery } from \"gatsby\"\nimport { Context } from \"../../templates/Context\"\nimport Repos from \"./Repos\"\n\nexport const queryRepos = graphql`\n query ReposQuery {\n allGithubRepo(\n sort: { order: DESC, fields: stargazers_count }\n filter: { topics: { in: \"guildevopen\" } }\n ) {\n nodes {\n id\n name\n description\n stargazers_count\n html_url\n }\n }\n }\n`\n\nconst ReposEnhanced = () => {\n const { stateLang } = useContext(Context)\n const data = useStaticQuery(queryRepos)\n const repos = get(data, \"allGithubRepo.nodes\", [])\n return <Repos repos={repos} lang={stateLang} />\n}\n\nexport default ReposEnhanced\n","import React from \"react\"\nimport Layout from \"../templates/Layout\"\nimport Repos from \"../components/Repos\"\n\nconst Index = () => {\n return (\n <Layout>\n <Repos />\n </Layout>\n )\n}\n\nexport default Index\n","var React = require('react');\n\nfunction Star (props) {\n return React.createElement(\"svg\",props,React.createElement(\"polygon\",{\"points\":\"255,402.212 412.59,497.25 370.897,318.011 510,197.472 326.63,181.738 255,12.75 183.371,181.738 0,197.472 139.103,318.011 97.41,497.25\",\"id\":\"star\"}));\n}\n\nStar.defaultProps = {\"version\":\"1.1\",\"id\":\"Capa_1\",\"x\":\"0px\",\"y\":\"0px\",\"width\":\"510px\",\"height\":\"510px\",\"viewBox\":\"0 0 510 510\",\"xmlSpace\":\"preserve\",\"enableBackground\":\"new 0 0 510 510\"};\n\nmodule.exports = Star;\n\nStar.default = Star;\n"],"sourceRoot":""}