Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: chat not visible, not loading #223

Merged
merged 7 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@deriv-com/translations": "^1.2.4",
"@deriv-com/ui": "^1.29.0",
"@deriv-com/utils": "^0.0.28",
"@deriv/quill-icons": "^1.23.5",
"@deriv/quill-icons": "^1.23.8",
"@sendbird/chat": "^4.11.3",
"@tanstack/react-query": "^5.28.14",
"@tanstack/react-table": "^8.15.0",
Expand Down
Binary file removed src/assets/404.png
Binary file not shown.
2 changes: 0 additions & 2 deletions src/assets/blog.svg

This file was deleted.

9 changes: 0 additions & 9 deletions src/assets/introducing-deriv-p2p.svg

This file was deleted.

11 changes: 0 additions & 11 deletions src/assets/p2p-unavailable.svg

This file was deleted.

9 changes: 0 additions & 9 deletions src/assets/use-deriv-p2p.svg

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/BlockedScenarios/BlockedScenarios.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ReactComponent as P2pUnavailable } from '@/assets/p2p-unavailable.svg';
import { useLiveChat } from '@/hooks';
import {
DerivLightIcCashierBlockedIcon,
DerivLightIcCashierLockedIcon,
DerivLightIcCashierUnderMaintenanceIcon,
DerivLightWalletCurrencyUnavailableIcon as P2pUnavailable,
} from '@deriv/quill-icons';
import { Localize } from '@deriv-com/translations';
import { ActionScreen, Button, Text, useDevice } from '@deriv-com/ui';
Expand Down
7 changes: 2 additions & 5 deletions src/components/Page404/Page404.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useHistory } from 'react-router-dom';
import Icon404 from '@/assets/404.png';
import { BUY_SELL_URL } from '@/constants';
import { DerivLight404ErrorIcon } from '@deriv/quill-icons';
import { Localize } from '@deriv-com/translations';
import { Button, Text, useDevice } from '@deriv-com/ui';
import './Page404.scss';
Expand All @@ -11,10 +11,7 @@ const Page404 = () => {
const descriptionSize = isDesktop ? 'md' : 'sm';
return (
<div className='page-404'>
{/* TODO: to be replaced with quill icons */}
<div>
<img alt='Page not found' src={Icon404} />
</div>
<DerivLight404ErrorIcon />
<div className='page-404__text'>
<Text size={isDesktop ? '2xl' : 'lg'} weight='bold'>
<Localize i18n_default_text='We couldn’t find that page' />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TFormState, THooks, TPaymentMethod, TSelectedPaymentMethod } from 'types';
import { LabelPairedSearchMdRegularIcon, LegacyCloseCircle1pxIcon } from '@deriv/quill-icons';
import { LabelPairedSearchMdRegularIcon, LegacyCloseCircle1pxBlackIcon } from '@deriv/quill-icons';
import { Localize, useTranslations } from '@deriv-com/translations';
import { Button, Dropdown, Input, Text } from '@deriv-com/ui';

Expand Down Expand Up @@ -29,7 +29,7 @@ const PaymentMethodFormAutocomplete = ({
label={localize('Choose your payment method')}
rightPlaceholder={
actionType === 'EDIT' ? null : (
<LegacyCloseCircle1pxIcon
<LegacyCloseCircle1pxBlackIcon
className='payment-method-form__icon--close'
data-testid='dt_payment_methods_form_close_icon'
fill='#999999'
Expand Down
9 changes: 7 additions & 2 deletions src/components/Search/Search.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useCallback, useState } from 'react';
import clsx from 'clsx';
import { LabelPairedSearchMdRegularIcon, LegacyCloseCircle1pxIcon } from '@deriv/quill-icons';
import { LabelPairedSearchMdRegularIcon, LegacyCloseCircle1pxBlackIcon } from '@deriv/quill-icons';
import { Input } from '@deriv-com/ui';
import './Search.scss';

Expand Down Expand Up @@ -48,7 +48,12 @@ const Search = ({ delayTimer = 500, hideBorder = false, name, onSearch, placehol
onChange={handleInputChange}
rightPlaceholder={
searchValue && (
<LegacyCloseCircle1pxIcon className='cursor-pointer' iconSize='xs' onClick={clearSearch} />
<LegacyCloseCircle1pxBlackIcon
className='cursor-pointer'
fill='#999'
iconSize='xs'
onClick={clearSearch}
/>
)
}
type='search'
Expand Down
5 changes: 3 additions & 2 deletions src/hooks/custom-hooks/useSendbird.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,10 @@ const useSendbird = (orderId: string | undefined, isErrorOrderInfo: boolean, cha
useEffect(() => {
// if the user has not created a chat URL for the order yet, create one using p2p_create_chat endpoint
// chatChannelUrl is received from order details, hence check if chat url was already created using p2p_create_chat
if (!chatChannel?.url && sendbirdServiceToken?.app_id && orderId) {
// initialise Chat only if chatchannelurl is already present in order details, but chatChannel is not created in sendbird.
if (!chatChannel?.url && sendbirdServiceToken?.app_id && orderId && chatChannelUrl) {
initialiseChat();
} else if (orderId && !chatChannelUrl && !chatChannel?.url) {
} else if (orderId && !chatChannelUrl && !chatChannel?.url && sendbirdServiceToken?.app_id) {
createChat({
order_id: orderId,
});
Expand Down
3 changes: 1 addition & 2 deletions src/pages/guide/screens/Blog/Blog.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//TODO: Replace this with Quill icon once ready
import { ReactComponent as BlogIcon } from '@/assets/blog.svg';
import { HOW_TO_PROTECT_YOURSELF_URL } from '@/constants';
import { DerivLightP2pSecureImageIcon as BlogIcon } from '@deriv/quill-icons';
import { Localize } from '@deriv-com/translations';
import { Text, useDevice } from '@deriv-com/ui';
import { Carousel } from '../../components';
Expand Down
8 changes: 5 additions & 3 deletions src/pages/guide/screens/Videos/Videos.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { useState } from 'react';
import { ReactComponent as IntroducingDerivP2PIcon } from '@/assets/introducing-deriv-p2p.svg';
import { ReactComponent as UseDerivP2PIcon } from '@/assets/use-deriv-p2p.svg';
import { VideoPlayerModal } from '@/components/Modals';
import { HOW_TO_USE_DERIV_P2P_URL, INTRODUCING_DERIV_P2P_URL } from '@/constants';
import { useModalManager } from '@/hooks/custom-hooks';
import { StandalonePlayFillIcon } from '@deriv/quill-icons';
import {
DerivLightP2pAppImageIcon as UseDerivP2PIcon,
DerivLightP2pBannerImageIcon as IntroducingDerivP2PIcon,
StandalonePlayFillIcon,
} from '@deriv/quill-icons';
import { Localize } from '@deriv-com/translations';
import { Text, useDevice } from '@deriv-com/ui';
import { Carousel } from '../../components';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/orders/screens/OrderDetails/OrderDetails.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.order-details {
overflow: auto;
height: calc(100% - 27rem);
height: calc(100% - 17rem);

@include mobile-or-tablet-screen {
position: absolute;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/orders/screens/OrderDetails/OrderDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const OrderDetails = () => {

return (
<OrderDetailsProvider value={{ isErrorOrderInfo: !!error, orderDetails }}>
<div className='w-full'>
<div className='h-full w-full'>
<PageReturn onClick={onReturn} pageTitle={headerText} weight='bold' />
<div className='order-details'>
{shouldShowLostFundsBanner && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

&__full-page {
position: absolute;
top: 0;
top: 1rem;
left: 0;
z-index: 1;
height: calc(100vh - 8rem);
height: calc(100% - 9rem);

& .mobile-wrapper {
&__body {
Expand All @@ -35,11 +35,13 @@
}

&--closed {
height: calc(100vh - 5rem);
height: calc(100% - 5rem);

& .mobile-wrapper {
&__footer {
padding: 1.6rem;
margin-top: -1rem;
background-color: #fff;
}
}
}
Expand Down
Loading