Add game report url for games

This commit is contained in:
Sam Carlton 2022-06-10 17:07:58 -05:00
parent 13e36c3bc8
commit a70cc0279d

View file

@ -1,12 +1,20 @@
---
import { ensureListingDetails } from '~/helpers/listing-page.js'
import { makeLastUpdatedFriendly } from '~/helpers/parse-date.js'
const {
listing
listing
} = Astro.props
const details = ensureListingDetails( listing )
const lastUpdatedFriendly = makeLastUpdatedFriendly( listing.lastUpdated )
const gameReportUrl = 'https://forms.gle/29GWt85i1G1L7Ttj8'
const defaultReportUrl = `https://github.com/ThatGuySam/doesitarm/issues?q=is%3Aissue+${ listing.name }`
const reportUrl = details.isGame ? gameReportUrl : defaultReportUrl
---
<div class="report-update text-xs text-center w-full shadow-none py-24">
{ lastUpdatedFriendly !== null &&
@ -20,7 +28,7 @@ const lastUpdatedFriendly = makeLastUpdatedFriendly( listing.lastUpdated )
}
<!-- https://eric.blog/2016/01/08/prefilling-github-issues/ -->
<a
href={ `https://github.com/ThatGuySam/doesitarm/issues?q=is%3Aissue+${ listing.name }` }
href={ reportUrl }
target="_blank"
class="underline"
rel="noopener"