diff --git a/libs/blocks/src/lib/social-proof/helper.ts b/libs/blocks/src/lib/social-proof/helper.ts new file mode 100644 index 000000000..96855b9b0 --- /dev/null +++ b/libs/blocks/src/lib/social-proof/helper.ts @@ -0,0 +1,6 @@ +export const redirectToTrustpilot = () => + window !== undefined && + window.open( + 'https://www.trustpilot.com/review/deriv.com?utm_medium=trustbox&utm_source=Mini', + '_blank', + ); diff --git a/libs/blocks/src/lib/social-proof/horizontal/index.tsx b/libs/blocks/src/lib/social-proof/horizontal/index.tsx index 044780ccf..469afd650 100644 --- a/libs/blocks/src/lib/social-proof/horizontal/index.tsx +++ b/libs/blocks/src/lib/social-proof/horizontal/index.tsx @@ -3,6 +3,7 @@ import { Rating } from '@deriv-com/components'; import { useTrustpilotApi } from '@deriv-com/hooks'; import { SocialProofProps } from '../types'; import { getThemeClassNames } from '../classnames'; +import { redirectToTrustpilot } from '../helper'; const SocialProofHorizontal = ({ theme, @@ -23,7 +24,10 @@ const SocialProofHorizontal = ({ className, )} > -
+
{data && ( <> {content && ( diff --git a/libs/blocks/src/lib/social-proof/vertical/index.tsx b/libs/blocks/src/lib/social-proof/vertical/index.tsx index 9612fbef0..7c63dde52 100644 --- a/libs/blocks/src/lib/social-proof/vertical/index.tsx +++ b/libs/blocks/src/lib/social-proof/vertical/index.tsx @@ -4,6 +4,7 @@ import { useTrustpilotApi } from '@deriv-com/hooks'; import { SocialProofProps } from '../types'; import { getThemeClassNames } from '../classnames'; +import { redirectToTrustpilot } from '../helper'; export interface SocialProofVerticalProps extends SocialProofProps { title?: string; @@ -29,7 +30,10 @@ const SocialProofVertical = ({ className, )} > -
+
{title && ( {title} )}