Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #257 from deriv-com/prince/add-link-trustpilot
Browse files Browse the repository at this point in the history
Prince/added trustpilot link
  • Loading branch information
prince-deriv authored Dec 11, 2023
2 parents 5cf854b + a9da75a commit 5895cc8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
6 changes: 6 additions & 0 deletions libs/blocks/src/lib/social-proof/helper.ts
Original file line number Diff line number Diff line change
@@ -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',
);
6 changes: 5 additions & 1 deletion libs/blocks/src/lib/social-proof/horizontal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -23,7 +24,10 @@ const SocialProofHorizontal = ({
className,
)}
>
<div className="flex items-center justify-center gap-gap-xl">
<div
className="flex items-center justify-center gap-gap-xl"
onClick={redirectToTrustpilot}
>
{data && (
<>
{content && (
Expand Down
6 changes: 5 additions & 1 deletion libs/blocks/src/lib/social-proof/vertical/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -29,7 +30,10 @@ const SocialProofVertical = ({
className,
)}
>
<div className="flex flex-col items-center gap-gap-3xl">
<div
className="flex flex-col items-center gap-gap-3xl"
onClick={redirectToTrustpilot}
>
{title && (
<Heading.H2 className={themeClassNames.color}>{title}</Heading.H2>
)}
Expand Down

0 comments on commit 5895cc8

Please sign in to comment.