Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrunyon committed Oct 16, 2024
1 parent 44eb48d commit 0b4eb5c
Showing 1 changed file with 8 additions and 27 deletions.
35 changes: 8 additions & 27 deletions plugins/ui/src/js/src/elements/UITable/UITable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,22 @@ export function UITable({
const {
margin,
marginTop,
marginLeft,
marginRight,
marginBottom,
marginStart,
marginEnd,
marginX,
marginY,
...restStyleProps
} = userStyleProps ?? {};
const { styleProps } = useStyleProps(
{
padding: margin,
paddingTop: marginTop,
paddingLeft: marginLeft,
paddingRight: marginRight,
paddingBottom: marginBottom,
paddingStart: marginStart,
paddingEnd: marginEnd,
paddingX: marginX,
paddingY: marginY,
...restStyleProps,
},
viewStyleProps // Needed so spectrum applies styles from view instead of base which doesn't have padding
Expand Down Expand Up @@ -285,29 +289,6 @@ export function UITable({
// We want to clean up the model when we unmount or get a new model
useEffect(() => () => model?.close(), [model]);

// const {
// margin,
// marginTop,
// marginLeft,
// marginRight,
// marginBottom,
// ...remainingStyle
// } = styleProps.style ?? {};
// const style = {
// ...remainingStyle,
// };

// if (margin !== undefined) {
// style.padding = margin;
// } else {
// style.marginTop = marginTop;
// style.marginLeft = marginLeft;
// style.marginRight = marginRight;
// style.marginBottom = marginBottom;
// }

// console.log(style);

return model ? (
<div
// eslint-disable-next-line react/jsx-props-no-spreading
Expand Down

0 comments on commit 0b4eb5c

Please sign in to comment.