Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
fix(storybook): Better handling of manual argtypes
Browse files Browse the repository at this point in the history
  • Loading branch information
bezoerb committed Feb 8, 2022
1 parent 8adb04b commit 29fe0b1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion layouts/storybook/single.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
{{- range $key, $value := .argtypes -}}
{{- $param := dict -}}
{{- with index $value "control" "type" -}}
{{- if eq (index $value "type" "name") "Boolean" -}}
{{- $typename := cond (partial "utils/reflect/is-string" .) . (index $value "type" "name") -}}
{{- if or (eq $typename "Boolean") (eq $typename "boolean") (eq $typename "bool") -}}
{{- $param = (dict "key" $key "options" (slice true false) "type" "bool") -}}
{{- else -}}
{{ with (index $value "options") }}
Expand Down Expand Up @@ -107,6 +108,10 @@
{{- $templateParams := partial "template-params" (dict "argtypes" $argtypes) }}
{{- $combinations := partial "combinations" (dict "list" $templateParams) }}

{{/* console.log({{ $argtypes | jsonify (dict "prefix" " " "indent" " ") }})
console.log({{ $templateParams | jsonify (dict "prefix" " " "indent" " ") }})
console.log({{ $combinations | jsonify (dict "prefix" " " "indent" " ") }}) */}}

export default {
title: '{{- $path -}}',
parameters: {
Expand Down

0 comments on commit 29fe0b1

Please sign in to comment.