HEX
Server: LiteSpeed
System: Linux eko108.isimtescil.net 4.18.0-477.21.1.lve.1.el8.x86_64 #1 SMP Tue Sep 5 23:08:35 UTC 2023 x86_64
User: uyarreklamcomtr (11202)
PHP: 7.4.33
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/uyarreklam.com.tr/httpdocs/totals-wrapper.tar
index.tsx000064400000001357151557064710006434 0ustar00/**
 * 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.scss000064400000001355151557064710006620 0ustar00.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);
		}
	}
}