File: /var/www/vhosts/uyarreklam.com.tr/httpdocs/totals-wrapper.tar
index.tsx 0000644 00000001357 15155706471 0006434 0 ustar 00 /**
* External dependencies
*/
import classnames from 'classnames';
import { Children } from '@wordpress/element';
import type { ReactNode } from 'react';
/**
* Internal dependencies
*/
import './style.scss';
interface TotalsWrapperProps {
children: ReactNode;
/* If this TotalsWrapper is being used to wrap a Slot */
slotWrapper?: boolean;
className?: string;
}
const TotalsWrapper = ( {
children,
slotWrapper = false,
className,
}: TotalsWrapperProps ): JSX.Element | null => {
return Children.count( children ) ? (
<div
className={ classnames(
className,
'wc-block-components-totals-wrapper',
{
'slot-wrapper': slotWrapper,
}
) }
>
{ children }
</div>
) : null;
};
export default TotalsWrapper;
style.scss 0000644 00000001355 15155706471 0006620 0 ustar 00 .wc-block-components-totals-wrapper {
@include with-translucent-border(1px 0 0);
padding: $gap 0;
&.has-bottom-border {
&::after {
border-bottom-width: 1px;
}
}
// TotalWrappers like Discount and Fee are sometimes empty
// this prevents displaying the empty areas in Order Summary
&:empty {
padding: 0;
&::after {
content: none;
}
}
&.slot-wrapper {
padding: 0;
> * > * {
@include with-translucent-border(0 0 1px);
padding: $gap 0;
// removes the border bottom for the last slot inserted
&:last-child::after {
border-bottom-width: 0;
}
}
}
}
.wc-block-components-discounts-meta {
.wc-block-components-totals-wrapper {
&:first-child {
@include with-translucent-border(1px 0 0);
}
}
}