|
| 1 | +import Logo from '../../../../message/logos'; |
| 2 | +import { |
| 3 | + textWrap, |
| 4 | + messageLogoWidth, |
| 5 | + altNoWrap, |
| 6 | + setLogoTop, |
| 7 | + logo20x1, |
| 8 | + xSmallFallback |
| 9 | +} from '../../../../message/mediaQueries'; |
| 10 | +import { flexLogoMutations, textLogoMutations } from '../../../../message/logoMutations'; |
| 11 | + |
| 12 | +const flex = [ |
| 13 | + [ |
| 14 | + 'default', |
| 15 | + { |
| 16 | + logo: Logo.PP_PAYPAL.WHITE, |
| 17 | + headline: [ |
| 18 | + { |
| 19 | + tag: 'xsmall' |
| 20 | + }, |
| 21 | + { |
| 22 | + tag: 'medium' |
| 23 | + } |
| 24 | + ], |
| 25 | + disclaimer: ['default'], |
| 26 | + styles: [] |
| 27 | + } |
| 28 | + ], |
| 29 | + [ |
| 30 | + 'ratio:20x1', |
| 31 | + { |
| 32 | + styles: [logo20x1()] |
| 33 | + } |
| 34 | + ], |
| 35 | + [ |
| 36 | + 'ratio:8x1', |
| 37 | + { |
| 38 | + headline: [ |
| 39 | + { |
| 40 | + tag: 'xsmall' |
| 41 | + }, |
| 42 | + { |
| 43 | + tag: 'medium' |
| 44 | + } |
| 45 | + ] |
| 46 | + } |
| 47 | + ], |
| 48 | + ['color:white-no-border', { logo: Logo.PP_PAYPAL.COLOR }], |
| 49 | + ...flexLogoMutations |
| 50 | +]; |
| 51 | + |
| 52 | +export default { |
| 53 | + 'layout:flex': flex, |
| 54 | + 'layout:text': [ |
| 55 | + [ |
| 56 | + 'default', |
| 57 | + ({ textSize }) => ({ |
| 58 | + styles: [ |
| 59 | + `@media screen and (max-width: ${textSize * 18.5}px) { |
| 60 | + .message__headline > .tag--medium > span.br:first-child { white-space: normal; } |
| 61 | + }`, |
| 62 | + textWrap(textSize * 32, textSize, 'US'), |
| 63 | + xSmallFallback(textSize * 16), |
| 64 | + messageLogoWidth(false, textSize * 4, textSize * 1.25), |
| 65 | + setLogoTop(textSize * 16) |
| 66 | + ], |
| 67 | + logo: Logo.PP_PAYPAL.COLOR, |
| 68 | + headline: [ |
| 69 | + { |
| 70 | + tag: 'medium', |
| 71 | + br: ['mo.'] |
| 72 | + }, |
| 73 | + { |
| 74 | + tag: 'xsmall' |
| 75 | + } |
| 76 | + ], |
| 77 | + disclaimer: ['default'] |
| 78 | + }) |
| 79 | + ], |
| 80 | + [ |
| 81 | + 'logo.type:primary && logo.position:right', |
| 82 | + ({ textSize }) => ({ |
| 83 | + styles: [ |
| 84 | + `@media screen and (max-width: ${textSize * 18.5}px) { |
| 85 | + .message__headline > .tag--medium { white-space: normal; } |
| 86 | + }`, |
| 87 | + xSmallFallback(textSize * 10.75), |
| 88 | + setLogoTop(textSize * 28.75), |
| 89 | + messageLogoWidth(textSize * 6, textSize * 4, textSize * 1.25) |
| 90 | + ] |
| 91 | + }) |
| 92 | + ], |
| 93 | + [ |
| 94 | + 'logo.type:primary && logo.position:top', |
| 95 | + ({ textSize }) => ({ |
| 96 | + styles: [ |
| 97 | + `@media screen and (max-width: ${textSize * 18.5}px) { |
| 98 | + .message__headline > .tag--medium { white-space: normal; } |
| 99 | + }`, |
| 100 | + xSmallFallback(textSize * 10.75), |
| 101 | + messageLogoWidth(textSize * 6, textSize * 4, textSize * 1.25) |
| 102 | + ] |
| 103 | + }) |
| 104 | + ], |
| 105 | + [ |
| 106 | + 'logo.type:alternative', |
| 107 | + ({ textSize }) => ({ |
| 108 | + styles: [ |
| 109 | + `@media screen and (max-width: ${textSize * 10.6}px) { .message__content { white-space: nowrap; }}`, |
| 110 | + xSmallFallback(textSize * 11.5), |
| 111 | + altNoWrap(textSize * 10.6), |
| 112 | + textWrap(textSize * 32, textSize, 'US'), |
| 113 | + messageLogoWidth(textSize * 1.75, textSize * 4, textSize * 1.25) |
| 114 | + ], |
| 115 | + logo: Logo.PP_PAYPAL.COLOR[0] |
| 116 | + }) |
| 117 | + ], |
| 118 | + [ |
| 119 | + 'logo.type:none', |
| 120 | + ({ textSize }) => ({ |
| 121 | + styles: [xSmallFallback(textSize * 16)], |
| 122 | + logo: false, |
| 123 | + headline: [ |
| 124 | + { |
| 125 | + tag: 'medium', |
| 126 | + br: ['mo.', 'mo'], |
| 127 | + replace: [ |
| 128 | + ['APR.', 'APR'], |
| 129 | + ['mo.', 'mo'] |
| 130 | + ] |
| 131 | + }, |
| 132 | + { |
| 133 | + tag: 'xsmall.2', |
| 134 | + replace: [['later.', 'later']] |
| 135 | + } |
| 136 | + ] |
| 137 | + }) |
| 138 | + ], |
| 139 | + [ |
| 140 | + 'logo.type:inline', |
| 141 | + ({ textSize }) => ({ |
| 142 | + styles: [xSmallFallback(textSize * 16), `.message__logo { width: ${textSize * 4}px }`], |
| 143 | + logo: Logo.NO_PP_MONOGRAM.COLOR, |
| 144 | + headline: [ |
| 145 | + { |
| 146 | + tag: 'medium', |
| 147 | + br: ['mo.', 'mo'], |
| 148 | + replace: [ |
| 149 | + ['APR.', 'APR'], |
| 150 | + ['mo.', 'mo'] |
| 151 | + ] |
| 152 | + }, |
| 153 | + { |
| 154 | + tag: 'xsmall.2', |
| 155 | + replace: [['later.', 'later']] |
| 156 | + } |
| 157 | + ] |
| 158 | + }) |
| 159 | + ], |
| 160 | + ...textLogoMutations |
| 161 | + ] |
| 162 | +}; |
0 commit comments