diff --git a/src/components/AdvertiserName/AdvertiserName.tsx b/src/components/AdvertiserName/AdvertiserName.tsx index 33998aa3..2a67923f 100644 --- a/src/components/AdvertiserName/AdvertiserName.tsx +++ b/src/components/AdvertiserName/AdvertiserName.tsx @@ -16,14 +16,14 @@ type TAdvertiserNameProps = { const AdvertiserName = ({ advertiserStats, onClickBlocked }: TAdvertiserNameProps) => { const { data } = useGetSettings(); - const { isDesktop } = useDevice(); + const { isMobile } = useDevice(); const isMyProfile = getCurrentRoute() === 'my-profile'; const name = advertiserStats?.name || data?.email; return (
- +
@@ -38,8 +38,8 @@ const AdvertiserName = ({ advertiserStats, onClickBlocked }: TAdvertiserNameProp
- {isDesktop && isMyProfile && } - {isDesktop && !isMyProfile && !advertiserStats?.is_blocked && ( + {!isMobile && isMyProfile && } + {!isMobile && !isMyProfile && !advertiserStats?.is_blocked && ( )}
diff --git a/src/components/AdvertiserName/__tests__/AdvertiserName.spec.tsx b/src/components/AdvertiserName/__tests__/AdvertiserName.spec.tsx index 04aced61..1dd1fadc 100644 --- a/src/components/AdvertiserName/__tests__/AdvertiserName.spec.tsx +++ b/src/components/AdvertiserName/__tests__/AdvertiserName.spec.tsx @@ -10,12 +10,18 @@ const mockProps = { }; jest.mock('@deriv-com/api-hooks', () => ({ + ...jest.requireActual('@deriv-com/api-hooks'), useGetSettings: jest.fn(() => ({ email: 'test@gmail.com' })), })); jest.mock('@deriv-com/ui', () => ({ ...jest.requireActual('@deriv-com/ui'), - useDevice: jest.fn(() => ({ isMobile: false })), + useDevice: jest.fn(() => ({ isMobile: true })), +})); + +jest.mock('@/utils', () => ({ + ...jest.requireActual('@/utils'), + getCurrentRoute: jest.fn(() => ''), })); describe('AdvertiserName', () => {