From c0ca4effc417948a822a8e9cda645124152a020c Mon Sep 17 00:00:00 2001 From: Eleazar Resendez Date: Tue, 22 Oct 2024 08:59:58 -0600 Subject: [PATCH 1/3] Apply Eslint formatting --- src/components/ScreenTemplateCard.vue | 3 +- src/components/ScreenTemplates.vue | 258 +++++++++++++------------- 2 files changed, 132 insertions(+), 129 deletions(-) diff --git a/src/components/ScreenTemplateCard.vue b/src/components/ScreenTemplateCard.vue index 71291a444..9db61488d 100644 --- a/src/components/ScreenTemplateCard.vue +++ b/src/components/ScreenTemplateCard.vue @@ -112,7 +112,8 @@ export default { this.template.template_media.length > 0 ) { return this.template.template_media[0].url; - } else if (this.template?.template_media?.thumbnail?.url) { + } + if (this.template?.template_media?.thumbnail?.url) { return this.template?.template_media.thumbnail.url; } return null; diff --git a/src/components/ScreenTemplates.vue b/src/components/ScreenTemplates.vue index ab477e95a..342473c11 100644 --- a/src/components/ScreenTemplates.vue +++ b/src/components/ScreenTemplates.vue @@ -1,32 +1,29 @@ - + From 8f0f55fa2a1d35fb572b61ccdf1870ef6ed96032 Mon Sep 17 00:00:00 2001 From: Eleazar Resendez Date: Tue, 22 Oct 2024 09:12:17 -0600 Subject: [PATCH 2/3] add text truncation method for template description MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Implemented method to truncate template description to 100 characters. - Added ellipsis (…) for longer descriptions. --- src/components/ScreenTemplateCard.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/ScreenTemplateCard.vue b/src/components/ScreenTemplateCard.vue index 9db61488d..e979481ce 100644 --- a/src/components/ScreenTemplateCard.vue +++ b/src/components/ScreenTemplateCard.vue @@ -26,7 +26,7 @@
{{ template.name }} {{ - template.description + truncateText(template.description, 100) }}
@@ -157,6 +157,10 @@ export default { } else { this.selected.splice(index, 1); } + }, + truncateText(text, limit) { + if (!text) return ""; + return text.length > limit ? `${text.substring(0, limit)}...` : text; } } }; From 3ccd63e5675d99cfdbad6e48888a148b32742c7a Mon Sep 17 00:00:00 2001 From: Eleazar Resendez Date: Tue, 22 Oct 2024 09:28:41 -0600 Subject: [PATCH 3/3] fix: ensure vertical images fit within thumbnail container - Updated CSS to handle vertical images by using object-fit: cover. - Ensured all images are displayed properly in 107px height container without distortion (according to Figma mockups). --- src/components/ScreenTemplateCard.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/ScreenTemplateCard.vue b/src/components/ScreenTemplateCard.vue index e979481ce..12b9f7968 100644 --- a/src/components/ScreenTemplateCard.vue +++ b/src/components/ScreenTemplateCard.vue @@ -196,10 +196,14 @@ export default { .thumbnail-image { width: 100%; + height: 100%; + object-fit: cover; border-radius: 8px 8px 0px 0px; } .thumbnail-image-container { + width: 100%; + height: 107px; border-radius: 8px; padding: 0px !important; background-size: contain;