diff --git a/package.json b/package.json index b2bd7530..298f1393 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "react-dropzone": "^11.3.1", "react-hot-toast": "^2.4.1", "react-i18next": "^12.2.2", + "react-multi-date-picker": "^4.3.1", "react-number-format": "^4.9.3", "react-qr-code": "^2.0.11", "react-redux": "^8.0.5", diff --git a/public/assets/locales/en/translation.json b/public/assets/locales/en/translation.json index c4e776f1..3689d744 100644 --- a/public/assets/locales/en/translation.json +++ b/public/assets/locales/en/translation.json @@ -1,8 +1,8 @@ { "title": "OPEX", - "signIn":"Sign In", + "signIn": "Sign In", "signUp": "Sign Up", - "signOut":"Sign Out", + "signOut": "Sign Out", "date": "Date", "time": "Time", "volume": "Volume", @@ -15,11 +15,10 @@ "max": "Max", "buy": "Buy", "sell": "Sell", - "all": "All", "orderType": "Order Type", - "status" : "Status", - "pleaseLogin" : "Please Log In!", - "comingSoon" : "Coming Soon!", + "status": "Status", + "pleaseLogin": "Please Log In!", + "comingSoon": "Coming Soon!", "deposit": "Deposit", "withdrawal": "Withdrawal", "transfer": "Transfer", @@ -28,6 +27,12 @@ "commission": "Commission", "nextStep": "Next Step", "prevStep": "Prev Step", + "next": "next", + "all": "all", + "prev": "prev", + "ask": "ask", + "bid": "bid", + "to": "to", "submit": "Submit", "username": "Username", "password": "Password", @@ -44,21 +49,28 @@ "noTx": "There is no transaction!", "close": "Close", "unit": "Unit", + "from": "from", + "row": "Row", + "until": "until", + "withPrice": "with price", + "description": "Description", + "first": "First", "offline": "Check your connection!", - "improperMobileView ": "Not optimized for mobile view.", + "improperMobileView": "Not optimized for mobile view.", "home": "Home", "country": { - "iran" : "I. R. IRAN", - "germany" : "Germany", + "iran": "IRAN", + "germany": "Germany", "uk": "United Kingdom", - "turkey" : "Turkey" + "turkey": "Turkey", + "uzbekistan": "Uzbekistan" }, "currency": { - "IRT" : "IRT", - "Euro" : "Euro", - "USD" : "USD", - "BTC" : "BTC", - "ETH" : "ETH", + "IRT": "IRT", + "Euro": "Euro", + "USD": "USD", + "BTC": "BTC", + "ETH": "ETH", "USDT": "USDT", "TBTC": "TBTC", "TETH": "TETH", @@ -119,8 +131,8 @@ "LIMIT_MAKER": "Limit Maker" }, "header": { - "lastPrice" : "Last Price", - "availableBalance" : "Available Balance", + "lastPrice": "Last Price", + "availableBalance": "Available Balance", "free": "Available", "locked": "Locked", "inWithdrawalProcess": "Pending Withdrawal", @@ -144,6 +156,9 @@ "technical": { "title": "Technical" }, + "txHistory": { + "title": "Transactions History" + }, "messages": { "title": "Messages" }, @@ -153,7 +168,8 @@ "Languages": { "Persian": "فارسی", "English": "English", - "Arabic": "عربي" + "Arabic": "عربي", + "Uzbek": "Oʻzbekcha" }, "Theme": { "Light": "Light", @@ -165,13 +181,13 @@ }, "TimeZone": { "THR": "Asia / Tehran / UTC+3:30", - "UTC" : "UTC" + "UTC": "UTC" }, "orders": { "title": "Order", - "minOrder": "Minimum allowed order is {{min}} {{currency}}", - "maxOrder": "Maximum allowed order is {{max}} {{currency}}", - "divisibility": "Divisibility !", + "minOrder": "Minimum allowed order is {{min}} {{currency}}", + "maxOrder": "Maximum allowed order is {{max}} {{currency}}", + "divisibility": "The entered value must be divisible by {{mod}} !", "notEnoughBalance": "Insufficient Balance ", "availableAmount": "Available Amount", "bestOffer": "Best Offer", @@ -227,6 +243,21 @@ "showZeroBalance": "Do not show zero balance.", "estimateAlert": "The equivalent amount is calculated based on the highest buy offer" }, + "TransactionHistory": { + "coin": "Coins", + "category": "Categories", + "size": "Per page", + "period" : "Period" + }, + "TransactionCategory": { + "DEPOSIT": "Deposit", + "FEE": "Fee", + "TRADE": "Trade", + "WITHDRAW": "Withdraw", + "ORDER_CANCEL": "Cancel Order", + "ORDER_CREATE": "Create Order", + "ORDER_FINALIZED": "Finalized Order" + }, "DepositWithdraw": { "title": "Deposit / Withdraw", "success": "The Address is copied.", @@ -266,7 +297,7 @@ }, "IPGErrorCode": { "13003": "You are not allowed to pay.", - "13004":"You have an unpaid request.", + "13004": "You have an unpaid request.", "13005": "Request locked.", "13007": "Unknown Error" }, @@ -598,9 +629,9 @@ }, "Footer": { "darkMode": "Dark Mode", - "aboutUs" : "About Us", - "contactUS" : "Contact Us", - "blog" : "Blog", + "aboutUs": "About Us", + "contactUS": "Contact Us", + "blog": "Blog", "guide": "Guide", "rules": "Rules", "api": "API", @@ -618,10 +649,10 @@ "tooManyFiles": "Uploading more than one photo is not allowed!", "errorMsgDefault": "Uploaded photo is not valid!" }, - "errorPage" : { - "needKYC" : "Access denied for KYC status", - "reload" : "Try Again", - "errorText" : "Server connection error" + "errorPage": { + "needKYC": "Access denied for KYC status", + "reload": "Try Again", + "errorText": "Server connection error" }, "aboutUs": { "title": "About US", @@ -663,7 +694,6 @@ "p8": "", "p9": "", "text4": "" - }, "transferFees": { "title": "Transfer Fees", diff --git a/public/assets/locales/fa/translation.json b/public/assets/locales/fa/translation.json index d6437674..e3d3997d 100644 --- a/public/assets/locales/fa/translation.json +++ b/public/assets/locales/fa/translation.json @@ -15,7 +15,6 @@ "max": "حداکثر", "buy": "خرید", "sell": "فروش", - "all": "همه", "orderType": "نوع سفارش", "status": "وضعیت", "pleaseLogin": "لطفاً وارد شوید!", @@ -28,6 +27,12 @@ "commission": "کارمزد", "nextStep": "گام بعدی", "prevStep": "گام قبلی", + "next": "بعدی", + "all": "همه موارد", + "prev": "قبلی", + "ask": "فروش", + "bid": "خرید", + "to": "تا", "submit": "ثبت", "username": "نام کاربری", "password": "رمز ورود", @@ -44,14 +49,21 @@ "noTx": "تراکنشی وجود ندارد.", "close": "بستن", "unit": "واحد", + "from": "از", + "row": "ردیف", + "until": "تا", + "withPrice": "با قیمت", + "description": "توضیحات", + "first": "ابتدا", "offline": "اتصال اینترنت را بررسی کنید!", - "improperMobileView ": "فعلاً برای موبایل بهینه نشده است.", + "improperMobileView": "فعلاً برای موبایل بهینه نشده است.", "home": "صفحه اصلی", "country": { - "iran" : "جمهوری اسلامی ایران", - "germany" : "آلمان", + "iran": "ایران", + "germany": "آلمان", "uk": "انگلستان", - "turkey" : "ترکیه" + "turkey": "ترکیه", + "uzbekistan": "ازبکستان" }, "currency": { "IRT": "تومان", @@ -144,6 +156,9 @@ "technical": { "title": "تکنیکال" }, + "txHistory": { + "title": "تاریخچه تراکنش‌ ها" + }, "messages": { "title": "پیام ها" }, @@ -165,7 +180,7 @@ }, "TimeZone": { "THR": "آسیا / تهران / UTC+3:30", - "UTC" : 0 + "UTC": 0 }, "orders": { "title": "سفارش", @@ -227,6 +242,21 @@ "showZeroBalance": "عدم نمایش موجودی صفر", "estimateAlert": "مبلغ دارایی معادل براساس بالاترین پیشنهاد خرید محاسبه شده" }, + "TransactionHistory": { + "coin" : "ارز", + "category" : "نوع تراکنش", + "size" : "تعداد", + "period" : "بازه زمانی" + }, + "TransactionCategory": { + "DEPOSIT" : "واریز", + "FEE" : "کارمزد", + "TRADE" : "معامله", + "WITHDRAW" : "برداشت", + "ORDER_CANCEL" : "لغو سفارش", + "ORDER_CREATE" : "ثبت سفارش", + "ORDER_FINALIZED" : "اتمام سفارش" + }, "DepositWithdraw": { "title": "واریز/برداشت", "success": "آدرس کپی شد", @@ -618,10 +648,10 @@ "tooManyFiles": "آپلود بیشتر از یک عکس مجاز نیست!", "errorMsgDefault": "عکس آپلود شده معتبر نیست!" }, - "errorPage" : { - "needKYC" : "دسترسی این بخش فقط برای کاربران احراز هویت شده مجاز است!", - "reload" : "تلاش مجدد", - "errorText" : "خطا در ارتباط با سرور" + "errorPage": { + "needKYC": "دسترسی این بخش فقط برای کاربران احراز هویت شده مجاز است!", + "reload": "تلاش مجدد", + "errorText": "خطا در ارتباط با سرور" }, "aboutUs": { "title": "درباره ما", @@ -663,7 +693,6 @@ "p8": "", "p9": "", "text4": "" - }, "transferFees": { "title": "کارمزد انتقال", diff --git a/src/components/TextInput/TextInput.js b/src/components/TextInput/TextInput.js index 85fb48b0..70133167 100644 --- a/src/components/TextInput/TextInput.js +++ b/src/components/TextInput/TextInput.js @@ -2,6 +2,12 @@ import React from "react"; import Icon from "../Icon/Icon"; import Select from "react-select"; import classes from "./TextInput.module.css"; +import i18n from "../../i18n/i18n"; +import persian_fa from "react-date-object/locales/persian_fa"; +import persian from "react-date-object/calendars/persian"; +import DatePicker from "react-multi-date-picker"; +import "react-multi-date-picker/styles/backgrounds/bg-dark.css" +import {useSelector} from "react-redux"; const TextInput = (props) => { const { @@ -17,9 +23,25 @@ const TextInput = (props) => { max, ltr, info, + datePicker, ...other } = props + const isDark = useSelector((state) => state.global.isDark) + + + const optionClassHandler = (state) => { + let className = classes.selectOptions + if (state.isFocused) { + className = className + " " + classes.isFocused + } + if (state.isSelected) { + className = className + " " + classes.isSelected + } + console.log("className", className) + return className; + } + let leadSection = null let afterSection = null let alertSection = null @@ -29,6 +51,7 @@ const TextInput = (props) => { readOnly={readOnly} onChange={onchange} max={max} + className={`${classes.input}`} style={{direction: ltr && 'ltr'}} {...other} /> @@ -37,8 +60,14 @@ const TextInput = (props) => { leadSection = {lead} } + if ( select ){ inputSection =