Skip to content

Commit

Permalink
inmprove a bit design and usablility
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Werner committed Nov 6, 2023
1 parent c3c2094 commit 0caa58a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions web/src/ui/Puzzle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ const MutableTriangle = ({

const isLeafNode =
data && !Object.values(data).some((value) => typeof value === 'object')
const title = postProcessTitle(data['.'])?.slice(0, 100)
const { shortTitle, fontSize } = calculateFontSize(size, title, 2)
const title = postProcessTitle(data['.'])
const { shortTitle, fontSize } = calculateFontSize(size, title?.slice(0,100), 2)

return (
<div
Expand Down Expand Up @@ -140,12 +140,13 @@ const MutableTriangle = ({
width: size,
transform: 'translateX(-25%)',
}}
title={title} // Full title as a tooltip

>
<div style={{ zIndex: level + 1000 * nest, position: 'relative' }}>
{_key}{' '}
</div>
{shortTitle}
</div>
<span title={title}>{shortTitle}</span> </div>
</div>
{!isLeafNode && data && (
<div
Expand Down

0 comments on commit 0caa58a

Please sign in to comment.