{"size": 935, "ext": "js", "max_stars_repo_path": "src/components/share.js", "max_stars_repo_name": "GBouffard/my-gatsby-contentul-tutorial", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/components/share.js", "max_issues_repo_name": "GBouffard/my-gatsby-contentul-tutorial", "max_issues_repo_issues_event_min_datetime": "2021-03-09T16:21:51.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T17:14:40.000Z", "max_forks_repo_path": "src/components/share.js", "max_forks_repo_name": "GBouffard/my-gatsby-contentul-tutorial", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 7, "max_forks_count": null, "avg_line_length": 25.9722222222, "max_line_length": 82, "alphanum_fraction": 0.6096256684}
import React from "react"

import twitterIcon from "../images/twitter.png"
import fbIcon from "../images/facebook.png"

const deployUrl = "https://gbouffard-my-gatsby-contentul-tutorial.netlify.com"

const Share = ({ title, pathname }) => {
  const twitterHref = `https://twitter.com/intent/tweet?url=${deployUrl +
    pathname}&text=${title}`

  const facebookHref = `https://www.facebook.com/sharer/sharer.php?u=${deployUrl +
    pathname}`

  return (
    <div
      style={{
        display: "flex",
        flexDirection: "column",
        margin: "10px 0 0 10px",
      }}
    >
      <strong>Share on: </strong>
      <a style={{ display: "flex" }} href={facebookHref} target="blank">
        <img src={fbIcon} alt="facebook" /> Facebook
      </a>

      <a style={{ display: "flex" }} href={twitterHref} target="blank">
        <img src={twitterIcon} alt="twitter" /> Twitter
      </a>
    </div>
  )
}

export default Share
