From 2faae587f20e5e2d1d91b6dc0a9ccd360b949f45 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Wed, 27 Apr 2022 13:10:04 -0500 Subject: [PATCH] Add ListingDetails helper class --- helpers/listing-page.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 helpers/listing-page.js diff --git a/helpers/listing-page.js b/helpers/listing-page.js new file mode 100644 index 0000000..3f034e9 --- /dev/null +++ b/helpers/listing-page.js @@ -0,0 +1,32 @@ + + +import { + getAppType +} from './app-derived.js' + + +export class ListingDetails { + constructor ( listing ) { + this.listing = listing + + this.type = getAppType( listing ) + } + + type = '' + + get mainHeading () { + if ( this.type === 'formula' ) { + return `Does ${ this.listing.name } work on Apple Silicon when installed via Homebrew?` + } + + return `Does ${ this.listing.name } work on Apple Silicon?` + } + + get subtitle () { + return this.listing.text + } + + buildListingDetails ( listing ) { + + } +}