Skip to content

Commit

Permalink
refactor: rename remaining intl props from interface (#7352)
Browse files Browse the repository at this point in the history
**Related Issue:** N/A

## Summary

Cleans up some remaining, internal `intlX` props.
  • Loading branch information
jcfranco authored and benelan committed Aug 3, 2023
1 parent 69c9831 commit 3dae8dc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,10 @@ export class ActionBar

const expandToggleNode = !expandDisabled ? (
<ExpandToggle
collapseText={messages.collapse}
el={el}
expandText={messages.expand}
expanded={expanded}
intlCollapse={messages.collapse}
intlExpand={messages.expand}
position={position}
scale={scale}
toggle={toggleExpand}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,10 @@ export class ActionPad

const expandToggleNode = !expandDisabled ? (
<ExpandToggle
collapseText={messages.collapse}
el={el}
expandText={messages.expand}
expanded={expanded}
intlCollapse={messages.collapse}
intlExpand={messages.expand}
position={position}
scale={scale}
toggle={toggleExpand}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { Position, Scale } from "../interfaces";

interface ExpandToggleProps {
expanded: boolean;
intlExpand: string;
intlCollapse: string;
expandText: string;
collapseText: string;
el: HTMLElement;
position: Position;
tooltip?: HTMLCalciteTooltipElement;
Expand Down Expand Up @@ -64,8 +64,8 @@ const setTooltipReference = ({

export const ExpandToggle: FunctionalComponent<ExpandToggleProps> = ({
expanded,
intlExpand,
intlCollapse,
expandText,
collapseText,
toggle,
el,
position,
Expand All @@ -75,7 +75,7 @@ export const ExpandToggle: FunctionalComponent<ExpandToggleProps> = ({
}) => {
const rtl = getElementDir(el) === "rtl";

const expandText = expanded ? intlCollapse : intlExpand;
const text = expanded ? collapseText : expandText;
const icons = [ICONS.chevronsLeft, ICONS.chevronsRight];

if (rtl) {
Expand All @@ -91,7 +91,7 @@ export const ExpandToggle: FunctionalComponent<ExpandToggleProps> = ({
icon={expanded ? expandIcon : collapseIcon}
onClick={toggle}
scale={scale}
text={expandText}
text={text}
textEnabled={expanded}
// eslint-disable-next-line react/jsx-sort-props
ref={(referenceElement): HTMLCalciteActionElement =>
Expand Down

0 comments on commit 3dae8dc

Please sign in to comment.