Skip to content

Commit

Permalink
Only component props connected to data should be blue. (#5711)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkrmendy authored May 22, 2024
1 parent 95391b9 commit 37d822d
Showing 1 changed file with 6 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ export interface PropertyLabelAndPlusButtonProps {
popupIsOpen: boolean
isHovered: boolean
isConnectedToData: boolean
isValueSet: boolean
}

export function PropertyLabelAndPlusButton(
Expand All @@ -126,7 +125,6 @@ export function PropertyLabelAndPlusButton(
handleMouseEnter,
handleMouseLeave,
children,
isValueSet,
} = props

return (
Expand All @@ -140,7 +138,10 @@ export function PropertyLabelAndPlusButton(
flexDirection: 'row',
alignItems: 'center',
gap: 6,
color: popupIsOpen || isHovered || !isValueSet ? colorTheme.dynamicBlue.value : undefined,
color:
popupIsOpen || isHovered || isConnectedToData
? colorTheme.dynamicBlue.value
: undefined,
cursor: 'pointer',
}}
>
Expand All @@ -149,13 +150,13 @@ export function PropertyLabelAndPlusButton(
<div
onClick={openPopup}
style={{
opacity: isHovered || popupIsOpen || !isValueSet ? 1 : 0,
opacity: isHovered || popupIsOpen ? 1 : 0,
}}
>
<Icn
category='semantic'
type='plus-in-white-translucent-circle'
color={popupIsOpen || isHovered || !isConnectedToData ? 'dynamic' : 'main'}
color={'dynamic'}
width={12}
height={12}
/>
Expand Down Expand Up @@ -470,10 +471,6 @@ const RowForBaseControl = React.memo((props: RowForBaseControlProps) => {
)
}, [propMetadata])

const isValueSet = React.useMemo(() => {
return propMetadata.propertyStatus.set
}, [propMetadata])

const propertyLabel =
props.label == null ? (
<PropertyLabel
Expand All @@ -493,7 +490,6 @@ const RowForBaseControl = React.memo((props: RowForBaseControlProps) => {
popupIsOpen={dataPickerButtonData.popupIsOpen}
isHovered={isHovered}
isConnectedToData={isConnectedToData}
isValueSet={isValueSet}
/>
</PropertyLabel>
) : (
Expand Down Expand Up @@ -930,10 +926,6 @@ const RowForObjectControl = React.memo((props: RowForObjectControlProps) => {
)
}, [propMetadata])

const isValueSet = React.useMemo(() => {
return propMetadata.propertyStatus.set
}, [propMetadata])

return (
<div>
<div>
Expand Down Expand Up @@ -972,7 +964,6 @@ const RowForObjectControl = React.memo((props: RowForObjectControlProps) => {
popupIsOpen={dataPickerButtonData.popupIsOpen}
isHovered={isHovered}
isConnectedToData={isConnectedToData}
isValueSet={isValueSet}
>
{unless(props.disableToggling, <ObjectIndicator open={open} />)}
</PropertyLabelAndPlusButton>
Expand Down

0 comments on commit 37d822d

Please sign in to comment.