Skip to content

Commit

Permalink
done #53, sticky likes bar on posts
Browse files Browse the repository at this point in the history
  • Loading branch information
GraemeFulton committed Jun 29, 2024
1 parent 1982728 commit f7abb73
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 38 deletions.
60 changes: 23 additions & 37 deletions components/authorBio.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import SocialShare from "@/components/SocialShare";
import Image from 'next/image'
import Image from "next/image";
import dynamic from "next/dynamic";
import { DribbbleLogo, GithubLogo, TwitterLogo } from "./icons";

const KoFiButton = dynamic(
() => import("@/components/ko-fi-button/Ko-Fi-Button"),
Expand All @@ -11,16 +12,14 @@ export default function AuthorBio({ author, slug, title }) {
const pic = author?.avatar?.data?.attributes?.url
? author?.avatar?.data?.attributes?.url
: author?.legacyAvatar
? author?.legacyAvatar
: "https://s3-us-west-1.amazonaws.com/tinify-bucket/%2Fprototypr%2Ftemp%2F1595435549331-1595435549330.png";
? author?.legacyAvatar
: "https://s3-us-west-1.amazonaws.com/tinify-bucket/%2Fprototypr%2Ftemp%2F1595435549331-1595435549330.png";

const github = getGithubHandle(author?.github);
const twitter = getTwitterHandle(author?.twitter);
const dribbble = getDribbbleHandle(author?.dribbble);
const dribbble = getDribbbleHandle(author?.dribbble);
const kofi = getKofiHandle(author?.kofi);



return (
<div className="py-4">
<div
Expand Down Expand Up @@ -58,12 +57,11 @@ export default function AuthorBio({ author, slug, title }) {
</a>
</div>
<div className="w-full text-center">

<h1 className="text-xl mt-1 font-semibold leading-normal text-black/90">
{/* {author?.name ? author?.name : ""} */}
{`${author?.firstName ? author?.firstName:''}
${author?.lastName ? ' '+author?.lastName:''}
${(!author?.firstName && !author?.lastName) ? author?.name:''}`}
{`${author?.firstName ? author?.firstName : ""}
${author?.lastName ? " " + author?.lastName : ""}
${!author?.firstName && !author?.lastName ? author?.name : ""}`}
</h1>

{author?.jobrole && (
Expand Down Expand Up @@ -103,29 +101,25 @@ export default function AuthorBio({ author, slug, title }) {
</a>
)}

{kofi ? (
<div className="mr-4 inline-block">
<KoFiButton
color="#53b1e6"
label={"Buy me a coffee"}
kofiId={kofi}
/>
</div>
) : (
""
)}
{kofi ? (
<div className="mr-4 inline-block">
<KoFiButton
color="#53b1e6"
label={"Buy me a coffee"}
kofiId={kofi}
/>
</div>
) : (
""
)}

{twitter && (
<a
className="link block mr-2"
href={`https://x.com/${twitter}`}
target="_blank"
>
<img
style={{ width: "28px" }}
className=" bg-white rounded-full shadow-sm hover:shadow-md"
data-src="/static/images/icons/twitter.svg"
/>
<TwitterLogo color="rgba(0,0,0,0.8)" size={24} />
</a>
)}
{dribbble && (
Expand All @@ -134,11 +128,7 @@ export default function AuthorBio({ author, slug, title }) {
href={`https://dribbble.com/${dribbble}`}
target="_blank"
>
<img
style={{ width: "28px" }}
className=" bg-white rounded-full shadow-sm hover:shadow-md"
data-src="/static/images/icons/dribbble.svg"
/>
<DribbbleLogo color="rgba(0,0,0,0.8)" size={24} />
</a>
)}
{github && (
Expand All @@ -147,11 +137,7 @@ export default function AuthorBio({ author, slug, title }) {
href={`https://github.com/${github}`}
target="_blank"
>
<img
style={{ width: "28px" }}
className=" bg-white rounded-full shadow-sm hover:shadow-md"
data-src="/static/images/icons/github.svg"
/>
<GithubLogo color="rgba(0,0,0,0.8)" size={24} />
</a>
)}
</div>
Expand Down Expand Up @@ -234,4 +220,4 @@ function getKofiHandle(string) {
result = result.replace("@", "");

return result;
}
}
2 changes: 1 addition & 1 deletion pages/post/[slug].js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export default function Post({
) : null}

{/* <Alert preview={preview} /> */}
<main className="pb-20 gap-2 col-span-12 lg:col-span-12 overflow-hidden px-0 ">
<main className="pb-20 gap-2 col-span-12 lg:col-span-12 px-0 ">
{/* {post?.id && process.env.NODE_ENV === "production" && (
<WMPostTracker postId={post?.id} post={post} />
)} */}
Expand Down

0 comments on commit f7abb73

Please sign in to comment.