Skip to content

Commit

Permalink
feature: add brands and change query preview data source (#281)
Browse files Browse the repository at this point in the history
Co-authored-by: Beltrán Garcia Balbuena <beltranbalbuena@gmail.com>
  • Loading branch information
herrardo and tiborux authored May 4, 2023
1 parent 289d31d commit fecd415
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
12 changes: 6 additions & 6 deletions public/snippet-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,16 @@ window.initX = {
...URLParameters,
queriesPreview: [
{
query: 'backpack',
title: 'Back to School!'
query: 'sunglasses',
title: 'Sunshine ready'
},
{
query: 'watch',
title: 'Get on time!'
query: 'marni summer dress',
title: 'Summer dresses by Marni'
},
{
query: 'women boots',
title: 'Get comfy!'
query: 'woven hat',
title: 'Elegant Sunshield'
}
]
};
3 changes: 3 additions & 0 deletions src/adapter/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,21 @@ export const adapter = platformAdapter;
interface EmpathyDemoPlatformResult extends PlatformResult {
description: string;
collection: string;
brand: string;
}

declare module '@empathyco/x-types' {
export interface Result {
collection: string;
description: string;
brand: string;
}
}

resultSchema.$override<EmpathyDemoPlatformResult, Partial<Result>>({
description: 'description',
collection: 'collection',
brand: 'brand',
images: ({ __images }) => (Array.isArray(__images) ? __images.reverse() : [__images])
});

Expand Down
5 changes: 4 additions & 1 deletion src/components/results/result.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
<h2 class="x-title4 x-truncate x-uppercase" data-test="result-title">
{{ result.description }}
</h2>
<span v-if="showDescription" class="x-text2">{{ result.collection }}</span>
<template v-if="showDescription">
<span class="x-text2">{{ result.collection }}</span>
<span class="x-text2 x-text-lead-50">{{ result.brand }}</span>
</template>
<div class="x-flex x-flex-wrap x-gap-8">
<BaseResultCurrentPrice :result="result" class="x-text2 x-text2-lg x-font-bold" />
<BaseResultPreviousPrice
Expand Down

0 comments on commit fecd415

Please sign in to comment.