{StartIcon && (
-
+
)}
{renderButtonElement({
+ small,
content: children,
defaultIconSize,
- renderText,
+ TextContentRenderer,
})}
{withChevron && (
@@ -173,10 +176,10 @@ const renderButtonContent = ({
style={{
display: 'flex',
alignItems: 'center',
- marginLeft: styles.ICON_MARGIN_PX,
+ marginLeft: styles.iconMargin,
}}
>
-
+
)}
@@ -189,14 +192,17 @@ const renderButtonContent = ({
loadingText
? {
paddingLeft: spinnerSizeRem,
- paddingRight:
- styles.ICON_MARGIN_PX +
- 2 * (small ? styles.X_SMALL_PADDING_PX : styles.X_PADDING_PX),
+ paddingRight: `calc(${styles.iconMargin} + 2 * ${small ? styles.buttonPaddingX.small : styles.buttonPaddingX.default})`,
}
: undefined
}
>
- {renderButtonElement({content: loadingText, defaultIconSize, renderText})}
+ {renderButtonElement({
+ small,
+ content: loadingText,
+ defaultIconSize,
+ TextContentRenderer,
+ })}
{/* loading content */}
@@ -227,7 +233,12 @@ const renderButtonContent = ({
)}
{loadingText ? (