mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Enable fallback source url
This commit is contained in:
parent
bb29e97f06
commit
55543dd7b1
1 changed files with 37 additions and 25 deletions
|
|
@ -12,6 +12,18 @@ const details = ensureListingDetails(listing)
|
|||
|
||||
const hasReports = Array.isArray( details.api.reports ) && details.api.reports.length > 0
|
||||
|
||||
const defaultSourceUrl = 'https://applesilicongames.com/'
|
||||
|
||||
function getSourceUrl ( report ) {
|
||||
// Try to get the source url from the report first
|
||||
if ( report['Source'].includes('https://') ) {
|
||||
return report['Source']
|
||||
}
|
||||
|
||||
// Otherwise, fall back to the default source url
|
||||
return defaultSourceUrl
|
||||
}
|
||||
|
||||
---
|
||||
{ hasReports && (
|
||||
|
||||
|
|
@ -38,37 +50,37 @@ const hasReports = Array.isArray( details.api.reports ) && details.api.reports.l
|
|||
>
|
||||
🖥 { report['Resolution'] }
|
||||
</p>
|
||||
report['Settings'].length !== 0
|
||||
<p class="mt-1 text-sm leading-5">
|
||||
⚙️ { report['Settings'] }
|
||||
</p>
|
||||
{ report['Settings'].length !== 0 && (
|
||||
<p class="mt-1 text-sm leading-5">
|
||||
⚙️ { report['Settings'] }
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{ report['Source'].includes('https://') && (
|
||||
<div class="border-t border-gray-200">
|
||||
<div class="-mt-px flex">
|
||||
<div class="w-0 flex-1 flex border-r border-gray-200">
|
||||
<a
|
||||
href={ report['Source'] }
|
||||
class="relative -mr-px w-0 flex-1 inline-flex items-center justify-center py-4 text-sm leading-5 font-bold border border-transparent rounded-bl-lg hover:text-gray-500 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 transition ease-in-out duration-150"
|
||||
|
||||
<div class="border-t border-gray-200">
|
||||
<div class="-mt-px flex">
|
||||
<div class="w-0 flex-1 flex border-r border-gray-200">
|
||||
<a
|
||||
href={ getSourceUrl( report ) }
|
||||
class="relative -mr-px w-0 flex-1 inline-flex items-center justify-center py-4 text-sm leading-5 font-bold border border-transparent rounded-bl-lg hover:text-gray-500 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 transition ease-in-out duration-150"
|
||||
>
|
||||
<!-- Heroicon name: mail -->
|
||||
<svg
|
||||
class="w-5 h-5"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20"
|
||||
fill="currentColor"
|
||||
>
|
||||
<!-- Heroicon name: mail -->
|
||||
<svg
|
||||
class="w-5 h-5"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20"
|
||||
fill="currentColor"
|
||||
>
|
||||
<path d="M2.003 5.884L10 9.882l7.997-3.998A2 2 0 0016 4H4a2 2 0 00-1.997 1.884z" />
|
||||
<path d="M18 8.118l-8 4-8-4V14a2 2 0 002 2h12a2 2 0 002-2V8.118z" />
|
||||
</svg>
|
||||
<span class="ml-3 opacity-75">Source</span>
|
||||
</a>
|
||||
</div>
|
||||
<path d="M2.003 5.884L10 9.882l7.997-3.998A2 2 0 0016 4H4a2 2 0 00-1.997 1.884z" />
|
||||
<path d="M18 8.118l-8 4-8-4V14a2 2 0 002 2h12a2 2 0 002-2V8.118z" />
|
||||
</svg>
|
||||
<span class="ml-3 opacity-75">Source</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue