Skip to content

Commit

Permalink
Stop compound prop label being shifted when it's too long
Browse files Browse the repository at this point in the history
Fixed it by removing the fixed width.
This is unnecessary since there's no value on the ribght to accommodate.
  • Loading branch information
AndrewPrifer committed Jan 22, 2023
1 parent 41fb7de commit 2efd9e9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion theatre/core/src/propTypes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,6 @@ const defaultNumberNudgeFn: NumberNudgeFn = ({
magnitude,
}) => {
const {range} = config
console.log(deltaX, deltaFraction, config)

if (
!config.nudgeMultiplier &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ const Padding = styled.div`
padding-left: ${rowIndentationFormulaCSS};
display: flex;
align-items: center;
width: calc(100% - var(--right-width));
`

const PropName = deriver(styled.div<{isHighlighted: PropHighlighted}>`
Expand Down Expand Up @@ -179,13 +178,11 @@ function DetailCompoundPropEditor<
if (!collapsedMap.has(globalPointerPath)) {
collapsedMap.set(globalPointerPath, new Atom(isVectorProp(propConfig)))
}
}, [])
}, [globalPointerPath, propConfig])

const box = collapsedMap.get(globalPointerPath)

const isCollapsed = usePrism(() => {
const box = collapsedMap.get(globalPointerPath)

return box ? val(box.pointer) : isVectorProp(propConfig)
}, [box])

Expand Down

0 comments on commit 2efd9e9

Please sign in to comment.