Skip to content

Commit

Permalink
Merge pull request #11 from amina-deriv/amina/feature/90115/update_ju…
Browse files Browse the repository at this point in the history
…risdiction

Amina/feature/90115/update jurisdiction
  • Loading branch information
shaheer-deriv committed Apr 18, 2023
2 parents 2aea226 + c68bc20 commit 6937c6d
Show file tree
Hide file tree
Showing 9 changed files with 167 additions and 101 deletions.
126 changes: 85 additions & 41 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"@typescript-eslint/eslint-plugin": "^5.8.0",
"@typescript-eslint/parser": "^5.8.0",
"babel-polyfill": "^6.26.0",
"dotenv-webpack": "^8.0.1",
"eslint": "^7.18.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-binary": "^1.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useHistory } from 'react-router';
import { observer } from 'mobx-react-lite';
import { Button, Text } from '@deriv/components';
import { formatMoney, getCurrencyName, routes } from '@deriv/shared';
import { localize } from '@deriv/translations';
import { Localize } from '@deriv/translations';
import BalanceText from 'Components/elements/text/balance-text';
import CurrencySwitcherContainer from 'Components/containers/currency-switcher-container';
import { TRootStore } from 'Types';
Expand All @@ -14,9 +14,10 @@ const default_balance = { balance: 0, currency: 'USD' };
const RealAccountCard = () => {
const history = useHistory();
const store = useStores();
const { client, modules, traders_hub }: TRootStore = store;
const { client, common, modules, traders_hub }: TRootStore = store;

const { accounts, loginid } = client;
const { current_language } = common;
const { current_list } = modules.cfd;
const { openModal, is_eu_user } = traders_hub;
const { balance, currency } = accounts[loginid] || default_balance;
Expand Down Expand Up @@ -49,7 +50,7 @@ const RealAccountCard = () => {
secondary
className='currency-switcher__button'
>
{localize('Deposit')}
<Localize key={`currency-switcher__button-text-${current_language}`} i18n_default_text='Deposit' />
</Button>
}
has_interaction
Expand Down
3 changes: 0 additions & 3 deletions packages/bot-skeleton/src/constants/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,6 @@ export const config = {
[localize('Signal'), '2'],
],
gd: {
cid: '828416594271-b4bhia944ecegn3j327oeb4l8o803bts.apps.googleusercontent.com',
aid: 'derivbot-248506',
api: 'AIzaSyA52MX2l8p75-w7nvab7fU6Lk6KwLqnyEI',
scope: 'https://www.googleapis.com/auth/drive.file',
discovery_docs: 'https://www.googleapis.com/discovery/v1/apis/drive/v3/rest',
},
Expand Down
8 changes: 4 additions & 4 deletions packages/bot-web-ui/src/stores/google-drive-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ export default class GoogleDriveStore {
is_authorised = !!localStorage.getItem('google_access_token');

setKey = () => {
const { aid, cid, api, scope, discovery_docs } = config.gd;
this.client_id = cid;
this.app_id = aid;
this.api_key = api;
const { scope, discovery_docs } = config.gd;
this.client_id = process.env.GD_CLIENT_ID;
this.app_id = process.env.GD_APP_ID;
this.api_key = process.env.GD_API_KEY;
this.scope = scope;
this.discovery_docs = discovery_docs;
};
Expand Down
8 changes: 8 additions & 0 deletions packages/bot-web-ui/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const DefinePlugin = require('webpack').DefinePlugin;
const Dotenv = require('dotenv-webpack');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const path = require('path');
const StyleLintPlugin = require('stylelint-webpack-plugin');
Expand Down Expand Up @@ -116,6 +118,12 @@ module.exports = function (env) {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
plugins: [
new Dotenv(),
new DefinePlugin({
'process.env.GD_CLIENT_ID': JSON.stringify(process.env.GD_CLIENT_ID),
'process.env.GD_API_KEY': JSON.stringify(process.env.GD_API_KEY),
'process.env.GD_APP_ID': JSON.stringify(process.env.GD_APP_ID),
}),
new CleanWebpackPlugin(),
new MiniCssExtractPlugin({
filename: 'bot/css/bot.main.[contenthash].css',
Expand Down
Loading

0 comments on commit 6937c6d

Please sign in to comment.