Skip to content

Commit

Permalink
Remove unused hasIndicator prop (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano authored Oct 20, 2024
1 parent 53cce8a commit 75d037e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 18 deletions.
6 changes: 2 additions & 4 deletions src/controls/border-color-control.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ type Props = {
bottom?: Property.BorderBottomColor;
left?: Property.BorderLeftColor;
};
hasIndicator?: boolean;
};

const DEFAULT_VALUES = {
Expand All @@ -53,7 +52,6 @@ export default function BorderColorControl( {
help,
onChange,
values: valuesProp,
hasIndicator = true,
}: Props ) {
const values = {
...DEFAULT_VALUES,
Expand Down Expand Up @@ -132,7 +130,7 @@ export default function BorderColorControl( {
<div className="ftb-border-color-control__controls-inner">
{ isLinked && (
<div className="ftb-border-color-control__controls-row">
{ hasIndicator && <SideIndicatorControl /> }
<SideIndicatorControl />
<ColorIndicatorButton
label={ __( 'All', 'flexible-table-block' ) }
value={ allInputValue }
Expand All @@ -158,7 +156,7 @@ export default function BorderColorControl( {
{ ! isLinked &&
SIDE_CONTROLS.map( ( item, index ) => (
<div className="ftb-border-color-control__controls-row" key={ index }>
{ hasIndicator && <SideIndicatorControl sides={ [ item.value ] } /> }
<SideIndicatorControl sides={ [ item.value ] } />
<ColorIndicatorButton
label={ item.label }
value={ values[ item.value ] }
Expand Down
6 changes: 1 addition & 5 deletions src/controls/border-radius-control.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ type Props = {
bottomRight?: Property.BorderBottomRightRadius;
bottomLeft?: Property.BorderBottomLeftRadius;
};
hasIndicator?: boolean;
};

type ValuesKey = keyof typeof DEFAULT_VALUES;
Expand All @@ -54,7 +53,6 @@ export default function BorderRadiusControl( {
help,
onChange,
values: valuesProp,
hasIndicator = true,
}: Props ) {
const values = {
...DEFAULT_VALUES,
Expand Down Expand Up @@ -146,9 +144,7 @@ export default function BorderRadiusControl( {
</Button>
</div>
<div className="ftb-border-radius-control__header-control">
{ hasIndicator && (
<CornerIndicatorControl corners={ corner === undefined ? undefined : [ corner ] } />
) }
<CornerIndicatorControl corners={ corner === undefined ? undefined : [ corner ] } />
{ isLinked && (
<UnitControl
hideLabelFromVision
Expand Down
6 changes: 2 additions & 4 deletions src/controls/border-spacing-control.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ type Props = {
help?: string;
onChange: ( event: any ) => void;
values: typeof DEFAULT_VALUES;
hasIndicator?: boolean;
};

type ValuesKey = keyof typeof DEFAULT_VALUES;
Expand All @@ -42,7 +41,6 @@ export default function BorderSpacingControl( {
help,
onChange,
values: valuesProp,
hasIndicator = true,
}: Props ) {
const values = {
...DEFAULT_VALUES,
Expand Down Expand Up @@ -124,7 +122,7 @@ export default function BorderSpacingControl( {
<div className="ftb-border-spacing-control__controls-inner">
{ isLinked && (
<div className="ftb-border-spacing-control__controls-row">
{ hasIndicator && <DirectionIndicatorControl /> }
<DirectionIndicatorControl />
<UnitControl
aria-label={ __( 'All', 'flexible-table-block' ) }
value={ allInputValue }
Expand All @@ -138,7 +136,7 @@ export default function BorderSpacingControl( {
{ ! isLinked &&
DIRECTION_CONTROLS.map( ( item, index ) => (
<div className="ftb-border-spacing-control__controls-row" key={ index }>
{ hasIndicator && <DirectionIndicatorControl directions={ [ item.value ] } /> }
<DirectionIndicatorControl directions={ [ item.value ] } />
<UnitControl
key={ item.value }
aria-label={ item.label }
Expand Down
6 changes: 1 addition & 5 deletions src/controls/padding-control.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ type Props = {
bottom?: Property.PaddingBottom;
left?: Property.PaddingLeft;
};
hasIndicator?: boolean;
};

type ValuesKey = keyof typeof DEFAULT_VALUES;
Expand All @@ -53,7 +52,6 @@ export default function PaddingControl( {
help,
onChange,
values: valuesProp,
hasIndicator = true,
}: Props ) {
const values = { ...DEFAULT_VALUES, ...valuesProp };
const instanceId = useInstanceId( PaddingControl, 'ftb-padding-control' );
Expand Down Expand Up @@ -117,9 +115,7 @@ export default function PaddingControl( {
</Button>
</div>
<div className="ftb-padding-control__header-control">
{ hasIndicator && (
<SideIndicatorControl sides={ side === undefined ? undefined : [ side ] } />
) }
<SideIndicatorControl sides={ side === undefined ? undefined : [ side ] } />
{ isLinked && (
<UnitControl
placeholder={ allInputPlaceholder }
Expand Down

0 comments on commit 75d037e

Please sign in to comment.