Skip to content

Commit

Permalink
show animation only on second render
Browse files Browse the repository at this point in the history
  • Loading branch information
vishakha94 committed Dec 19, 2019
1 parent 13c2d3f commit 4ad4c0f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/button/template/componentTemplate.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function getButtonTextAnimationStyle({ personalizedButtonText, branding, allowed
const MIN_WIDTH = 300;
const LABEL_DURATION = 1;
const PERSONALIZATION_DURATION = 5;
const DELAY = 0.5;
const DELAY = 0;

const COMPRESSED = `
max-width: 0%;
Expand Down Expand Up @@ -335,13 +335,15 @@ function renderButton({ size, label, color, locale, branding, multiple, layout,
if (allowedPersonalizationLabels.indexOf(label) !== -1) {
allowedAnimation = true;
}
if (buttonLabel === label) {

if (buttonLabel === label && label === BUTTON_LABEL.BUYNOW && !branding) {
contentText = getButtonConfig(label, 'label');
} else if (buttonLabel === label && !__WEB__) {
if (allowedPersonalizationLabels.indexOf(label) !== -1 && morsText && branding && !tagline) {
personalizedButtonText = renderPersonalizationButtonText(morsText);
impression = checkoutCustomization && checkoutCustomization.buttonText && checkoutCustomization.buttonText.tracking && checkoutCustomization.buttonText.tracking.impression;
}
contentText = getButtonConfig(label, 'label');

} else {
contentText = getButtonConfig(label, 'logoLabel');
}
Expand Down

0 comments on commit 4ad4c0f

Please sign in to comment.