@times-components/ts-components 1.126.0 → 1.128.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/dist/components/cta-button/CtaButton.d.ts +1 -0
- package/dist/components/cta-button/CtaButton.js +8 -4
- package/dist/components/quizle-sidebar/styles.js +1 -1
- package/package.json +14 -14
- package/rnw.js +1 -1
- package/src/components/cta-button/CtaButton.tsx +10 -3
- package/src/components/quizle-sidebar/__tests__/__snapshots__/index.test.tsx.snap +1 -1
- package/src/components/quizle-sidebar/styles.ts +1 -1
|
@@ -6,15 +6,14 @@ interface AttributesProps {
|
|
|
6
6
|
url: string;
|
|
7
7
|
target?: string;
|
|
8
8
|
text: string;
|
|
9
|
+
className?: string;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
interface RootProps {
|
|
12
13
|
attributes?: AttributesProps;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
export const CtaButton: React.FC<RootProps> =
|
|
16
|
-
const attributes = props.attributes;
|
|
17
|
-
|
|
16
|
+
export const CtaButton: React.FC<RootProps> = ({ attributes }) => {
|
|
18
17
|
if (!attributes || !attributes.text.trim() || !attributes.url.trim()) {
|
|
19
18
|
return null;
|
|
20
19
|
}
|
|
@@ -23,6 +22,7 @@ export const CtaButton: React.FC<RootProps> = props => {
|
|
|
23
22
|
<Link
|
|
24
23
|
href={attributes.url}
|
|
25
24
|
target={attributes.target || '_blank'}
|
|
25
|
+
className={attributes.className}
|
|
26
26
|
onClick={() =>
|
|
27
27
|
tealiumTrackingHandler(
|
|
28
28
|
'affiliate cta clicked',
|
|
@@ -33,6 +33,13 @@ export const CtaButton: React.FC<RootProps> = props => {
|
|
|
33
33
|
)
|
|
34
34
|
}
|
|
35
35
|
rel="nofollow"
|
|
36
|
+
style={{
|
|
37
|
+
display:
|
|
38
|
+
attributes.className &&
|
|
39
|
+
attributes.className.includes('js-cta-experiment-variation')
|
|
40
|
+
? 'none'
|
|
41
|
+
: 'block'
|
|
42
|
+
}}
|
|
36
43
|
>
|
|
37
44
|
{attributes.text}
|
|
38
45
|
</Link>
|