Skip to content

Commit

Permalink
LOOM-1367 BpkList Class 2 Overrides (#3377)
Browse files Browse the repository at this point in the history
  • Loading branch information
jronald01 authored Apr 22, 2024
1 parent c63db77 commit d23ca8f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
"Prop {{prop}} is forbidden. See https://github.com/Skyscanner/eslint-plugin-rules?tab=readme-ov-file#forbid-component-props",
"allowedFor": [
"InnerContainer", // allowed for a prop that is passed down in the BpkMobileScrollContainer to a generated element
"ListElements", // allowed for a prop that is passed down in BpkList to the conditional list elements
"ScrimBpkModalInner", // allowed for a prop that is passed in BpkModal down to a scrim wrapped BpkModalInner component.
"Slider" // allowed for a prop that is passed in BpkSlider down to the react-slider component.
]
Expand Down
8 changes: 3 additions & 5 deletions packages/bpk-component-list/src/BpkList.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,18 @@ const BpkList = (props: Props) => {
const { ariaLabel, ariaLabelledby, children, className, ordered, title } =
props;

const TagName: any = ordered ? 'ol' : 'ul';
const ListElements: any = ordered ? 'ol' : 'ul';
const classNames: string = getClassName('bpk-list', className);

return (
<TagName
<ListElements
aria-label={ariaLabel}
aria-labelledby={ariaLabelledby}
title={title}
// TODO: className to be removed
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
className={classNames}
>
{children}
</TagName>
</ListElements>
);
};

Expand Down

0 comments on commit d23ca8f

Please sign in to comment.