Render floating comment button only if a provider is specified

This commit is contained in:
Cory Dransfeldt 2022-03-27 11:36:27 -07:00
parent 2828acb108
commit 484296ae13

View File

@ -1,3 +1,4 @@
import siteMetadata from '@/data/siteMetadata'
import { useEffect, useState } from 'react' import { useEffect, useState } from 'react'
import smoothscroll from 'smoothscroll-polyfill' import smoothscroll from 'smoothscroll-polyfill'
@ -25,6 +26,7 @@ const ScrollTopAndComment = () => {
<div <div
className={`fixed right-8 bottom-8 hidden flex-col gap-3 ${show ? 'md:flex' : 'md:hidden'}`} className={`fixed right-8 bottom-8 hidden flex-col gap-3 ${show ? 'md:flex' : 'md:hidden'}`}
> >
{siteMetadata.comment.provider && (
<button <button
aria-label="Scroll To Comment" aria-label="Scroll To Comment"
type="button" type="button"
@ -39,6 +41,7 @@ const ScrollTopAndComment = () => {
/> />
</svg> </svg>
</button> </button>
)}
<button <button
aria-label="Scroll To Top" aria-label="Scroll To Top"
type="button" type="button"