Skip to content

Commit

Permalink
Merge branch 'master' of github.com:binary-com/deriv-app into niloo/8…
Browse files Browse the repository at this point in the history
…8920/ts-migration-parent
  • Loading branch information
niloofar sadeghi committed May 7, 2023
2 parents 34a6e14 + 3c4cefc commit f2e1a35
Show file tree
Hide file tree
Showing 27 changed files with 1,473 additions and 1,472 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
}

&__loader {
position: fixed;
position: relative;
left: 0;
}

Expand Down
1 change: 1 addition & 0 deletions packages/core/build/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ const plugins = ({ base, is_test_env }) => {
process.env.DATADOG_SESSION_REPLAY_SAMPLE_RATE
),
'process.env.DATADOG_SESSION_SAMPLE_RATE': JSON.stringify(process.env.DATADOG_SESSION_SAMPLE_RATE),
'process.env.CIRCLE_TAG': JSON.stringify(process.env.CIRCLE_TAG),
}),
new CleanWebpackPlugin(),
new CopyPlugin(copyConfig(base)),
Expand Down
11 changes: 5 additions & 6 deletions packages/core/src/Stores/client-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
setCurrencies,
toMoment,
urlForLanguage,
CookieStorage,
} from '@deriv/shared';
import { WS, requestLogout } from 'Services';
import { action, computed, makeObservable, observable, reaction, runInAction, toJS, when } from 'mobx';
Expand Down Expand Up @@ -1190,6 +1189,9 @@ export default class ClientStore extends BaseStore {
};
Cookies.set('region', getRegion(landing_company_shortcode, residence), { domain });
Cookies.set('client_information', client_information, { domain });
// need to find other way to get the boolean value and set this cookie since `this.is_p2p_enabled` is deprecated and we can't use hooks here
Cookies.set('is_p2p_disabled', !this.is_p2p_enabled, { domain });

this.has_cookie_account = true;
} else {
removeCookies('region', 'client_information', 'is_p2p_disabled');
Expand Down Expand Up @@ -2661,24 +2663,21 @@ export default class ClientStore extends BaseStore {
this.prev_account_type = acc_type;
};

/** @deprecated Use `useIsP2PEnabled` from `@deriv/stores` package instead.
/** @deprecated Use `useIsP2PEnabled` from `@deriv/hooks` package instead.
*
* This method is being used in `NotificationStore`, Once we get rid of the usage we can remove this method.
*
* Please `DO NOT` add the type for this method in `TCoreStores` as it is deprecated and shouldn't be used.
* */
get is_p2p_enabled() {
const { is_low_risk_cr_eu_real } = this.root_store.traders_hub;
const is_low_risk_cr_eu_real = this.root_store?.traders_hub?.is_low_risk_cr_eu_real;

const is_p2p_supported_currency = Boolean(
this.website_status?.p2p_config?.supported_currencies.includes(this.currency.toLocaleLowerCase())
);

const is_p2p_visible = is_p2p_supported_currency && !this.is_virtual && !is_low_risk_cr_eu_real;

const p2p_cookie = new CookieStorage('is_p2p_disabled');
p2p_cookie.set('is_p2p_disabled', !is_p2p_visible);

return is_p2p_visible;
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Stores/common-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ export default class CommonStore extends BaseStore {
try {
await changeLanguage(key, () => {
this.changeCurrentLanguage(key);
this.root_store.client.setIsAuthorize(false);
BinarySocket.closeAndOpenNewConnection(key);
this.root_store.client.setIsAuthorize(false);
});
resolve();
} catch (e) {
Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/Utils/Datadog/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@ const DATADOG_APP_ID = process.env.DATADOG_APPLICATION_ID ?? '';
const DATADOG_CLIENT_TOKEN = process.env.DATADOG_CLIENT_TOKEN ?? '';
const DATADOG_SESSION_SAMPLE_RATE = process.env.DATADOG_SESSION_SAMPLE_RATE ?? 10;
const DATADOG_SESSION_REPLAY_SAMPLE_RATE = process.env.DATADOG_SESSION_REPLAY_SAMPLE_RATE ?? 1;
const CIRCLE_TAG = process.env.CIRCLE_TAG ?? 'NO_VERSION';

datadogRum.init({
applicationId: DATADOG_APP_ID,
clientToken: DATADOG_CLIENT_TOKEN,
site: 'datadoghq.com',
service: 'deriv.com',
service: 'app.deriv.com',
env: 'production',
sessionSampleRate: +DATADOG_SESSION_SAMPLE_RATE,
sessionReplaySampleRate: +DATADOG_SESSION_REPLAY_SAMPLE_RATE,
trackUserInteractions: true,
trackResources: true,
trackLongTasks: true,
defaultPrivacyLevel: 'mask-user-input',
version: '1.0.0',
version: `deriv-app-${CIRCLE_TAG}`,
trackFrustrations: true,
enableExperimentalFeatures: ['clickmap'],
});
Expand Down
1 change: 0 additions & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
},
"dependencies": {
"@deriv/api-types": "^1.0.94",
"@deriv/stores": "^1.0.0",
"@deriv/translations": "^1.0.0",
"@types/js-cookie": "^3.0.1",
"@types/react-loadable": "^5.5.6",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import classNames from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';
import { Icon, DesktopWrapper, Money, MobileWrapper, Popover, Text } from '@deriv/components';
import { localize, Localize } from '@deriv/translations';
import { getCurrencyDisplayCode, getGrowthRatePercentage, getLocalizedBasis, isMobile } from '@deriv/shared';
import { DesktopWrapper, Icon, MobileWrapper, Money, Popover, Text } from '@deriv/components';
import { Localize, localize } from '@deriv/translations';
import { getCurrencyDisplayCode, getLocalizedBasis, isMobile, getGrowthRatePercentage } from '@deriv/shared';
import CancelDealInfo from './cancel-deal-info.jsx';

const ValueMovement = ({ has_error_or_not_loaded, proposal_info, currency, has_increased, is_vanilla }) => (
<div className='strike--value-container'>
<div className={classNames({ 'strike--value-container': is_vanilla })}>
<div className={classNames('trade-container__price-info-value', { 'strike--info': is_vanilla })}>
{!has_error_or_not_loaded && (
<Money
Expand Down Expand Up @@ -62,14 +62,14 @@ const ContractInfo = ({

const setBasisText = () => {
if (is_vanilla) {
return 'Payout per point';
return localize('Payout per point');
}
return proposal_info.obj_contract_basis.text;
};

const has_error_or_not_loaded = proposal_info.has_error || !proposal_info.id;

const basis_text = has_error_or_not_loaded ? stakeOrPayout() : localize('{{value}}', { value: setBasisText() });
const basis_text = has_error_or_not_loaded ? stakeOrPayout() : setBasisText();

const { message, obj_contract_basis, stake } = proposal_info;

Expand Down
3 changes: 2 additions & 1 deletion packages/trader/src/sass/app/_common/components/strike.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
grid-template-columns: 1fr 1fr 1fr;
height: 4rem;
margin: 0 0 0.8rem;
padding: 1rem 0.8rem;
padding: 0 0.8rem;
box-sizing: border-box;

.mobile-widget {
&__spot {
Expand Down
2 changes: 1 addition & 1 deletion packages/translations/crowdin/messages.json

Large diffs are not rendered by default.

Loading

0 comments on commit f2e1a35

Please sign in to comment.