[react] fix: the inspect view popup when clicking on a path or point, fix missing translations in the xray path and point components (#256)
This fixes some react wiring in the inspect view. The drillProps argument contains the info function which displays the popup. Also `strings` should be passed for translation, instead of the t function. Reviewed-on: https://codeberg.org/freesewing/freesewing/pulls/256 Reviewed-by: Joost De Cock <joostdecock@noreply.codeberg.org> Co-authored-by: Jonathan Haas <haasjona@gmail.com> Co-committed-by: Jonathan Haas <haasjona@gmail.com>
This commit is contained in:
parent
bc1d873b19
commit
647205661b
5 changed files with 25 additions and 14 deletions
|
@ -3,7 +3,7 @@ import React, { forwardRef } from 'react'
|
|||
import { getId, getProps } from './utils.mjs'
|
||||
|
||||
export const PartInner = forwardRef(
|
||||
({ stackName, partName, part, settings, components, strings }, ref) => {
|
||||
({ stackName, partName, part, settings, components, strings, drillProps }, ref) => {
|
||||
const { Group, Path, Point, Snippet } = components
|
||||
|
||||
return (
|
||||
|
@ -15,7 +15,7 @@ export const PartInner = forwardRef(
|
|||
topLeft={part.topLeft}
|
||||
bottomRight={part.bottomRight}
|
||||
units={settings[0].units}
|
||||
{...{ stackName, partName, pathName, part, settings, components, strings }}
|
||||
{...{ stackName, partName, pathName, part, settings, components, strings, drillProps }}
|
||||
/>
|
||||
))}
|
||||
{Object.keys(part.points).map((pointName) => (
|
||||
|
@ -24,14 +24,23 @@ export const PartInner = forwardRef(
|
|||
point={part.points[pointName]}
|
||||
topLeft={part.topLeft}
|
||||
bottomRight={part.bottomRight}
|
||||
{...{ stackName, partName, pointName, part, settings, components, strings }}
|
||||
{...{ stackName, partName, pointName, part, settings, components, strings, drillProps }}
|
||||
/>
|
||||
))}
|
||||
{Object.keys(part.snippets).map((snippetName) => (
|
||||
<Snippet
|
||||
key={snippetName}
|
||||
snippet={part.snippets[snippetName]}
|
||||
{...{ stackName, partName, snippetName, part, settings, components, strings }}
|
||||
{...{
|
||||
stackName,
|
||||
partName,
|
||||
snippetName,
|
||||
part,
|
||||
settings,
|
||||
components,
|
||||
strings,
|
||||
drillProps,
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</Group>
|
||||
|
@ -41,12 +50,12 @@ export const PartInner = forwardRef(
|
|||
|
||||
PartInner.displayName = 'PartInner'
|
||||
|
||||
export const Part = ({ stackName, partName, part, settings, components, strings }) => {
|
||||
export const Part = ({ stackName, partName, part, settings, components, strings, drillProps }) => {
|
||||
const { Group } = components
|
||||
|
||||
return (
|
||||
<Group {...getProps(part)} id={getId({ settings, stackName, partName })}>
|
||||
<PartInner {...{ stackName, partName, part, settings, components, strings }} />
|
||||
<PartInner {...{ stackName, partName, part, settings, components, strings, drillProps }} />
|
||||
</Group>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue