Skip to content
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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opex",
"version": "v1.0.3-beta.12",
"version": "v1.0.3-beta.13",
"homepage": "",
"private": true,
"dependencies": {
Expand All @@ -11,6 +11,7 @@
"@testing-library/user-event": "^14.4.3",
"axios": "^0.27.2",
"bignumber.js": "^9.1.1",
"buffer": "^6.0.3",
"i18next": "^22.4.15",
"i18next-browser-languagedetector": "^7.0.1",
"i18next-http-backend": "^2.2.0",
Expand Down
9 changes: 6 additions & 3 deletions public/assets/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
"LTC": "LTC",
"TBNB": "TBUSD",
"TBUSD": "TBUSD",
"BCH": "BCH"
"BCH": "BCH",
"TRX": "TRX"
},
"marketInterval": {
"24h": "24 hours",
Expand Down Expand Up @@ -244,15 +245,17 @@
"DepositTETHContentBefore": "Ropsten network ETH test Only accepted! For free download",
"DepositTETHContentAfter": "go to send a test ETH to this address. You must change your wallet Etherium network to Ropsten. This network is on the Metamask wallet network list by default. Any transaction with an amount equal to or greater than 0.001 ETH to the above address will be added to your account.",
"minDeposit": "The minimum acceptable amount {{min}} {{currency}}",
"minDepositText": "Any transaction with a value greater than {{min}} {{currency}} will be added to your account at the following address.",
"minDepositText": "Any transaction will be added to your account at the following address.",
"DepositTBTCContentBefore": "Only BTC test accepted! For free download",
"DepositTBTCContentAfter": "go to any transaction with an amount equal to or greater than 0.001 BTC to the above address will be added to your account.",
"DepositTUSDTContentBefore": "Only USDT Ropsten Network Test is accepted! To learn how to get free,",
"DepositTUSDTContentAfter": "Go. To send a USDT test to this address, you must change your wallet atrium network to Ropsten. This network is on the Metamask wallet network list by default. Any transaction with an amount equal to or greater than From 10 USDT to the above address will be added to your account.",
"depositTime": "* Your balance will increase {{time}} minutes after depositing to the above address.",
"securityConsiderations": "Due to security considerations, the transfer to the account may be delayed slightly. You can see the withdrawal status on the same page in the Deposit / Withdrawal Transactions section.",
"network": "Network",
"selectNetwork": "Select Network"
"selectNetwork": "Select Network",
"gettingAddress": "Getting address...",
"errorGettingAddress": "Failed to get address"
},
"CallbackPage": {
"ok": "The deposit was successful.",
Expand Down
9 changes: 6 additions & 3 deletions public/assets/locales/fa/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
"LTC": "لایت کوین",
"TBNB": "بایننس (ت)",
"TBUSD": "دلار بایننس(ت)",
"BCH": "بیتکوین کش"
"BCH": "بیتکوین کش",
"TRX": "ترون"
},
"marketInterval": {
"24h": "24 ساعت",
Expand Down Expand Up @@ -244,15 +245,17 @@
"DepositTETHContentBefore": "فقط ETH تستی شبکه Ropsten مورد قبول قرار می گیرد! برای دریافت رایگان به ",
"DepositTETHContentAfter": " بروید. برای ارسال ETH تستی به این آدرس، باید شبکه اتریومی کیف پول خود را به Ropsten تغییر دهید. این شبکه به طور پیش فرض در فهرست شبکه های کیف پول Metamask وجود دارد. هر تراکنشی با مقدار مساوی یا بیشتر از ۰.۰۰۱ ETH به آدرس بالا، به حساب شما افزوده می شود.",
"minDeposit": "حداقل میزان قابل قبول {{min}} {{currency}}",
"minDepositText": "هر تراکنشی با مقدار بیشتر از {{min}} {{currency}} به آدرس زیر ، به حساب شما افزوده می شود.",
"minDepositText": "هر تراکنشی به آدرس زیر ، به حساب شما افزوده می شود.",
"DepositTBTCContentBefore": "فقط BTC تستی مورد قبول قرار می گیرد! برای دریافت رایگان به ",
"DepositTBTCContentAfter": " بروید. هر تراکنشی با مقدار مساوی یا بیشتر از ۰.۰۰۱ BTC به آدرس بالا، به حساب شما افزوده می شود.",
"DepositTUSDTContentBefore": "فقط USDT تستی شبکه Ropsten مورد قبول قرار می گیرد! برای آشنایی با روش دریافت رایگان به ",
"DepositTUSDTContentAfter": " بروید. برای ارسال USDT تستی به این آدرس، باید شبکه اتریومی کیف پول خود را به Ropsten تغییر دهید. این شبکه به طور پیش فرض در فهرست شبکه های کیف پول Metamask وجود دارد. هر تراکنشی با مقدار مساوی یا بیشتر از ۱۰ USDT به آدرس بالا، به حساب شما افزوده می شود.",
"depositTime": "* موجودی شما {{time}} دقیقه بعد از واریز به آدرس بالا، افزایش پیدا می کند.",
"securityConsiderations": "باتوجه به ملاحظات امنیتی ممکن است انتقال به حساب با کمی تاخیر صورت بگیرد. می توانید وضعیت برداشت را در همین صفحه از بخش ترکنش های واریز/برداشت ببینید.",
"network": "شبکه",
"selectNetwork": " شبکه را انتخاب کنید"
"selectNetwork": " شبکه را انتخاب کنید",
"gettingAddress": "درحال گرفتن آدرس...",
"errorGettingAddress": "خطا در گرفتن آدرس"
},
"CallbackPage": {
"ok": "واریز وجه با موفقیت انجام شد.",
Expand Down
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
<link rel="icon" href="%PUBLIC_URL%/assets/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1 , maximum-scale=1.0, user-scalable=no" />
<meta name="theme-color" content="#000000" />
<meta name="description" content=%REACT_APP_DESCRIPTION_CONTENT%/>

<meta name="description"/>

<link rel="manifest" href="%PUBLIC_URL%/assets/manifest.json?v=3.0.0" />

Expand Down Expand Up @@ -33,7 +34,6 @@

<script src="%PUBLIC_URL%/charting_library/charting_library.min.js"></script>
<script src="%PUBLIC_URL%/env.js"></script>
<title>%REACT_APP_TITLE%</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
4 changes: 4 additions & 0 deletions src/assets/images.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import litecoin from "./images/src/litecoin.svg";
import tether from "./images/src/tether.svg";
import binance from "./images/src/binance.svg";
import binanceUSD from "./images/src/binanceUSD.svg";
import tron from "./images/src/tron.svg";
import testTron from "./images/src/testTron.svg";
import ethereumLight from "./images/src/ethereumLight.svg";
import toman from "./images/src/toman.svg";
import spaceStar from "./images/src/spaceStar.png";
Expand Down Expand Up @@ -56,6 +58,8 @@ export const images = {
USDT: tether,
BNB: binance,
BUSD: binanceUSD,
TRX: tron,
TTRX: testTron,
ETH: ethereumLight,
IRT: toman,
spaceStar: spaceStar,
Expand Down
19 changes: 19 additions & 0 deletions src/assets/images/src/testTron.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions src/assets/images/src/tron.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 44 additions & 35 deletions src/components/Popup/Popup.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,43 @@
import React, {useRef} from "react";
import React, {useEffect, useRef, useState} from "react";
import classes from "./Popup.module.css";
import {Trans, useTranslation} from "react-i18next";
import {useTranslation} from "react-i18next";
import {useSelector} from "react-redux";
import Button from "../Button/Button";
import {Link, Navigate} from "react-router-dom";
import * as Routes from "../../main/Browser/Routes/routes";
import {Login} from "../../main/Browser/Routes/routes";
import QRCode from "react-qr-code";
import Icon from "../Icon/Icon";
import TextInput from "../TextInput/TextInput";
import {toast} from "react-hot-toast";
import {useGetDepositAddress} from "../../queries";
import {useGetCurrencyInfo} from "../../queries";
import Loading from "../Loading/Loading";
import Error from "../Error/Error";
import PopupAddress from "./PopupAddress/PopupAddress";

const Popup = ({currency, closePopup}) => {

const {t} = useTranslation();
const addressRef = useRef(null);
const {data: address , isLoading , error} = useGetDepositAddress(currency)

const isLogin = useSelector((state) => state.auth.isLogin)

const copyToClipboard = () => {
addressRef.current.select();
document.execCommand("copy");
toast.success(<Trans i18nKey="DepositWithdraw.success"/>);
};

const [networkName, setNetworkName] = useState({value: 0, error: []});

const selectRef = useRef()
const {data: currencyInfo, isLoading: CILoading, error: CIError, refetch: refetchCI} = useGetCurrencyInfo(currency)

useEffect(() => {
setNetworkName({value: 0, error: []})

}, [currency]);



useEffect(() => {
if (currency !== "IRT") {
refetchCI()
}
}, [currency]);



const content = () => {
if(!isLogin) return <div className={`width-100 flex jc-center ai-center height-100`}>
Expand All @@ -34,37 +46,34 @@ const Popup = ({currency, closePopup}) => {
</Link>
</div>

if(isLoading) return <Loading/>
if (error) return <Error/>
if(CILoading) return <Loading/>
if (CIError) return <Error/>
if (currency === "IRT") return <Navigate to={Routes.Wallet + "/IRT"} replace />

return <>
<QRCode
value={address.address}
bgColor="var(--cardBody)"
fgColor="var(--textColor)"
level='L'
size={90}
/>
<TextInput
after={
<Icon
iconName="icon-copy fs-02"
onClick={() => copyToClipboard()}
customClass={`hover-text cursor-pointer`}
/>
}
customClass={`${classes.thisInput} mt-2`}
readOnly={true}
type="text"
customRef={addressRef}
value={address.address}
select={true}
placeholder={t('DepositWithdraw.selectNetwork')}
options={currencyInfo?.chains.map((chain, index) => {
return {value: index, label: `${chain.network} - ${chain.currency}`}
})}
lead={t('DepositWithdraw.network')}
type="select"
value={currencyInfo?.chains[networkName.value] && {
value: networkName.value,
label: `${currencyInfo?.chains[networkName.value].network} - ${currencyInfo?.chains[networkName.value].currency}`
}}
onchange={(e) => setNetworkName({value: e?.value || 0, error: []})}
customRef={selectRef}
alerts={networkName.error}
customClass={`width-50 ${classes.thisInput}`}
/>
{ currencyInfo && <PopupAddress currency={currency} network={currencyInfo?.chains[networkName?.value]?.network}/>}
</>
}

return (
<div className={`width-100 column jc-center ai-center px-1 py-1 appear-animation card-border ${classes.container}`}>
<div className={`width-100 column jc-between ai-center px-1 py-1 appear-animation card-border ${classes.container}`}>
<div className={`${classes.header} width-100`}>
<h3>{t("deposit")} <span>{t("currency." + currency)}</span></h3>
</div>
Expand Down
9 changes: 8 additions & 1 deletion src/components/Popup/Popup.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
position: fixed;
top: 11vh;
width: 30%;
height: 35vh;
height: 40vh;
background-color: var(--popupAlpha);
z-index: 3;
box-shadow: -1px 5px 8px -2px #101010ad;
Expand Down Expand Up @@ -56,3 +56,10 @@
cursor: not-allowed;
font-family: 'Roboto', sans-serif;
}

.thisInput :global(.lead) {
width: 30%;
}
.thisInput :global(.selectExternalClass) {
width: 70% !important;
}
62 changes: 62 additions & 0 deletions src/components/Popup/PopupAddress/PopupAddress.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import React, {useEffect, useRef} from 'react';
import QRCode from "react-qr-code";
import TextInput from "../../TextInput/TextInput";
import Icon from "../../Icon/Icon";
import classes from "../Popup.module.css";
import {useGetDepositAddress} from "../../../queries";
import {toast} from "react-hot-toast";
import {Trans, useTranslation} from "react-i18next";

const PopupAddress = ({currency, network}) => {

const addressRef = useRef(null);
const {t} = useTranslation();

const {data: address, isLoading, error, refetch: refetchAddress} = useGetDepositAddress(currency, network)

const copyToClipboard = () => {
addressRef.current.select();
document.execCommand("copy");
toast.success(<Trans i18nKey="DepositWithdraw.success"/>);
};

useEffect(() => {
if (currency !== "IRT") {
refetchAddress()
}
}, [network]);

if (isLoading) return <span className={`flashit width-100 flex jc-center ai-center mt-6`}>{t('DepositWithdraw.gettingAddress')}</span>
if (error) return <span className={` width-100 flex jc-center ai-center mt-6`}>{t('DepositWithdraw.errorGettingAddress')}</span>


return (
<>
<span className={`my-1`}>
<QRCode
value={address.address}
bgColor="var(--cardBody)"
fgColor="var(--textColor)"
level='L'
size={90}
/>
</span>
<TextInput
after={
<Icon
iconName="icon-copy fs-02"
onClick={() => copyToClipboard()}
customClass={`hover-text cursor-pointer`}
/>
}
customClass={`${classes.thisInput}`}
readOnly={true}
type="text"
customRef={addressRef}
value={address.address}
/>
</>
);
};

export default PopupAddress;
2 changes: 1 addition & 1 deletion src/components/TextInput/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const TextInput = (props) => {
options={options}
ref={customRef}
classNamePrefix="select"
className={classes.selectBox}
className={`${classes.selectBox} selectExternalClass`}
{...other}
/>
}
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ const rootReducer = combineReducers({

//add custom title & meta
const meta = document.getElementsByTagName('meta')
document.title = window.env.REACT_APP_TITLE;
meta.description.content = window.env.REACT_APP_DESCRIPTION_CONTENT
document.title = window.env.REACT_APP_TITLE ? window.env.REACT_APP_TITLE : " ";
meta.description.content = window.env.REACT_APP_DESCRIPTION_CONTENT ? window.env.REACT_APP_DESCRIPTION_CONTENT : " "

/**
* Base URL of the website.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import Icon from "../../../../../../components/Icon/Icon";
import Countdown from "react-countdown";
import {useDispatch, useSelector} from "react-redux";
import {setVerifyEmailLockInitiate} from "../../../../../../store/actions";
import {Buffer} from 'buffer';


const EmailVerification = ({returnFunc, email, disable, returnFuncDisableFalse, returnFuncDisableTrue}) => {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Icon from "../../../../../../components/Icon/Icon";
import {images} from "../../../../../../assets/images";
import {validateEmail} from "../../../../../../utils/utils";
import {getCaptchaImage, requestForForgetPassword} from "js-api-client";
import {Buffer} from 'buffer';

const ForgetPassword = ({returnFunc}) => {

Expand Down
Loading