feat(web/radial): newlines support (#316)

* feat(radial): Support newlines

* chore: update to `  \n` to match markdown
This commit is contained in:
Jag
2023-05-01 02:07:17 -07:00
committed by GitHub
parent 60ef88c08f
commit bda2c2657a
2 changed files with 6 additions and 3 deletions

View File

@@ -155,8 +155,11 @@ const RadialMenu: React.FC = () => {
height={25}
fixedWidth
/>
<text x={iconX} y={iconY + 25} fill="#fff" textAnchor="middle" pointerEvents="none">
{item.label}
<text x={iconX} y={iconY + (item.label.includes(" \n") ? 7 : 25)} fill="#fff" textAnchor="middle" pointerEvents="none">
{item.label.includes(" \n")
? item.label.split(" \n").map((value) => <tspan x={iconX} dy="1.2em">{value}</tspan>)
: item.label
}
</text>
</g>
</g>