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B,EAAT,EAAGuC,KAAH,OAClC,uBAAKpC,UAAU,8CAA8CsB,IAAKzB,EAAawC,GAAIe,IAAKvD,EAAawC,IACnG,gBAAC,IAAD,CAAkBxC,aAAcA,EAAcuB,IAAK,EAAK2B,MAAM3B,cApE7D,GAAiBG,EAAAA,WA8ElC,IC1DA,EAjBkB,SAAC,GAAkB,IAAhB8B,EAAe,EAAfA,SACJlB,GCLemB,EAAAA,EAAAA,gBAAe,cAArCC,kBDKAC,MACOtC,GENeoC,EAAAA,EAAAA,gBAAe,cAArCC,kBFMAC,MACJpC,EAAM,GACV,GAAIiC,EAASI,OAAQ,CACnB,IAAIC,EAAWL,EAASI,OAAOE,QAAQ,MAAO,IAAIC,MAAM,KAAKC,MAAK,SAACC,GAAY,OAAOA,EAAMC,MAAM,WAC9FL,IAAUtC,EAAM4C,UAAUN,EAASE,MAAM,QAAQ,KAGvD,OACE,gBAAC,IAAD,CAAQK,QAAQ,EAAOC,WAAW,EAAMC,SAAS,EAAOd,SAAUA,GAChE,gBAAC,IAAD,CAAS7B,MAAM,aAAaC,YAAY,oCACxC,gBAAC,EAAD,CAAsBU,cAAeA,EAAejB,KAAMA,EAAME,IAAKA","sources":["webpack://olugho_hp/./src/components/illustrations/card.js","webpack://olugho_hp/./src/components/seo.js","webpack://olugho_hp/./src/components/illustrations/show-images-with-search.js","webpack://olugho_hp/./src/pages/illustrations/index.js","webpack://olugho_hp/./src/hooks/use-all-illustrations.js","webpack://olugho_hp/./src/hooks/use-all-tags.js"],"sourcesContent":["import React from 'react'\nimport { Link } from \"gatsby\"\nimport { GatsbyImage } from \"gatsby-plugin-image\"\n\nconst IllustrationCard = class extends React.Component {\n onContextMenu(e) {\n e.preventDefault()\n }\n\n render() {\n const illustration = this.props.illustration\n\n return (\n
\n
\n \n \n \n
\n
\n

{illustration.frontmatter.t}

\n
\n {illustration.frontmatter.tags && illustration.frontmatter.tags.map((tag, index) => (\n #{tag}\n ))}\n
\n
\n
\n )\n }\n}\n\nexport default IllustrationCard\n","import React from 'react'\nimport Helmet from 'react-helmet'\n\nconst BaseSEO = ({ title, description }) => {\n return (\n \n {title}\n \n \n )\n}\n\nexport default BaseSEO\n","import React from 'react'\nimport IllustrationCard from './card'\nimport { navigate } from \"gatsby\"\n\nconst SearchImage = class extends React.Component {\n constructor(props) {\n super(props)\n const ids = this.searchList(props.tag)\n this.state = {\n showList: ids,\n tag: props.tag\n }\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.tag !== prevProps.tag) {\n this.updateList(this.props.tag)\n }\n }\n\n searchByTag = (tag, list) => {\n if (tag === \"\") { return list }\n return list.filter(illustration => {\n return illustration.frontmatter.tags.some((t) => t.indexOf(tag) !== -1)\n })\n }\n\n searchList = (tag) => {\n let list = this.props.illustrations.map(({ node: illustration }) => { return illustration } )\n list = this.searchByTag(tag, list)\n\n return list.map((illustration) => illustration.id)\n }\n\n updateList = (tag) => {\n this.setState(\n {\n tag: tag\n },\n () => {\n const list = this.searchList(tag)\n this.setState({ showList: list })\n navigate(`/illustrations/?tag=${tag}`)\n }\n )\n }\n\n changeSearchSelect = (event) => {\n this.updateList(event.target.value)\n }\n\n render() {\n const illustrations = this.props.illustrations.filter(({node: illustration}) => {\n return this.state.showList.includes(illustration.id);\n })\n return (\n
\n

イラスト一覧

\n
\n
\n \n
\n
\n
\n
\n {illustrations && illustrations.map(({ node: illustration }) => (\n
\n \n
\n ))}\n
\n
\n
\n )\n }\n}\n\nexport default SearchImage\n","import React from 'react'\nimport Layout from '../../components/layout'\nimport BaseSEO from '../../components/seo'\nimport ShowImagesWithSearch from '../../components/illustrations/show-images-with-search'\nimport { useAllIllustrations } from \"../../hooks/use-all-illustrations\"\nimport { useAllTags } from \"../../hooks/use-all-tags\"\n\nconst IngexPage = ({ location }) => {\n const { edges: illustrations } = useAllIllustrations()\n const { edges: tags } = useAllTags()\n let tag = \"\"\n if (location.search) {\n let tagParam = location.search.replace(/^\\?/, \"\").split(\"&\").find((param) => { return param.match(/tag=/) })\n if (tagParam) tag = decodeURI(tagParam.split(\"tag=\")[1])\n }\n\n return (\n \n \n \n \n )\n}\n\nexport default IngexPage\n","import { useStaticQuery, graphql } from \"gatsby\"\n\nexport const useAllIllustrations = () => {\n const { allMarkdownRemark } = useStaticQuery(\n graphql`\n query AllIllustrations {\n allMarkdownRemark(\n filter: {frontmatter: {templateKey: {eq: \"illustration\"}}}\n sort: {order: DESC, fields: frontmatter___d}\n ) {\n edges {\n node {\n id\n fields {\n slug\n }\n frontmatter {\n id\n t\n d(formatString: \"YYYY-MM-DD\")\n tags\n i_t {\n childImageSharp {\n gatsbyImageData(\n layout: CONSTRAINED,\n quality: 50,\n )\n }\n }\n }\n }\n }\n }\n }\n `\n )\n return allMarkdownRemark\n}\n","import { useStaticQuery, graphql } from \"gatsby\"\n\nexport const useAllTags = () => {\n const { allMarkdownRemark } = useStaticQuery(\n graphql`\n query AllTags {\n allMarkdownRemark(\n filter: {frontmatter: {templateKey: {eq: \"tag\"}}}\n sort: {order: ASC, fields: frontmatter___s}\n ) {\n edges {\n node {\n id\n frontmatter {\n title\n } \n }\n }\n }\n }\n `\n )\n return allMarkdownRemark\n}\n"],"names":["IllustrationCard","onContextMenu","e","preventDefault","render","illustration","this","props","className","Link","to","fields","slug","frontmatter","t","G","image","i_t","childImageSharp","gatsbyImageData","alt","imgClassName","width","imgStyle","height","placeholder","tags","map","tag","index","key","React","title","description","name","content","SearchImage","searchByTag","list","filter","some","indexOf","searchList","illustrations","node","id","updateList","setState","showList","navigate","changeSearchSelect","event","target","value","ids","state","componentDidUpdate","prevProps","includes","onChange","sid","location","useStaticQuery","allMarkdownRemark","edges","search","tagParam","replace","split","find","param","match","decodeURI","isRoot","isWebsite","noIndex"],"sourceRoot":""}