Skip to content

Commit

Permalink
fix(space): removed excess div
Browse files Browse the repository at this point in the history
  • Loading branch information
praiz committed Dec 30, 2020
1 parent 6d387a8 commit 776e093
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 70 deletions.
22 changes: 8 additions & 14 deletions packages/space/src/Component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,15 @@ export const Space = forwardRef<HTMLDivElement, SpaceProps>((props, ref) => {
/* eslint-enable */
));

const componentClassName = classNames({
[styles.spaceFullWidth]: fullWidth,
});

return (
<div className={componentClassName}>
<div
className={containerClassName}
style={{
...(wrap && { flexWrap: 'wrap', marginBottom: -verticalSize }),
}}
ref={ref}
>
{nodes}
</div>
<div
className={containerClassName}
style={{
...(wrap && { flexWrap: 'wrap', marginBottom: -verticalSize }),
}}
ref={ref}
>
{nodes}
</div>
);
});
96 changes: 40 additions & 56 deletions packages/space/src/__snapshots__/Component.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,6 @@ Object {
"asFragment": [Function],
"baseElement": <body>
<div>
<div
class=""
>
<div
class="spaceContainer vertical start"
>
<div
class="spaceItem"
style="margin-bottom: 16px;"
>
<div
class="cardImage rounded"
style="width: 280px; height: 176.4px;"
>
<img
class="image"
height="176.4"
role="presentation"
src="https://online.alfabank.ru/cards-images/cards/EG/images?layers=BACKGROUND,CARD_NUMBER,CARD_HOLDER,PAY_PASS,CHIP,LOGO,PAYMENT_SYSTEM,RESERVED_1,RESERVED_2,VALID_DATE&width=280"
srcset="https://online.alfabank.ru/cards-images/cards/EG/images?layers=BACKGROUND,CARD_NUMBER,CARD_HOLDER,PAY_PASS,CHIP,LOGO,PAYMENT_SYSTEM,RESERVED_1,RESERVED_2,VALID_DATE&width=560 2x"
width="280"
/>
</div>
</div>
</div>
</div>
</div>
</body>,
"container": <div>
<div
class=""
>
<div
class="spaceContainer vertical start"
>
Expand All @@ -60,6 +28,30 @@ Object {
</div>
</div>
</div>
</body>,
"container": <div>
<div
class="spaceContainer vertical start"
>
<div
class="spaceItem"
style="margin-bottom: 16px;"
>
<div
class="cardImage rounded"
style="width: 280px; height: 176.4px;"
>
<img
class="image"
height="176.4"
role="presentation"
src="https://online.alfabank.ru/cards-images/cards/EG/images?layers=BACKGROUND,CARD_NUMBER,CARD_HOLDER,PAY_PASS,CHIP,LOGO,PAYMENT_SYSTEM,RESERVED_1,RESERVED_2,VALID_DATE&width=280"
srcset="https://online.alfabank.ru/cards-images/cards/EG/images?layers=BACKGROUND,CARD_NUMBER,CARD_HOLDER,PAY_PASS,CHIP,LOGO,PAYMENT_SYSTEM,RESERVED_1,RESERVED_2,VALID_DATE&width=560 2x"
width="280"
/>
</div>
</div>
</div>
</div>,
"debug": [Function],
"findAllByAltText": [Function],
Expand Down Expand Up @@ -120,30 +112,6 @@ Object {
"asFragment": [Function],
"baseElement": <body>
<div>
<div
class=""
>
<div
class="spaceContainer vertical start"
>
<div
class="spaceItem"
style="margin-bottom: 16px;"
>
0
</div>
<div
class="spaceItem"
style="margin-bottom: 16px;"
/>
</div>
</div>
</div>
</body>,
"container": <div>
<div
class=""
>
<div
class="spaceContainer vertical start"
>
Expand All @@ -159,6 +127,22 @@ Object {
/>
</div>
</div>
</body>,
"container": <div>
<div
class="spaceContainer vertical start"
>
<div
class="spaceItem"
style="margin-bottom: 16px;"
>
0
</div>
<div
class="spaceItem"
style="margin-bottom: 16px;"
/>
</div>
</div>,
"debug": [Function],
"findAllByAltText": [Function],
Expand Down

0 comments on commit 776e093

Please sign in to comment.