Skip to content

Commit

Permalink
fix: reverted changes for the order details related files to avoid re…
Browse files Browse the repository at this point in the history
…petition
  • Loading branch information
nada-deriv committed May 16, 2024
1 parent 8d262e3 commit 401a322
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { ERROR_CODES } from '@/constants';
import { api } from '@/hooks';
import { useModalManager } from '@/hooks/custom-hooks';
import { useOrderDetails } from '@/providers/OrderDetailsProvider';
import { Localize } from '@deriv-com/translations';
import { Button, useDevice } from '@deriv-com/ui';
import './OrderDetailsCardFooter.scss';

Expand Down Expand Up @@ -73,10 +72,10 @@ const OrderDetailsCardFooter = ({ sendFile }: { sendFile: (file: File) => void }
textSize={textSize}
variant='outlined'
>
<Localize i18n_default_text='Cancel order' />
Cancel order
</Button>
<Button onClick={() => showModal('OrderDetailsConfirmModal')} size='lg' textSize={textSize}>
<Localize i18n_default_text='I’ve paid' />
I’ve paid
</Button>
</div>
)}
Expand All @@ -90,10 +89,10 @@ const OrderDetailsCardFooter = ({ sendFile }: { sendFile: (file: File) => void }
textSize={textSize}
variant='ghost'
>
<Localize i18n_default_text='Complain' />
Complain
</Button>
<Button size='lg' textSize={textSize}>
<Localize i18n_default_text='I’ve received payment' />
I’ve received payment
</Button>
</div>
)}
Expand All @@ -107,14 +106,14 @@ const OrderDetailsCardFooter = ({ sendFile }: { sendFile: (file: File) => void }
textSize={textSize}
variant='ghost'
>
<Localize i18n_default_text='Complain' />
Complain
</Button>
</div>
)}
{shouldShowOnlyReceivedButton && (
<div className='ml-auto'>
<Button size='lg' textSize={textSize}>
<Localize i18n_default_text='I’ve received payment' />
I’ve received payment
</Button>
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { api } from '@/hooks';
import { useOrderDetails } from '@/providers/OrderDetailsProvider';
import { getDateAfterHours } from '@/utils';
import { StandaloneStarFillIcon } from '@deriv/quill-icons';
import { Localize } from '@deriv-com/translations';
import { Button, Text, useDevice } from '@deriv-com/ui';
import { RecommendationStatus } from './RecommendationStatus';

Expand Down Expand Up @@ -38,33 +37,20 @@ const OrderDetailsCardReview = () => {
icon={<StandaloneStarFillIcon fill='#FFAD3A' height={18} width={18} />}
variant='outlined'
>
<Text size={isMobile ? 'sm' : 'xs'}>
{isReviewable ? (
<Localize i18n_default_text='Rate this transaction' />
) : (
<Localize i18n_default_text='Not rated' />
)}
</Text>
<Text size={isMobile ? 'sm' : 'xs'}>{isReviewable ? 'Rate this transaction' : 'Not rated'}</Text>
</Button>
<Text color='less-prominent' size={isMobile ? 'xs' : '2xs'}>
{isReviewable ? (
<Localize
i18n_default_text='You have until {{remainingReviewTime}} GMT to rate this transaction.'
values={{ remainingReviewTime }}
/>
) : (
<Localize i18n_default_text='You can no longer rate this transaction.' />
)}
{isReviewable
? `You have until ${remainingReviewTime} GMT to rate this transaction.`
: 'You can no longer rate this transaction.'}
</Text>
</div>
);

if (hasReviewDetails) {
return (
<div className='flex flex-col px-[1.6rem] py-10 gap-4'>
<Text weight='bold'>
<Localize i18n_default_text='Your transaction experience' />
</Text>
<Text weight='bold'>Your transaction experience</Text>
<div className='flex justify-between w-4/5 ml-2'>
<StarRating isReadonly ratingValue={ratingAverageDecimals} starsScale={1.2} />
<RecommendationStatus />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useOrderDetails } from '@/providers/OrderDetailsProvider';
import { StandaloneThumbsDownRegularIcon, StandaloneThumbsUpRegularIcon } from '@deriv/quill-icons';
import { Localize } from '@deriv-com/translations';
import { Text, useDevice } from '@deriv-com/ui';

const RecommendationStatus = () => {
Expand All @@ -16,12 +15,12 @@ const RecommendationStatus = () => {
{reviewDetails?.recommended ? (
<>
<StandaloneThumbsUpRegularIcon className='mb-[0.3rem]' fill='#4BB4B3' iconSize='sm' />
<Localize i18n_default_text='Recommended' />
Recommended
</>
) : (
<>
<StandaloneThumbsDownRegularIcon fill='#ec3f3f' iconSize='sm' />
<Localize i18n_default_text='Not Recommended' />
Not Recommended
</>
)}
</Text>
Expand Down
9 changes: 2 additions & 7 deletions src/pages/orders/screens/OrderDetails/OrderDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ import { ExtendedOrderDetails } from '@/hooks/custom-hooks/useExtendedOrderDetai
import { OrderDetailsProvider } from '@/providers/OrderDetailsProvider';
import { LegacyLiveChatOutlineIcon } from '@deriv/quill-icons';
import { useAuthData } from '@deriv-com/api-hooks';
import { Localize, useTranslations } from '@deriv-com/translations';
import { Button, InlineMessage, Loader, Text, useDevice } from '@deriv-com/ui';
import { OrderDetailsCard } from '../../components/OrderDetailsCard';
import { OrderDetailsCardFooter } from '../../components/OrderDetailsCard/OrderDetailsCardFooter';
import { OrdersChatSection } from '../OrdersChatSection';
import './OrderDetails.scss';

const OrderDetails = () => {
const { localize } = useTranslations();
const history = useHistory();
const location = useLocation();
const showChatParam = new URLSearchParams(location.search).get('showChat');
Expand All @@ -36,11 +34,8 @@ const OrderDetails = () => {
const { isMobile } = useDevice();
const { sendFile, userId, ...rest } = useSendbird(orderDetails?.id, !!error, orderDetails?.chat_channel_url ?? '');

const headerText = isBuyOrderForUser ? localize('Buy USD order') : localize('Sell USD order');

const warningMessage = (
<Localize i18n_default_text='Don’t risk your funds with cash transactions. Use bank transfers or e-wallets instead.' />
);
const headerText = `${isBuyOrderForUser ? 'Buy' : 'Sell'} USD order`;
const warningMessage = 'Don’t risk your funds with cash transactions. Use bank transfers or e-wallets instead.';

const onReturn = () => {
if ((location.state as { from: string })?.from === 'Orders') history.push(ORDERS_URL);
Expand Down

0 comments on commit 401a322

Please sign in to comment.