CommonLogo.stories.ts 824 B

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