CommonLogo.stories.ts 809 B

12345678910111213141516171819202122232425262728293031
  1. // Copyright (C) 2012-2021 Zammad Foundation, https://zammad-foundation.org/
  2. import CommonLogo from '@common/components/common/CommonLogo.vue'
  3. import useApplicationConfigStore from '@common/stores/application/config'
  4. import { Story } from '@storybook/vue3'
  5. export default {
  6. title: 'Common/Logo',
  7. component: CommonLogo,
  8. }
  9. const Template: Story = (args) => ({
  10. components: { CommonLogo },
  11. setup() {
  12. const configStore = useApplicationConfigStore()
  13. if (args.isCustomLogo) {
  14. configStore.value.product_logo = 'icons/logotype.svg'
  15. } else {
  16. configStore.value.product_logo = undefined
  17. }
  18. return { args }
  19. },
  20. template: '<CommonLogo />',
  21. })
  22. export const DefaultLogo = Template.bind({})
  23. export const CustomLogo = Template.bind({})
  24. CustomLogo.args = {
  25. isCustomLogo: true,
  26. }