forked from algolia/vue-instantsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRelevantSort.stories.js
39 lines (38 loc) · 1.13 KB
/
RelevantSort.stories.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import algoliasearch from 'algoliasearch/lite';
import { storiesOf } from '@storybook/vue';
import { previewWrapper } from './utils';
storiesOf('ais-relevant-sort', module)
.addDecorator(
previewWrapper({
searchClient: algoliasearch(
'C7RIRJRYR9',
'77af6d5ffb27caa5ff4937099fcb92e8'
),
indexName: 'test_Bestbuy_vr_price_asc',
})
)
.add('default', () => ({
template: '<ais-relevant-sort></ais-relevant-sort>',
}))
.add('with custom text', () => ({
template: `
<ais-relevant-sort>
<template slot="text" slot-scope="{ isRelevantSorted }">
<template v-if="isRelevantSorted">
We removed some search results to show you the most relevant ones
</template>
<template>
Currently showing all results
</template>
</template>
<template slot="button" slot-scope="{ isRelevantSorted }">
<template v-if="isRelevantSorted">
See all results
</template>
<template>
See relevant results
</template>
</template>
</ais-relevant-sort>
`,
}));