Skip to content

Commit

Permalink
fix: pr comments addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuzhy-Deriv committed Nov 27, 2024
1 parent 60a0564 commit 69df0f8
Show file tree
Hide file tree
Showing 16 changed files with 19 additions and 20 deletions.
8 changes: 3 additions & 5 deletions src/components/AppFooter/Livechat.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { useGrowthbookGetFeatureValue, useLiveChat } from '@/hooks/custom-hooks';
import useFreshChat from '@/hooks/custom-hooks/useFreshchat';
import useIntercom from '@/hooks/custom-hooks/useIntercom';
import Chat from '@/utils/chat';
import { useFreshchat, useGrowthbookGetFeatureValue, useIntercom, useLiveChat } from '@/hooks/custom-hooks';
import { Chat } from '@/utils';
import { LegacyLiveChatOutlineIcon } from '@deriv/quill-icons';
import { useTranslations } from '@deriv-com/translations';
import { Tooltip } from '@deriv-com/ui';
Expand All @@ -17,7 +15,7 @@ const Livechat = () => {
});

const token = localStorage.getItem('authToken') || null;
const freshChat = useFreshChat(token, isFreshChatEnabled);
const freshChat = useFreshchat(token, isFreshChatEnabled);
const icChat = useIntercom(token, isIntercomEnabled);

setInterval(() => {
Expand Down
3 changes: 1 addition & 2 deletions src/components/AppHeader/AppHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { useEffect } from 'react';
import { getOauthUrl } from '@/constants';
import { api, useGrowthbookGetFeatureValue, useOAuth } from '@/hooks';
import { getCurrentRoute } from '@/utils';
import Chat from '@/utils/chat';
import { Chat, getCurrentRoute } from '@/utils';
import { StandaloneCircleUserRegularIcon } from '@deriv/quill-icons';
import { useAuthData } from '@deriv-com/api-hooks';
import { useTranslations } from '@deriv-com/translations';
Expand Down
2 changes: 1 addition & 1 deletion src/components/AppHeader/MobileMenu/MobileMenuConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ACCOUNT_LIMITS, HELP_CENTRE, RESPONSIBLE } from '@/constants';
import { useGrowthbookGetFeatureValue, useOAuth } from '@/hooks/custom-hooks';
import useFreshChat from '@/hooks/custom-hooks/useFreshchat';
import useIntercom from '@/hooks/custom-hooks/useIntercom';
import Chat from '@/utils/chat';
import { Chat } from '@/utils';
import {
BrandDerivLogoCoralIcon,
IconTypes,
Expand Down
2 changes: 1 addition & 1 deletion src/components/BlockedScenarios/BlockedScenarios.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Chat from '@/utils/chat';
import { Chat } from '@/utils';
import {
DerivLightIcCashierBlockedIcon,
DerivLightIcCashierUnderMaintenanceIcon,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ReactNode } from 'react';
import { ADVERT_TYPE, ERROR_CODES } from '@/constants';
import { AdRateError } from '@/pages/my-ads/components';
import Chat from '@/utils/chat';
import { Chat } from '@/utils';
import { Localize } from '@deriv-com/translations';
import { Button, Modal, Text, useDevice } from '@deriv-com/ui';
import './AdErrorTooltipModal.scss';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ComponentProps } from 'react';
import { TCurrency } from 'types';
import { ERROR_CODES } from '@/constants';
import Chat from '@/utils/chat';
import { Chat } from '@/utils';
import { Localize, useTranslations } from '@deriv-com/translations';
import { Button, Modal, Text, useDevice } from '@deriv-com/ui';
import './AdVisibilityErrorModal.scss';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TCurrency } from 'types';
import Chat from '@/utils/chat';
import { Chat } from '@/utils';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import AdVisibilityErrorModal from '../AdVisibilityErrorModal';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useEffect, useState } from 'react';
import { THooks } from 'types';
import { FullPageMobileWrapper } from '@/components/FullPageMobileWrapper';
import { api } from '@/hooks';
import Chat from '@/utils/chat';
import { Chat } from '@/utils';
import { Localize } from '@deriv-com/translations';
import { Button, Modal, Text, useDevice } from '@deriv-com/ui';
import { OrderDetailsComplainModalRadioGroup } from './OrderDetailsComplainModalRadioGroup';
Expand Down
2 changes: 2 additions & 0 deletions src/hooks/custom-hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ export { default as useDotButton } from './useDotButton';
export { default as useExtendedOrderDetails } from './useExtendedOrderDetails';
export { default as useFetchMore } from './useFetchMore';
export { default as useFloatingRate } from './useFloatingRate';
export { default as useFreshchat } from './useFreshchat';
export { default as useFullScreen } from './useFullScreen';
export { default as useGetBusinessHours } from './useGetBusinessHours.tsx';
export { default as useGrowthbookGetFeatureValue } from './useGrowthbookGetFeatureValue';
export { default as useHandleRouteChange } from './useHandleRouteChange';
export { default as useIntercom } from './useIntercom';
export { default as useIsAdvertiser } from './useIsAdvertiser';
export { default as useIsAdvertiserBarred } from './useIsAdvertiserBarred';
export { default as useIsP2PBlocked } from './useIsP2PBlocked';
Expand Down
1 change: 1 addition & 0 deletions src/hooks/custom-hooks/useFreshchat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ const useFreshChat = (token: string | null, flag: boolean) => {

return { isReady };
};

export default useFreshChat;
2 changes: 1 addition & 1 deletion src/pages/guide/screens/Awareness/Awareness.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Chat from '@/utils/chat';
import { Chat } from '@/utils';
import { DerivDarkScamAdvancePaymentIcon, DerivDarkScamPotIcon, DerivDarkScamSmsIcon } from '@deriv/quill-icons';
import { Localize } from '@deriv-com/translations';
import { Text, useDevice } from '@deriv-com/ui';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/guide/screens/FAQs/FAQs.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useRef } from 'react';
import Chat from '@/utils/chat';
import { Chat } from '@/utils';
import { Localize, useTranslations } from '@deriv-com/translations';
import { Accordion, Text, useDevice } from '@deriv-com/ui';
import { URLConstants } from '@deriv-com/utils';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/guide/screens/GettingStarted/GettingStarted.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Chat from '@/utils/chat';
import { Chat } from '@/utils/chat';
import {
DerivDarkFindAdIcon,
DerivDarkPayUserIcon,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/__tests__/chat.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Chat from '../chat';
import { Chat } from '../chat';
import getFeatureFlag from '../get-featureflag';

jest.mock('../get-featureflag');
Expand Down
4 changes: 1 addition & 3 deletions src/utils/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import getFeatureFlag from './get-featureflag';

const Chat = {
export const Chat = {
clear: async () => {
const { isFreshChat, isIntercom } = await Chat.getFlags();
if (isFreshChat) {
Expand Down Expand Up @@ -36,5 +36,3 @@ const Chat = {
}
},
};

export default Chat;
1 change: 1 addition & 0 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export * from './account';
export * from './ad-utils';
export * from './adverts';
export * from './business-hours';
export * from './chat';
export * from './date';
export * from './error-messages';
export * from './file-dropzone';
Expand Down

0 comments on commit 69df0f8

Please sign in to comment.