UNPKG

soames-gatsby-theme

Version:

A customizable Gatsby theme for personal websites using WordPress as a headless CMS.

24 lines (23 loc) 1.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const jsx_runtime_1 = require("react/jsx-runtime"); const gatsby_1 = require("gatsby"); const Bio = () => { const data = (0, gatsby_1.useStaticQuery)((0, gatsby_1.graphql) ` query BioQuery { author: wpUser { firstName name description avatar { url } } } `); const { author } = data; const avatarUrl = author?.avatar?.url; const twitterHandle = author?.name; return ((0, jsx_runtime_1.jsxs)("div", { className: "bio", children: [avatarUrl && ((0, jsx_runtime_1.jsx)("img", { alt: author.firstName, className: "bio-avatar", src: avatarUrl })), author.firstName && ((0, jsx_runtime_1.jsxs)("p", { children: ["Written by ", (0, jsx_runtime_1.jsx)("strong", { children: author.firstName }), ` `, author.description, ` `, twitterHandle && ((0, jsx_runtime_1.jsx)("a", { href: `https://twitter.com/${twitterHandle}`, children: "You should follow them on Twitter" }))] }))] })); }; exports.default = Bio;