diff options
author | Sebastian <sebasjm@gmail.com> | 2022-06-08 15:18:41 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-06-08 15:19:26 -0300 |
commit | b419db505b8cd5e7aa92043696f42a0d710d9226 (patch) | |
tree | c18eb877999de68c5be6821710a1c0ba7ace4a1b /packages/anastasis-webui/src/stories.tsx | |
parent | b00635c1404ed3cc6ed36940bd54ff70cb837f0f (diff) | |
download | wallet-core-b419db505b8cd5e7aa92043696f42a0d710d9226.tar.xz |
ui testing
Diffstat (limited to 'packages/anastasis-webui/src/stories.tsx')
-rw-r--r-- | packages/anastasis-webui/src/stories.tsx | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/packages/anastasis-webui/src/stories.tsx b/packages/anastasis-webui/src/stories.tsx index a51dfb20f..351d6f37b 100644 --- a/packages/anastasis-webui/src/stories.tsx +++ b/packages/anastasis-webui/src/stories.tsx @@ -143,21 +143,24 @@ function ExampleList({ {k.examples.map((r) => { const e = encodeURIComponent; const eId = `${e(r.group)}-${e(r.component)}-${e(r.name)}`; + function doSelection(e: any): void { + e.preventDefault(); + location.hash = `#${eId}`; + onSelectStory(r, eId); + } const isSelected = selected && selected.component === r.component && selected.group === r.group && selected.name === r.name; return ( - <dd id={eId} key={r.name} data-selected={isSelected}> - <a - href={`#${eId}`} - onClick={(e) => { - e.preventDefault(); - location.hash = `#${eId}`; - onSelectStory(r, eId); - }} - > + <dd + id={eId} + key={r.name} + data-selected={isSelected} + onClick={doSelection} + > + <a href={`#${eId}`} onClick={doSelection}> {r.name} </a> </dd> |