diff --git a/.github/workflows/sync-translations.yml b/.github/workflows/sync-translations.yml new file mode 100644 index 00000000..62ac7ed1 --- /dev/null +++ b/.github/workflows/sync-translations.yml @@ -0,0 +1,25 @@ +name: Sync translations + +on: + push: + branches: + - 'master' + +jobs: + sync_translations: + runs-on: ubuntu-latest + steps: + - name: Checkout to master branch + uses: actions/checkout@v3 + + - name: Sync translations + uses: deriv-com/translations/.github/actions/extract_and_sync_translations@main + with: + PROJECT_NAME: ${{ env.VITE_PROJECT_NAME }} + CROWDIN_BRANCH_NAME: ${{ env.VITE_CROWDIN_BRANCH_NAME }} + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }} + R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} + R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} + R2_BUCKET_NAME: ${{ secrets.R2_BUCKET_NAME }} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 7e95b176..65af85c4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "@babel/preset-env": "^7.24.5", "@deriv-com/api-hooks": "^0.1.19", + "@deriv-com/translations": "^1.2.0", "@deriv-com/ui": "latest", "@deriv-com/utils": "latest", "@deriv/deriv-api": "^1.0.15", @@ -2652,6 +2653,68 @@ "eslint-webpack-plugin": "^4.0.1" } }, + "node_modules/@deriv-com/translations": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@deriv-com/translations/-/translations-1.2.0.tgz", + "integrity": "sha512-iRM0Nv8eJjlauGhmIvHtX/ZGP5A6X4TFQvJWTwuSBn4xdVaEJ5s8aCdebNYYI24ITw6mKKxy2RzLjrc5cDcGAA==", + "dependencies": { + "@xmldom/xmldom": "^0.8.10", + "commander": "^12.0.0", + "crc-32": "^1.2.2", + "glob": "^10.3.12" + }, + "bin": { + "deriv-extract-translations": "dist/deriv-extract-translations.cjs" + }, + "optionalDependencies": { + "@rollup/rollup-linux-x64-gnu": "^4.17.1" + }, + "peerDependencies": { + "react": "^17.x || ^18.x", + "react-dom": "^17.x || ^18.x" + } + }, + "node_modules/@deriv-com/translations/node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.17.2.tgz", + "integrity": "sha512-Hy7pLwByUOuyaFC6mAr7m+oMC+V7qyifzs/nW2OJfC8H4hbCzOX07Ov0VFk/zP3kBsELWNFi7rJtgbKYsav9QQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@deriv-com/translations/node_modules/commander": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.0.0.tgz", + "integrity": "sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA==", + "engines": { + "node": ">=18" + } + }, + "node_modules/@deriv-com/translations/node_modules/glob": { + "version": "10.3.12", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.12.tgz", + "integrity": "sha512-TCNv8vJ+xz4QiqTpfOJA7HvYv+tNIRHKfUWw/q+v2jdgN4ebz+KY9tGx5J4rHP0o84mNP+ApH66HRX8us3Khqg==", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.6", + "minimatch": "^9.0.1", + "minipass": "^7.0.4", + "path-scurry": "^1.10.2" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@deriv-com/ui": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/@deriv-com/ui/-/ui-1.14.1.tgz", @@ -3268,7 +3331,6 @@ "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dev": true, "dependencies": { "string-width": "^5.1.2", "string-width-cjs": "npm:string-width@^4.2.0", @@ -3285,7 +3347,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, "engines": { "node": ">=12" }, @@ -3297,7 +3358,6 @@ "version": "6.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, "engines": { "node": ">=12" }, @@ -3308,14 +3368,12 @@ "node_modules/@isaacs/cliui/node_modules/emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, "node_modules/@isaacs/cliui/node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -3332,7 +3390,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, "dependencies": { "ansi-regex": "^6.0.1" }, @@ -3347,7 +3404,6 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", @@ -4193,7 +4249,6 @@ "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "dev": true, "optional": true, "engines": { "node": ">=14" @@ -6275,6 +6330,14 @@ "@xtuc/long": "4.2.2" } }, + "node_modules/@xmldom/xmldom": { + "version": "0.8.10", + "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.10.tgz", + "integrity": "sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==", + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -6446,7 +6509,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, "engines": { "node": ">=8" } @@ -7051,7 +7113,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0" } @@ -7674,6 +7735,17 @@ "typescript": ">=4" } }, + "node_modules/crc-32": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", + "bin": { + "crc32": "bin/crc32.njs" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/create-jest": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", @@ -7775,7 +7847,6 @@ "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -8586,8 +8657,7 @@ "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, "node_modules/electron-to-chromium": { "version": "1.4.738", @@ -8609,8 +8679,7 @@ "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/end-of-stream": { "version": "1.4.4", @@ -10708,7 +10777,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", - "dev": true, "dependencies": { "cross-spawn": "^7.0.0", "signal-exit": "^4.0.1" @@ -10724,7 +10792,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, "engines": { "node": ">=14" }, @@ -11806,7 +11873,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, "engines": { "node": ">=8" } @@ -12128,8 +12194,7 @@ "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, "node_modules/istanbul-lib-coverage": { "version": "3.2.2", @@ -12268,7 +12333,6 @@ "version": "2.3.6", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", - "dev": true, "dependencies": { "@isaacs/cliui": "^8.0.2" }, @@ -15300,7 +15364,6 @@ "version": "9.0.3", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", - "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, @@ -15338,7 +15401,6 @@ "version": "7.0.4", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", - "dev": true, "engines": { "node": ">=16 || 14 >=14.17" } @@ -15914,7 +15976,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, "engines": { "node": ">=8" } @@ -15928,7 +15989,6 @@ "version": "1.10.2", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.2.tgz", "integrity": "sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA==", - "dev": true, "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" @@ -15944,7 +16004,6 @@ "version": "10.2.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", - "dev": true, "engines": { "node": "14 || >=16.14" } @@ -17722,7 +17781,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -17734,7 +17792,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, "engines": { "node": ">=8" } @@ -18006,7 +18063,6 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -18021,7 +18077,6 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -18137,7 +18192,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -18150,7 +18204,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -20500,7 +20553,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "dependencies": { "isexe": "^2.0.0" }, @@ -20631,7 +20683,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -20648,7 +20699,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -20663,7 +20713,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -20674,8 +20723,7 @@ "node_modules/wrap-ansi-cjs/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "node_modules/wrap-ansi/node_modules/ansi-styles": { "version": "4.3.0", @@ -22597,6 +22645,43 @@ "dev": true, "requires": {} }, + "@deriv-com/translations": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@deriv-com/translations/-/translations-1.2.0.tgz", + "integrity": "sha512-iRM0Nv8eJjlauGhmIvHtX/ZGP5A6X4TFQvJWTwuSBn4xdVaEJ5s8aCdebNYYI24ITw6mKKxy2RzLjrc5cDcGAA==", + "requires": { + "@rollup/rollup-linux-x64-gnu": "^4.17.1", + "@xmldom/xmldom": "^0.8.10", + "commander": "^12.0.0", + "crc-32": "^1.2.2", + "glob": "^10.3.12" + }, + "dependencies": { + "@rollup/rollup-linux-x64-gnu": { + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.17.2.tgz", + "integrity": "sha512-Hy7pLwByUOuyaFC6mAr7m+oMC+V7qyifzs/nW2OJfC8H4hbCzOX07Ov0VFk/zP3kBsELWNFi7rJtgbKYsav9QQ==", + "optional": true + }, + "commander": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.0.0.tgz", + "integrity": "sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA==" + }, + "glob": { + "version": "10.3.12", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.12.tgz", + "integrity": "sha512-TCNv8vJ+xz4QiqTpfOJA7HvYv+tNIRHKfUWw/q+v2jdgN4ebz+KY9tGx5J4rHP0o84mNP+ApH66HRX8us3Khqg==", + "requires": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.6", + "minimatch": "^9.0.1", + "minipass": "^7.0.4", + "path-scurry": "^1.10.2" + } + } + } + }, "@deriv-com/ui": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/@deriv-com/ui/-/ui-1.14.1.tgz", @@ -22934,7 +23019,6 @@ "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dev": true, "requires": { "string-width": "^5.1.2", "string-width-cjs": "npm:string-width@^4.2.0", @@ -22947,26 +23031,22 @@ "ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==" }, "ansi-styles": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==" }, "emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, "string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, "requires": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -22977,7 +23057,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, "requires": { "ansi-regex": "^6.0.1" } @@ -22986,7 +23065,6 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, "requires": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", @@ -23628,7 +23706,6 @@ "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "dev": true, "optional": true }, "@pkgr/core": { @@ -25088,6 +25165,11 @@ "@xtuc/long": "4.2.2" } }, + "@xmldom/xmldom": { + "version": "0.8.10", + "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.10.tgz", + "integrity": "sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==" + }, "@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -25214,8 +25296,7 @@ "ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, "ansi-styles": { "version": "3.2.1", @@ -25653,7 +25734,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, "requires": { "balanced-match": "^1.0.0" } @@ -26093,6 +26173,11 @@ "dev": true, "requires": {} }, + "crc-32": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==" + }, "create-jest": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", @@ -26169,7 +26254,6 @@ "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, "requires": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -26818,8 +26902,7 @@ "eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, "electron-to-chromium": { "version": "1.4.738", @@ -26835,8 +26918,7 @@ "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "end-of-stream": { "version": "1.4.4", @@ -28358,7 +28440,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", - "dev": true, "requires": { "cross-spawn": "^7.0.0", "signal-exit": "^4.0.1" @@ -28367,8 +28448,7 @@ "signal-exit": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==" } } }, @@ -29132,8 +29212,7 @@ "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" }, "is-generator-fn": { "version": "2.1.0", @@ -29337,8 +29416,7 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, "istanbul-lib-coverage": { "version": "3.2.2", @@ -29451,7 +29529,6 @@ "version": "2.3.6", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", - "dev": true, "requires": { "@isaacs/cliui": "^8.0.2", "@pkgjs/parseargs": "^0.11.0" @@ -31721,7 +31798,6 @@ "version": "9.0.3", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", - "dev": true, "requires": { "brace-expansion": "^2.0.1" } @@ -31746,8 +31822,7 @@ "minipass": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", - "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", - "dev": true + "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==" }, "mlly": { "version": "1.6.1", @@ -32172,8 +32247,7 @@ "path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" }, "path-parse": { "version": "1.0.7", @@ -32184,7 +32258,6 @@ "version": "1.10.2", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.2.tgz", "integrity": "sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA==", - "dev": true, "requires": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" @@ -32193,8 +32266,7 @@ "lru-cache": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", - "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", - "dev": true + "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==" } } }, @@ -33416,7 +33488,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, "requires": { "shebang-regex": "^3.0.0" } @@ -33424,8 +33495,7 @@ "shebang-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" }, "side-channel": { "version": "1.0.6", @@ -33653,7 +33723,6 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -33664,7 +33733,6 @@ "version": "npm:string-width@4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -33752,7 +33820,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "requires": { "ansi-regex": "^5.0.1" } @@ -33761,7 +33828,6 @@ "version": "npm:strip-ansi@6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "requires": { "ansi-regex": "^5.0.1" } @@ -35430,7 +35496,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "requires": { "isexe": "^2.0.0" } @@ -35547,7 +35612,6 @@ "version": "npm:wrap-ansi@7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, "requires": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -35558,7 +35622,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, "requires": { "color-convert": "^2.0.1" } @@ -35567,7 +35630,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, "requires": { "color-name": "~1.1.4" } @@ -35575,8 +35637,7 @@ "color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" } } }, diff --git a/package.json b/package.json index b4fa7a14..24a7a526 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "dependencies": { "@babel/preset-env": "^7.24.5", "@deriv-com/api-hooks": "^0.1.19", + "@deriv-com/translations": "^1.2.0", "@deriv-com/ui": "latest", "@deriv-com/utils": "latest", "@deriv/deriv-api": "^1.0.15", diff --git a/src/App.tsx b/src/App.tsx index 7bd43c23..6c73e726 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,14 +2,22 @@ import { BrowserRouter } from 'react-router-dom'; import { QueryParamProvider } from 'use-query-params'; import { ReactRouter5Adapter } from 'use-query-params/adapters/react-router-5'; import { Header } from '@/components'; +import { initializeI18n, TranslationProvider } from '@deriv-com/translations'; import AppContent from './routes/AppContent'; +//TODO: replace with ${process.env.VITE_PROJECT_NAME}/${process.env.VITE_CROWDIN_BRANCH_NAME} +const i18nInstance = initializeI18n({ + cdnUrl: `https://pub-5ce11fcb15f34c0a9ce8ba7086d16e6a.r2.dev/p2p/DP2P`, +}); + const App = () => { return ( -
- + +
+ + ); diff --git a/src/components/AdvertiserName/AdvertiserNameStats.tsx b/src/components/AdvertiserName/AdvertiserNameStats.tsx index 0c79c847..1427bda2 100644 --- a/src/components/AdvertiserName/AdvertiserNameStats.tsx +++ b/src/components/AdvertiserName/AdvertiserNameStats.tsx @@ -3,6 +3,7 @@ import { DeepPartial, TAdvertiserStats } from 'types'; import { OnlineStatusIcon, OnlineStatusLabel, StarRating } from '@/components'; import { getCurrentRoute } from '@/utils'; import { LabelPairedCircleUserSlashSmRegularIcon, LabelPairedThumbsUpSmRegularIcon } from '@deriv/quill-icons'; +import { Localize } from '@deriv-com/translations'; import { Text, useDevice } from '@deriv-com/ui'; import './AdvertiserNameStats.scss'; @@ -51,7 +52,7 @@ const AdvertiserNameStats = ({ advertiserStats }: { advertiserStats: DeepPartial {!ratingAverage && (
- Not rated yet +
)} diff --git a/src/components/FlyoutMenu/FlyoutMenu.scss b/src/components/FlyoutMenu/FlyoutMenu.scss deleted file mode 100644 index 2c1fff30..00000000 --- a/src/components/FlyoutMenu/FlyoutMenu.scss +++ /dev/null @@ -1,35 +0,0 @@ -.flyout-menu { - &__list { - position: absolute; - top: 4.8rem; - right: 0; - min-width: 12.8rem; - display: flex; - flex-direction: column; - align-items: flex-start; - z-index: 2; - border-radius: 0.4rem; - background: #fff; - box-shadow: 0 3.2rem 6.4rem 0 rgba(14, 14, 14, 0.14); - overflow-y: auto; - & > li { - width: 100%; - & > * { - padding: 1rem 1.6rem; - width: 100%; - display: inline-block; - & > * { - color: #0e0e0e; - font-weight: 400; - } - &:hover { - cursor: pointer; - background-color: #e6e9e9; - & > * { - text-decoration: none; - } - } - } - } - } -} diff --git a/src/components/FlyoutMenu/FlyoutMenu.tsx b/src/components/FlyoutMenu/FlyoutMenu.tsx deleted file mode 100644 index f0bfb1c8..00000000 --- a/src/components/FlyoutMenu/FlyoutMenu.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { HTMLAttributes, ReactNode, useRef, useState } from 'react'; -import { useOnClickOutside } from 'usehooks-ts'; -import FlyoutMenuList from './FlyoutMenuList'; -import FlyoutMenuToggle from './FlyoutMenuToggle'; -import './FlyoutMenu.scss'; - -type TFlyoutMenuProps = HTMLAttributes & { - listItems?: ReactNode[]; - renderIcon?: () => ReactNode; -}; - -const FlyoutMenu = ({ listItems, renderIcon, ...props }: TFlyoutMenuProps) => { - const [isOpen, setIsOpen] = useState(false); - const flyoutMenuRef = useRef(null); - useOnClickOutside(flyoutMenuRef, () => { - setIsOpen(false); - }); - return ( -
- { - setIsOpen(!isOpen); - }} - renderIcon={renderIcon} - /> - -
- ); -}; - -export default FlyoutMenu; diff --git a/src/components/FlyoutMenu/FlyoutMenuList.tsx b/src/components/FlyoutMenu/FlyoutMenuList.tsx deleted file mode 100644 index 0c47b57e..00000000 --- a/src/components/FlyoutMenu/FlyoutMenuList.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { isValidElement, ReactNode } from 'react'; - -type TFlyoutListProps = { - isOpen?: boolean; - listItems?: ReactNode[]; -}; - -const FlyoutList = ({ isOpen = false, listItems }: TFlyoutListProps) => { - return isOpen ? ( -
    - {listItems?.map(listItem => { - return
  • {listItem}
  • ; - })} -
- ) : null; -}; - -export default FlyoutList; diff --git a/src/components/FlyoutMenu/FlyoutMenuToggle.tsx b/src/components/FlyoutMenu/FlyoutMenuToggle.tsx deleted file mode 100644 index 531be827..00000000 --- a/src/components/FlyoutMenu/FlyoutMenuToggle.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import { HTMLAttributes, ReactNode } from 'react'; - -type TFlyoutToggleProps = HTMLAttributes & { - renderIcon?: () => ReactNode; -}; - -const FlyoutToggle = ({ renderIcon, ...props }: TFlyoutToggleProps) => { - return ( -
- {renderIcon?.()} -
- ); -}; - -export default FlyoutToggle; diff --git a/src/components/FlyoutMenu/__tests__/FlyoutList.spec.tsx b/src/components/FlyoutMenu/__tests__/FlyoutList.spec.tsx deleted file mode 100644 index d38e7b02..00000000 --- a/src/components/FlyoutMenu/__tests__/FlyoutList.spec.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import FlyoutMenuList from '../FlyoutMenuList'; - -jest.mock('react', () => ({ - ...jest.requireActual('react'), - isValidElement: jest.fn().mockReturnValue((item: Record) => !!item.key), -})); - -describe('FlyoutMenuList', () => { - it('should render objects as items ', () => { - render(Item]]} />); - expect(screen.getByText('Item')).toBeInTheDocument(); - }); - it('should not render anything if isopen is not provided', () => { - render(Item]]} />); - expect(screen.queryByText('Item')).not.toBeInTheDocument(); - }); -}); diff --git a/src/components/FlyoutMenu/__tests__/FlyoutMenu.spec.tsx b/src/components/FlyoutMenu/__tests__/FlyoutMenu.spec.tsx deleted file mode 100644 index b7ca467a..00000000 --- a/src/components/FlyoutMenu/__tests__/FlyoutMenu.spec.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import userEvent from '@testing-library/user-event'; -import FlyoutMenu from '../FlyoutMenu'; - -const flyoutItems = ['item1', 'item2', 'item3']; - -describe('FlyoutMenu', () => { - it('should render the flyout menu correctly', () => { - render( 'MockIcCashierVerticalEllipsis'} />); - expect(screen.getByText('MockIcCashierVerticalEllipsis')).toBeInTheDocument(); - }); - it('should display the menu items when the icon is clicked', async () => { - render(); - await userEvent.click(screen.getByTestId('dt_flyout_toggle')); - flyoutItems.forEach(item => { - expect(screen.getByText(item)).toBeInTheDocument(); - }); - }); - it('should hide the flyout menu list when the parent is clicked', async () => { - render( -
- -
- ); - await userEvent.click(screen.getByTestId('dt_flyout_toggle')); - expect(screen.getByText(flyoutItems[0])).toBeInTheDocument(); - await userEvent.click(screen.getByTestId('dt_flyout_parent')); - expect(screen.queryByText(flyoutItems[0])).not.toBeInTheDocument(); - }); -}); diff --git a/src/components/FlyoutMenu/index.ts b/src/components/FlyoutMenu/index.ts deleted file mode 100644 index 76059bfd..00000000 --- a/src/components/FlyoutMenu/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as FlyoutMenu } from './FlyoutMenu'; diff --git a/src/components/Modals/RadioGroupFilterModal/RadioGroupFilterModal.scss b/src/components/Modals/RadioGroupFilterModal/RadioGroupFilterModal.scss index 6a647dea..d73c6cd8 100644 --- a/src/components/Modals/RadioGroupFilterModal/RadioGroupFilterModal.scss +++ b/src/components/Modals/RadioGroupFilterModal/RadioGroupFilterModal.scss @@ -38,7 +38,7 @@ width: 100%; &:first-child { - border-bottom: 1px solid var(--border-normal); + border-bottom: 1px solid #d6dadb; } } } diff --git a/src/components/Modals/ShareAdsModal/ShareAdsModal.scss b/src/components/Modals/ShareAdsModal/ShareAdsModal.scss index afe8fc3a..2efe4059 100644 --- a/src/components/Modals/ShareAdsModal/ShareAdsModal.scss +++ b/src/components/Modals/ShareAdsModal/ShareAdsModal.scss @@ -52,7 +52,7 @@ display: flex; align-items: center; border-radius: 0.3rem; - border: 0.1em solid var(--general-active); + border: 0.1em solid #d6dadb; margin-top: 2.5rem; padding: 0.8rem; @@ -60,7 +60,7 @@ display: flex; align-items: center; justify-content: center; - background: var(--general-section-5); + background: #f2f3f4; border-radius: 0.3rem; margin-left: 1rem; diff --git a/src/components/PaymentMethodCard/PaymentMethodCardBody/PaymentMethodCardBody.scss b/src/components/PaymentMethodCard/PaymentMethodCardBody/PaymentMethodCardBody.scss index 1f1ad1ab..7f291f82 100644 --- a/src/components/PaymentMethodCard/PaymentMethodCardBody/PaymentMethodCardBody.scss +++ b/src/components/PaymentMethodCard/PaymentMethodCardBody/PaymentMethodCardBody.scss @@ -2,7 +2,6 @@ &__body { display: flex; flex-direction: column; - margin-top: 0.8rem; vertical-align: baseline; } } diff --git a/src/components/PaymentMethodCard/PaymentMethodCardBody/PaymentMethodCardBody.tsx b/src/components/PaymentMethodCard/PaymentMethodCardBody/PaymentMethodCardBody.tsx index 014632b4..0e319c6b 100644 --- a/src/components/PaymentMethodCard/PaymentMethodCardBody/PaymentMethodCardBody.tsx +++ b/src/components/PaymentMethodCard/PaymentMethodCardBody/PaymentMethodCardBody.tsx @@ -16,11 +16,11 @@ const PaymentMethodCardBody = ({ const isBankOrOther = modifiedDisplayName && ['BankTransfer', 'Other'].includes(modifiedDisplayName); return (
- {isBankOrOther && !shouldShowPaymentMethodDisplayName ? null : {displayName}} - + {isBankOrOther && !shouldShowPaymentMethodDisplayName ? null : {displayName}} + {(paymentMethod.fields?.bank_name as TBankName)?.value ?? (paymentMethod.fields?.name as TName)?.value} - {(paymentMethod.fields?.account as TAccount)?.value} + {(paymentMethod.fields?.account as TAccount)?.value}
); }; diff --git a/src/components/PaymentMethodCard/PaymentMethodCardHeader/PaymentMethodCardHeader.scss b/src/components/PaymentMethodCard/PaymentMethodCardHeader/PaymentMethodCardHeader.scss index 4832d32f..dc4ba77a 100644 --- a/src/components/PaymentMethodCard/PaymentMethodCardHeader/PaymentMethodCardHeader.scss +++ b/src/components/PaymentMethodCard/PaymentMethodCardHeader/PaymentMethodCardHeader.scss @@ -8,6 +8,26 @@ justify-content: space-between; align-items: center; margin-bottom: 1.1rem; + + .deriv-dropdown { + width: 3.2rem; + + &__items { + width: 12.8rem; + border: 0; + padding: 0; + } + + .deriv-input { + border: 0; + padding: 0; + + &__field, + &__helper-message { + display: none; + } + } + } } .derivs-button__variant--ghost { color: #0e0e0e; diff --git a/src/components/PaymentMethodCard/PaymentMethodCardHeader/PaymentMethodCardHeader.tsx b/src/components/PaymentMethodCard/PaymentMethodCardHeader/PaymentMethodCardHeader.tsx index 3791937a..324e3569 100644 --- a/src/components/PaymentMethodCard/PaymentMethodCardHeader/PaymentMethodCardHeader.tsx +++ b/src/components/PaymentMethodCard/PaymentMethodCardHeader/PaymentMethodCardHeader.tsx @@ -1,7 +1,6 @@ import { THooks } from 'types'; -import { FlyoutMenu } from '@/components'; import { LabelPairedEllipsisVerticalXlRegularIcon } from '@deriv/quill-icons'; -import { Button, Checkbox } from '@deriv-com/ui'; +import { Checkbox, Dropdown } from '@deriv-com/ui'; import { ReactComponent as IcCashierBankTransfer } from '../../../public/ic-cashier-bank-transfer.svg'; import { ReactComponent as IcCashierEwallet } from '../../../public/ic-cashier-ewallet.svg'; import { ReactComponent as IcCashierOther } from '../../../public/ic-cashier-other.svg'; @@ -20,6 +19,18 @@ type TPaymentMethodCardHeaderProps = { type: THooks.AdvertiserPaymentMethods.Get[number]['type']; }; +// TODO: Remember to translate these +const actions = [ + { + text: 'Edit', + value: 'edit', + }, + { + text: 'Delete', + value: 'delete', + }, +]; + const PaymentMethodCardHeader = ({ isDisabled = false, isEditable = false, @@ -38,16 +49,7 @@ const PaymentMethodCardHeader = ({ } else if (type === 'ewallet') { Icon = IcCashierEwallet; } - // TODO: Remember to translate these - const flyoutMenuItems = [ - , - , - ]; return (
{isEditable && ( - } + } + list={actions} + name='payment-method-actions' + onSelect={value => { + if (value === 'edit') { + onEditPaymentMethod?.(); + } else if (value === 'delete') { + onDeletePaymentMethod?.(); + } + }} /> )} {isSelectable && ( diff --git a/src/components/Table/Table.scss b/src/components/Table/Table.scss index b125e4eb..f4af99f5 100644 --- a/src/components/Table/Table.scss +++ b/src/components/Table/Table.scss @@ -11,7 +11,7 @@ &-row { &:not(:last-child) { - border-bottom: 1px solid var(--general-section-1); + border-bottom: 1px solid #f2f3f4; } } } @@ -39,13 +39,13 @@ scrollbar-width: thin; display: unset; border-radius: 10px; - background-color: var(--state-active); + background-color: #d6dadb; } } &__header { display: grid; - border-bottom: 2px solid var(--general-section-1); + border-bottom: 2px solid #f2f3f4; padding: 1.6rem; } } diff --git a/src/components/index.ts b/src/components/index.ts index 12a622d2..7406e03c 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -7,7 +7,6 @@ export * from './Clipboard'; export * from './Dropdown'; export * from './FileDropzone'; export * from './FloatingRate'; -export * from './FlyoutMenu'; export * from './FormProgress'; export * from './FullPageMobileWrapper'; export * from './Header'; diff --git a/src/pages/my-ads/components/AdType/AdType.scss b/src/pages/my-ads/components/AdType/AdType.scss index 393cad26..877045fd 100644 --- a/src/pages/my-ads/components/AdType/AdType.scss +++ b/src/pages/my-ads/components/AdType/AdType.scss @@ -10,7 +10,7 @@ &__badge { align-items: center; border-radius: 0.4rem; - border: 1px solid var(--border-normal); + border: 1px solid #d6dadb; display: flex; flex-direction: row; margin: 0.3rem 0.5rem 0.3rem 0; diff --git a/src/pages/my-ads/components/ProgressIndicator/ProgressIndicator.scss b/src/pages/my-ads/components/ProgressIndicator/ProgressIndicator.scss index 5c130db4..22ed535d 100644 --- a/src/pages/my-ads/components/ProgressIndicator/ProgressIndicator.scss +++ b/src/pages/my-ads/components/ProgressIndicator/ProgressIndicator.scss @@ -13,14 +13,14 @@ } &__bar { z-index: 2; - background-color: var(--status-success); + background-color: #4bb4b3; height: 100%; position: absolute; left: 0; } &__empty { z-index: 1; - background-color: var(--general-section-1); + background-color: #f2f3f4; width: 100%; height: 100%; position: absolute; diff --git a/src/pages/my-profile/screens/MyProfile/MyProfile.scss b/src/pages/my-profile/screens/MyProfile/MyProfile.scss index 53fc76c0..297600ee 100644 --- a/src/pages/my-profile/screens/MyProfile/MyProfile.scss +++ b/src/pages/my-profile/screens/MyProfile/MyProfile.scss @@ -2,10 +2,10 @@ display: flex; flex-direction: column; padding-top: 2.4rem; + overflow-y: auto; + height: calc(100vh - 12rem); @include mobile { - overflow-y: scroll; - height: calc(100vh - 12rem); padding: 0; } diff --git a/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTable/MyProfileCounterpartiesTable.scss b/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTable/MyProfileCounterpartiesTable.scss index f4d77c0e..ccdf90bb 100644 --- a/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTable/MyProfileCounterpartiesTable.scss +++ b/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTable/MyProfileCounterpartiesTable.scss @@ -13,7 +13,7 @@ position: relative; } &:not(:last-child) { - border-bottom: 1px solid var(--general-section-1); + border-bottom: 1px solid #f2f3f4; } } } diff --git a/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTableRow/MyProfileCounterpartiesTableRow.scss b/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTableRow/MyProfileCounterpartiesTableRow.scss index 749bdc11..a691e367 100644 --- a/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTableRow/MyProfileCounterpartiesTableRow.scss +++ b/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTableRow/MyProfileCounterpartiesTableRow.scss @@ -4,7 +4,7 @@ justify-content: space-between; &:hover { - background: var(--general-hover); + background: #e6e9e9; } &__nickname-wrapper { diff --git a/src/public/ic-alert-warning.svg b/src/public/ic-alert-warning.svg deleted file mode 100644 index 7aa8d9eb..00000000 --- a/src/public/ic-alert-warning.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/public/ic-archive.svg b/src/public/ic-archive.svg deleted file mode 100644 index ab6806b2..00000000 --- a/src/public/ic-archive.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/public/ic-cashier-sort.svg b/src/public/ic-cashier-sort.svg deleted file mode 100644 index 5f5ff39c..00000000 --- a/src/public/ic-cashier-sort.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/public/ic-chat.svg b/src/public/ic-chat.svg deleted file mode 100644 index 5d5122cc..00000000 --- a/src/public/ic-chat.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/public/ic-checkmark-circle.svg b/src/public/ic-checkmark-circle.svg deleted file mode 100644 index 7149fac2..00000000 --- a/src/public/ic-checkmark-circle.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/public/ic-clipboard.svg b/src/public/ic-clipboard.svg deleted file mode 100644 index 5a157b57..00000000 --- a/src/public/ic-clipboard.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/public/ic-close-circle.svg b/src/public/ic-close-circle.svg deleted file mode 100644 index 43cf60e7..00000000 --- a/src/public/ic-close-circle.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/public/ic-delete.svg b/src/public/ic-delete.svg deleted file mode 100644 index 4f98deaa..00000000 --- a/src/public/ic-delete.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/public/ic-edit.svg b/src/public/ic-edit.svg deleted file mode 100644 index 280c57a8..00000000 --- a/src/public/ic-edit.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/public/ic-more.svg b/src/public/ic-more.svg deleted file mode 100644 index ea499ab0..00000000 --- a/src/public/ic-more.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/public/ic-share-link.svg b/src/public/ic-share-link.svg deleted file mode 100644 index d1294f4d..00000000 --- a/src/public/ic-share-link.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/public/ic-share.svg b/src/public/ic-share.svg deleted file mode 100644 index 8c19276c..00000000 --- a/src/public/ic-share.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/public/ic-thumb-up.svg b/src/public/ic-thumb-up.svg deleted file mode 100644 index bc552742..00000000 --- a/src/public/ic-thumb-up.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/public/ic-unarchive.svg b/src/public/ic-unarchive.svg deleted file mode 100644 index 105fcd1f..00000000 --- a/src/public/ic-unarchive.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/public/ic-user-blocked-outline.svg b/src/public/ic-user-blocked-outline.svg deleted file mode 100644 index c919a28a..00000000 --- a/src/public/ic-user-blocked-outline.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/public/ic-whatsapp-filled.svg b/src/public/ic-whatsapp-filled.svg deleted file mode 100644 index af15cb8e..00000000 --- a/src/public/ic-whatsapp-filled.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index b9773646..e634bb5c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,7 +19,7 @@ "noUnusedLocals": true, "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, - "types": ["@testing-library/jest-dom"], + "types": ["@testing-library/jest-dom", "node"], "paths": { "@/*": ["src/*"] }