{"version":3,"sources":["webpack:///./src/pages/about.js","webpack:///./src/components/Jobs.js"],"names":["About","data","about","nodes","info","title","stack","image","className","fluid","childImageSharp","map","item","key","id","to","Jobs","jobs","useStaticQuery","allStrapiJobs","React","useState","value","setValue","company","position","date","description","job","index","strapiId","onClick","name"],"mappings":"6FAAA,qGAyDeA,UAlDD,SAAC,GAIR,IACL,EADI,EAHJC,KACEC,MAASC,MAGiC,GAApCC,EAAR,EAAQA,KAAMC,EAAd,EAAcA,MAAOC,EAArB,EAAqBA,MAAOC,EAA5B,EAA4BA,MAC5B,OACE,kBAAC,IAAD,KACE,6BAASC,UAAU,cACjB,yBAAKA,UAAU,+BACb,kBAAC,IAAD,CAAOC,MAAOF,EAAMG,gBAAgBD,MAAOD,UAAU,cACrD,6BAASA,UAAU,cACjB,kBAAC,IAAD,CAAOH,MAAOA,IACd,2BAAID,GACJ,yBAAKI,UAAU,eACZF,EAAMK,KAAI,SAAAC,GACT,OAAO,0BAAMC,IAAKD,EAAKE,IAAKF,EAAKP,aAKzC,kBAAC,IAAD,CAAMU,GAAG,WAAWP,UAAU,kBAA9B,eAIF,kBAAC,IAAD,S,kCChCN,6DAgHeQ,IAxFF,WAIX,IAO0BC,EAPbC,YArBJ,aA4BPC,cAAiBhB,MAiBnB,EAA0BiB,IAAMC,SAAS,GAAlCC,EAAP,KAAcC,EAAd,KAEA,EAAiDN,EAAKK,GAA9CE,EAAR,EAAQA,QAASC,EAAjB,EAAiBA,SAAUC,EAA3B,EAA2BA,KAAMC,EAAjC,EAAiCA,YAEjC,OACE,6BAASnB,UAAU,gBACjB,kBAAC,IAAD,CAAOH,MAAM,eACb,yBAAKG,UAAU,eAIb,yBAAKA,UAAU,iBAOZS,EAAKN,KAAI,SAACiB,EAAKC,GACd,OAEE,4BACEhB,IAAKe,EAAIE,SAGTC,QAAS,kBAAMR,EAASM,IACxBrB,UAAS,YAAaqB,IAAUP,GAAS,eAExCM,EAAIJ,aAMb,6BAAShB,UAAU,YACjB,4BAAKiB,GACL,4BAAKD,GACL,uBAAGhB,UAAU,YAAYkB,GAKxBC,EAAYhB,KAAI,SAAAC,GACf,OACE,yBAAKC,IAAKD,EAAKE,GAAIN,UAAU,YAC3B,kBAAC,IAAD,CAAoBA,UAAU,aAC9B,2BAAII,EAAKoB","file":"component---src-pages-about-js-4655947f772ee59ba4e6.js","sourcesContent":["import React from \"react\"\nimport Layout from \"../components/Layout\"\nimport Jobs from \"../components/Jobs\"\nimport { graphql, Link } from \"gatsby\"\nimport Title from \"../components/Title\"\nimport Image from \"gatsby-image\"\n\nconst About = ({\n data: {\n about: { nodes },\n },\n}) => {\n const { info, title, stack, image } = nodes[0]\n return (\n \n
\n
\n \n
\n \n <p>{info}</p>\n <div className=\"about-stack\">\n {stack.map(item => {\n return <span key={item.id}>{item.title}</span>\n })}\n </div>\n </article>\n </div>\n <Link to=\"/contact\" className=\"center-btn btn\">\n Contact me\n </Link>\n </section>\n <Jobs />\n </Layout>\n )\n}\nexport const query = graphql`\n {\n about: allStrapiAbout {\n nodes {\n stack {\n id\n title\n }\n title\n info\n image {\n childImageSharp {\n fluid {\n ...GatsbyImageSharpFluid\n }\n }\n }\n }\n }\n }\n`\nexport default About\n","import React from \"react\"\nimport Title from \"./Title\"\nimport { FaAngleDoubleRight } from \"react-icons/fa\"\nimport { graphql, useStaticQuery } from \"gatsby\"\nimport { Link } from \"gatsby\"\n\n// this query was taken from graphql using strapi cms data\nconst query = graphql`\n {\n allStrapiJobs(sort: { fields: strapiId, order: DESC }) {\n nodes {\n strapiId\n company\n date\n position\n description {\n id\n name\n }\n }\n }\n }\n`\n\nconst Jobs = () => {\n // in order to use the query variable:\n // you have to use the useStaticQuery hook\n // you create a variable with the useStaticQuery Hook and pass in the query variable from above the component\n const data = useStaticQuery(query)\n\n // now, we can start destructuring\n // set the const {} object equal to data\n // within {}, we will pull out from the query variable - allStrapiJobs\n // since it is an object, I want to pull out nodes and give it an alias - jobs\n const {\n allStrapiJobs: { nodes: jobs },\n } = data\n\n // functionality:\n // hard-coded:\n // when we click on the buttons with the company titles, we just want to grab one item from that array (nodes: jobs)\n // the item is going to depend on the index as we have sorted in our query\n // you'll always get a different result depending on the index of the job because this is the hard-coded version\n // const { company, position, date, description } = jobs[0]\n // dynamically:\n // in order to set it dynamically, you would want to use useState hook\n // useState hook always returns an array\n // [ value, setValue ] is array destructuring\n // React.useState(0) - default value of zero\n // we're using useState hook with a default value and we're getting back two things in our array which are destructured\n // I can name them whatever I want but in this case, I've named them [value, setValue]\n // setValue is the function that controls it and value represents whatever I have on React.useState(0) which atm is is 0\n const [value, setValue] = React.useState(0)\n // now we are taking the current value of the useState and it will dynamically change when setValue is invoked\n const { company, position, date, description } = jobs[value]\n\n return (\n <section className=\"section jobs\">\n <Title title=\"experience\" />\n <div className=\"jobs-center\">\n {/* btn container */}\n {/* here we have a div */}\n {/* we want to iterate over our jobs array and for each and every item, we want to display a button */}\n <div className=\"btn-container\">\n {/* using a map function with the parameters of job and the index of it */}\n {/* and then we want it to return the button with the job title */}\n {/* key={job.strapiId} helps react identify which items have changed, are\n added, or are removed. */}\n {/* {job.company} is the item that will have the company field which each value/button */}\n {/* the className is dynamic. we set up template strings with the className of job-btn but if the index will match the index/value of the current state (jobs[value]) then it will set this up as an active button using the className */}\n {jobs.map((job, index) => {\n return (\n // ternary: if index is equal to whatever the value is then add also an 'active-btn' class\n <button\n key={job.strapiId}\n // at the moment the active button will always be the 0 index\n // So we can change that by using onClick, whatever index you have for that item, once you click on a new button, the arrow functions runs and it changes the value (jobs[value])\n onClick={() => setValue(index)}\n className={`job-btn ${index === value && \"active-btn\"}`}\n >\n {job.company}\n </button>\n )\n })}\n </div>\n {/* job info */}\n <article className=\"job-info\">\n <h3>{position}</h3>\n <h4>{company}</h4>\n <p className=\"job-date\">{date}</p>\n {/* description is an array so we need to do more than just normal tags and passing in of the object */}\n {/* since description is an array, we want to map over it and take each item within the current iteration and return it as a div container */}\n {/* this div container will have a key since react needs help with the identification of the id and a class */}\n {/* within the div there is an imported icon from react-icons and a <p> tag containing the description which in this case is name */}\n {description.map(item => {\n return (\n <div key={item.id} className=\"job-desc\">\n <FaAngleDoubleRight className=\"job-icon\"></FaAngleDoubleRight>\n <p>{item.name}</p>\n </div>\n )\n })}\n </article>\n </div>\n {/* this will be a link as a button that redirects us to the about me page */}\n {/* <Link to=\"/about\" className=\"btn center-btn\">\n more info\n </Link> */}\n </section>\n )\n}\n\nexport default Jobs\n"],"sourceRoot":""}