Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Fix VErrorSection stories (#1224)
Browse files Browse the repository at this point in the history
  • Loading branch information
obulat authored Apr 3, 2022
1 parent 360a6e1 commit f81bc55
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/components/VErrorSection/meta/VErrorSection.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,22 @@ import { NO_RESULT, SERVER_TIMEOUT } from '~/constants/errors'

This section appears when a search returns no hits.

export const NoResultsTemplate = (args, { argTypes }) => ({
export const NoResultsTemplate = (args) => ({
template: `
<VErrorSection>
<template #image>
<VErrorImage :error-code="errorCode" />
<VErrorImage :error-code="args.errorCode" />
</template>
<VNoResults :type="type" :query="query"/>
<VNoResults :type="args.type" :query="args.query"/>
</VErrorSection>
`,
data: () => ({
NO_RESULT,
}),
components: { VErrorSection, VErrorImage, VNoResults },
props: Object.keys(argTypes),
setup() {
return { args }
},
})

<Canvas>
Expand All @@ -64,21 +66,23 @@ export const NoResultsTemplate = (args, { argTypes }) => ({

This result appears when an API request times out.

export const ServerTimeoutTemplate = (args, { argTypes }) => ({
export const ServerTimeoutTemplate = (args) => ({
template: `
<VErrorSection>
<template #image>
<!-- On large screens, image is in the left pane. -->
<VErrorImage class="hidden md:block" :error-code="errorCode" />
<VErrorImage class="hidden md:block" :error-code="args.errorCode" />
</template>
<VServerTimeout/>
<!-- On small screens, image is below error message. -->
<VErrorImage class="md:hidden mt-10" :error-code="errorCode" />
<VErrorImage class="md:hidden mt-10" :error-code="args.errorCode" />
</VErrorSection>
`,
data: () => ({ SERVER_TIMEOUT }),
components: { VErrorSection, VErrorImage, VServerTimeout },
props: Object.keys(argTypes),
setup() {
return { args }
},
})

<Canvas>
Expand Down

0 comments on commit f81bc55

Please sign in to comment.