From d7aae2ab7fabde56ba6eeec835eaed11b72b3233 Mon Sep 17 00:00:00 2001 From: Ben Allen Date: Wed, 30 Nov 2022 14:32:53 -0500 Subject: [PATCH 01/12] redesign settings page to match --- src/components/Settings.jsx | 74 ++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 38 deletions(-) diff --git a/src/components/Settings.jsx b/src/components/Settings.jsx index 4d8fae150..7176d1678 100644 --- a/src/components/Settings.jsx +++ b/src/components/Settings.jsx @@ -92,7 +92,7 @@ export default function Settings({ wallet, stopWallet }) { return (
-
{t('settings.title')}
+
{t('settings.section_title_display')}
{alert && } - - setShowingFeeConfig(true)} - > - - {t('settings.show_fee_config')} - - {showingFeeConfig && setShowingFeeConfig(false)} />} - - {showLogsEnabled && ( - <> - setShowingLogs(true)}> - - {t('settings.show_logs')} - - setShowingLogs(false)} /> - - )}
+
{t('settings.section_title_market')}
+ setShowingFeeConfig(true)}> + + {t('settings.show_fee_config')} + + {showingFeeConfig && setShowingFeeConfig(false)} />} + {showLogsEnabled && ( + <> + setShowingLogs(true)}> + + {t('settings.show_logs')} + + setShowingLogs(false)} /> + + )}
{t('settings.section_title_wallet')}
setShowingSeed(true)}> @@ -233,23 +228,6 @@ export default function Settings({ wallet, stopWallet }) {
{t('settings.section_title_community')}
+
{t('settings.section_title_dev')}
+
) From a22530e6a22001e835cc831aa5ecd9d3255b02d7 Mon Sep 17 00:00:00 2001 From: Ben Allen Date: Wed, 30 Nov 2022 14:33:27 -0500 Subject: [PATCH 02/12] add tests to match new settings page format --- src/components/Settings.test.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/Settings.test.jsx b/src/components/Settings.test.jsx index 20aaa4fab..a92bca005 100644 --- a/src/components/Settings.test.jsx +++ b/src/components/Settings.test.jsx @@ -26,7 +26,7 @@ describe('', () => { }) ) - expect(screen.getByText('settings.title')).toBeVisible() + expect(screen.getByText('settings.section_title_display')).toBeVisible() expect(screen.queryByText(/settings.(show|hide)_balance/)).toBeVisible() expect(screen.queryByText(/settings.use_(sats|bitcoin)/)).toBeVisible() expect(screen.queryByText(/settings.use_(dark|light)_theme/)).toBeVisible() @@ -37,8 +37,11 @@ describe('', () => { expect(screen.queryByText(/settings.button_switch_wallet/)).toBeVisible() expect(screen.getByText('settings.section_title_community')).toBeVisible() - expect(screen.queryByText(/settings.github/)).toBeVisible() expect(screen.queryByText(/settings.telegram/)).toBeVisible() expect(screen.queryByText(/settings.jm_twitter/)).toBeVisible() + + expect(screen.getByText('settings.section_title_community')).toBeVisible() + expect(screnn.queryByText(/settings.documentation/)).toBeVisible() + expect(screen.queryByText(/settings.github/)).toBeVisible() }) }) From 4a1cf2fdeaadf01975f54c2c9b0983c85695e159 Mon Sep 17 00:00:00 2001 From: Ben Allen Date: Wed, 30 Nov 2022 14:34:19 -0500 Subject: [PATCH 03/12] add translations to match settings page format --- src/i18n/locales/en/translation.json | 4 ++- src/i18n/locales/fr/translation.json | 54 ++++++++++++++++++++++++++-- 2 files changed, 55 insertions(+), 3 deletions(-) diff --git a/src/i18n/locales/en/translation.json b/src/i18n/locales/en/translation.json index 5a73bfaac..ef4f100df 100644 --- a/src/i18n/locales/en/translation.json +++ b/src/i18n/locales/en/translation.json @@ -140,9 +140,11 @@ "account_heading_internal_addresses": "Internal Addresses" }, "settings": { - "title": "Settings", + "section_title_display": "Display", + "section_title_market": "Market", "section_title_wallet": "Wallet", "section_title_community": "Community", + "section_title_dev": "Development & Documentation", "show_balance": "Show balance", "hide_balance": "Hide balance", "use_sats": "Display amounts in sats", diff --git a/src/i18n/locales/fr/translation.json b/src/i18n/locales/fr/translation.json index 5e5cfc094..136e6c218 100644 --- a/src/i18n/locales/fr/translation.json +++ b/src/i18n/locales/fr/translation.json @@ -131,7 +131,11 @@ "account_heading_internal_addresses": "Adresses internes" }, "settings": { - "title": "Paramètres", + "section_title_display": "Écran", + "section_title_market": "Marché", + "section_title_wallet": "Portefeuille", + "section_title_community": "Communauté", + "section_title_dev": "Développement & Documentation", "show_balance": "Afficher le solde", "hide_balance": "Cacher le solde", "use_sats": "Afficher les montants en sats", @@ -144,9 +148,55 @@ "show_seed": "Afficher la phrase graine", "hide_seed": "Cacher la phrase graine", "reveal_seed": "Révéler la phrase graine", + "show_logs": "Afficher les journaux", + "show_fee_config": "Ajuster les limites de frais", + "button_lock_wallet": "Verrouiller le Portefeuille", + "button_locking_wallet": "Verrouillant...", + "button_create_wallet": "Créer un nouveau portefeuille", "button_switch_wallet": "Changer de porte-monnaie", "error_loading_seed_failed": "Impossible de récupérer la phrase graine.", - "seed_modal_info_text": "Veuillez noter votre phrase graine et votre mot de passe ! Sans ces informations, vous ne serez pas en mesure d'accéder à votre portefeuille !" + "seed_modal_info_text": "Veuillez noter votre phrase graine et votre mot de passe ! Sans ces informations, vous ne serez pas en mesure d'accéder à votre portefeuille !", + "documentation": "Documentation", + "github": "GitHub", + "matrix": "Matrix", + "telegram": "Telegram", + "jm_twitter": "JoinMarket Twitter", + "jam_twitter": "Jam Twitter", + "confirm_locking_modal_title": "Verrouiller le Portefeuille", + "confirm_locking_modal_body_earn": "Earn is active. Locking the wallet will stop the service. You can close the browser window to let it run in the background.", + "confirm_locking_modal_body_jam": "A collaborative transaction is being executed. Locking the wallet will stop the service. You can close the browser window to let it run in the background.", + "fees": { + "title": "Fee Limits", + "description": "Adjust mining fees and collaborator fees according to your needs. Mining fees relate to transaction priority and depend on mempool conditions. Collaborator fees relate to liquidity price and depend on market conditions. Total fees paid for each transaction depend on the amount of collaborators. Additional collaborators increase privacy, but also fees. These settings will be reset to default values when the JoinMarket service restarts, e.g. on a system reboot. For more information, <1>see the documentation on fees.", + "title_general_fee_settings": "Mining fees", + "radio_tx_fees_blocks": "Block target", + "radio_tx_fees_satspervbyte": "sats/vByte", + "label_tx_fees": "Transaction base fee", + "description_tx_fees_blocks": "When using the block target setting, Jam will use Bitcoin Core's fee estimation mechanism to set the base fee dynamically, depending on mempool activity. Default: 3.", + "description_tx_fees_satspervbyte": "Setting the base fee in sats/vByte will override the block target setting. Check your mempool to set this fee accordingly.", + "feedback_invalid_tx_fees_blocks": "Please provide a valid block target between {{ min }} and {{ max }}.", + "feedback_invalid_tx_fees_satspervbyte": "Please provide a valid transaction fee in sats/vByte between {{ min }} and {{ max }}.", + "label_tx_fees_factor": "Fee randomization", + "description_tx_fees_factor": "Random fees improve privacy. The percentage is to be understood as a +/- around the base fee. Example: If you set the base fee to 10 sats/vByte and the randomization to 30%, a value between 7 and 13 sats/vByte will be used. Default: 20%.", + "feedback_invalid_tx_fees_factor": "Please provide a valid fee randomization value between {{ min }} and {{ max }}.", + "title_max_cj_fee_settings": "Collaborator fees", + "subtitle_max_cj_fee": "Note: An offer will be rejected only if both limits are exceeded.", + "label_max_cj_fee_abs": "Absolute limit (per collaborator)", + "description_max_cj_fee_abs": "The maximum fee you are willing to pay per collaborator. Example: when set to 3,000 sats, the maximum fee in total would be 27,000 sats when using the default of 9 collaborators.", + "feedback_invalid_max_cj_fee_abs": "Please provide a valid maximum absolute fee in sats between {{ min }} and {{ max }}.", + "label_max_cj_fee_rel": "Relative limit (per collaborator)", + "description_max_cj_fee_rel": "The maximum fee you are willing to pay per collaborator, as a percentage of the transaction amount. Example: if you send 2 million sats and the maximum fee is set to 0.1%, you will at most pay 2,000 sats to a single collaborator.", + "feedback_invalid_max_cj_fee_rel": "Please provide a valid maximum relative fee between {{ min }} and {{ max }}.", + "text_button_cancel": "Annuler", + "text_button_submit": "Sauvegarder", + "text_button_submitting": "Sauvant...", + "error_loading_fee_config_failed": "Error while loading fee config values. ", + "error_saving_fee_config_failed": "Error while saving fee config values. Reason: {{ reason }}" + } + }, + "logs": { + "title": "Logs", + "error_loading_logs_failed": "Could not retrieve log file." }, "send": { "loading": "Chargement", From 1d67e85c43bca1528317ea2fb52b872cc662d7c2 Mon Sep 17 00:00:00 2001 From: Ben Allen Date: Wed, 30 Nov 2022 14:51:46 -0500 Subject: [PATCH 04/12] add languages and flags together --- src/components/Settings.jsx | 2 +- src/i18n/languages.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Settings.jsx b/src/components/Settings.jsx index 7176d1678..9e0585b61 100644 --- a/src/components/Settings.jsx +++ b/src/components/Settings.jsx @@ -148,7 +148,7 @@ export default function Settings({ wallet, stopWallet }) { {languages.map((lng, index) => { return ( i18n.changeLanguage(lng.key)}> - {lng.description} + {lng.description} {lng.flag} ) })} diff --git a/src/i18n/languages.js b/src/i18n/languages.js index 463edcedd..a965728e0 100644 --- a/src/i18n/languages.js +++ b/src/i18n/languages.js @@ -5,11 +5,13 @@ const languages = [ { key: 'en', description: 'English', + flag: '🇺🇸', translation: en, }, { key: 'fr', description: 'Français', + flag: '🇫🇷', translation: fr, }, ] From d6773d3a99f6a884f249af63143ab515d4113dfa Mon Sep 17 00:00:00 2001 From: Ben Allen Date: Wed, 30 Nov 2022 14:52:27 -0500 Subject: [PATCH 05/12] fix capitalization --- src/i18n/locales/fr/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/locales/fr/translation.json b/src/i18n/locales/fr/translation.json index 136e6c218..3a1acb8a4 100644 --- a/src/i18n/locales/fr/translation.json +++ b/src/i18n/locales/fr/translation.json @@ -150,7 +150,7 @@ "reveal_seed": "Révéler la phrase graine", "show_logs": "Afficher les journaux", "show_fee_config": "Ajuster les limites de frais", - "button_lock_wallet": "Verrouiller le Portefeuille", + "button_lock_wallet": "Verrouiller le portefeuille", "button_locking_wallet": "Verrouillant...", "button_create_wallet": "Créer un nouveau portefeuille", "button_switch_wallet": "Changer de porte-monnaie", From f401118847d8a576ca4f811304912e95661a26ed Mon Sep 17 00:00:00 2001 From: Ben Allen <108441023+benalleng@users.noreply.github.com> Date: Thu, 1 Dec 2022 10:00:17 -0500 Subject: [PATCH 06/12] Update README.md --- src/i18n/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/i18n/README.md b/src/i18n/README.md index 5ac86ceaf..5acd24a99 100644 --- a/src/i18n/README.md +++ b/src/i18n/README.md @@ -67,11 +67,13 @@ const languages = [ { key: 'en', description: 'English', + flag: '🇺🇸', translation: en, }, { key: 'de', description: 'Deutsch', + flag: '🇩🇪', translation: de, }, ] From 8f49abe5f38e835871b82ed6a4ad060539a0bfba Mon Sep 17 00:00:00 2001 From: Ben Allen Date: Fri, 2 Dec 2022 10:23:02 -0500 Subject: [PATCH 07/12] remove flag key --- src/i18n/languages.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/i18n/languages.js b/src/i18n/languages.js index a965728e0..463edcedd 100644 --- a/src/i18n/languages.js +++ b/src/i18n/languages.js @@ -5,13 +5,11 @@ const languages = [ { key: 'en', description: 'English', - flag: '🇺🇸', translation: en, }, { key: 'fr', description: 'Français', - flag: '🇫🇷', translation: fr, }, ] From 1fdd45a7fc768c539f99c1c0660850d6b649b3c7 Mon Sep 17 00:00:00 2001 From: Ben Allen Date: Fri, 2 Dec 2022 10:23:32 -0500 Subject: [PATCH 08/12] remove english that already has a fallback --- src/i18n/locales/fr/translation.json | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/i18n/locales/fr/translation.json b/src/i18n/locales/fr/translation.json index 3a1acb8a4..f34b75497 100644 --- a/src/i18n/locales/fr/translation.json +++ b/src/i18n/locales/fr/translation.json @@ -166,27 +166,6 @@ "confirm_locking_modal_body_earn": "Earn is active. Locking the wallet will stop the service. You can close the browser window to let it run in the background.", "confirm_locking_modal_body_jam": "A collaborative transaction is being executed. Locking the wallet will stop the service. You can close the browser window to let it run in the background.", "fees": { - "title": "Fee Limits", - "description": "Adjust mining fees and collaborator fees according to your needs. Mining fees relate to transaction priority and depend on mempool conditions. Collaborator fees relate to liquidity price and depend on market conditions. Total fees paid for each transaction depend on the amount of collaborators. Additional collaborators increase privacy, but also fees. These settings will be reset to default values when the JoinMarket service restarts, e.g. on a system reboot. For more information, <1>see the documentation on fees.", - "title_general_fee_settings": "Mining fees", - "radio_tx_fees_blocks": "Block target", - "radio_tx_fees_satspervbyte": "sats/vByte", - "label_tx_fees": "Transaction base fee", - "description_tx_fees_blocks": "When using the block target setting, Jam will use Bitcoin Core's fee estimation mechanism to set the base fee dynamically, depending on mempool activity. Default: 3.", - "description_tx_fees_satspervbyte": "Setting the base fee in sats/vByte will override the block target setting. Check your mempool to set this fee accordingly.", - "feedback_invalid_tx_fees_blocks": "Please provide a valid block target between {{ min }} and {{ max }}.", - "feedback_invalid_tx_fees_satspervbyte": "Please provide a valid transaction fee in sats/vByte between {{ min }} and {{ max }}.", - "label_tx_fees_factor": "Fee randomization", - "description_tx_fees_factor": "Random fees improve privacy. The percentage is to be understood as a +/- around the base fee. Example: If you set the base fee to 10 sats/vByte and the randomization to 30%, a value between 7 and 13 sats/vByte will be used. Default: 20%.", - "feedback_invalid_tx_fees_factor": "Please provide a valid fee randomization value between {{ min }} and {{ max }}.", - "title_max_cj_fee_settings": "Collaborator fees", - "subtitle_max_cj_fee": "Note: An offer will be rejected only if both limits are exceeded.", - "label_max_cj_fee_abs": "Absolute limit (per collaborator)", - "description_max_cj_fee_abs": "The maximum fee you are willing to pay per collaborator. Example: when set to 3,000 sats, the maximum fee in total would be 27,000 sats when using the default of 9 collaborators.", - "feedback_invalid_max_cj_fee_abs": "Please provide a valid maximum absolute fee in sats between {{ min }} and {{ max }}.", - "label_max_cj_fee_rel": "Relative limit (per collaborator)", - "description_max_cj_fee_rel": "The maximum fee you are willing to pay per collaborator, as a percentage of the transaction amount. Example: if you send 2 million sats and the maximum fee is set to 0.1%, you will at most pay 2,000 sats to a single collaborator.", - "feedback_invalid_max_cj_fee_rel": "Please provide a valid maximum relative fee between {{ min }} and {{ max }}.", "text_button_cancel": "Annuler", "text_button_submit": "Sauvegarder", "text_button_submitting": "Sauvant...", From fe82f983eeb30eeb9b47b18090d0c004b7cf9bed Mon Sep 17 00:00:00 2001 From: Ben Allen Date: Fri, 2 Dec 2022 10:24:23 -0500 Subject: [PATCH 09/12] remove flag component --- src/components/Settings.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Settings.jsx b/src/components/Settings.jsx index 9e0585b61..7176d1678 100644 --- a/src/components/Settings.jsx +++ b/src/components/Settings.jsx @@ -148,7 +148,7 @@ export default function Settings({ wallet, stopWallet }) { {languages.map((lng, index) => { return ( i18n.changeLanguage(lng.key)}> - {lng.description} {lng.flag} + {lng.description} ) })} From d6bdf8234c21c79a4398eda8a9117bd999fc8ed4 Mon Sep 17 00:00:00 2001 From: Ben Allen Date: Fri, 2 Dec 2022 10:25:35 -0500 Subject: [PATCH 10/12] remove flags from README --- src/i18n/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/i18n/README.md b/src/i18n/README.md index 5acd24a99..5ac86ceaf 100644 --- a/src/i18n/README.md +++ b/src/i18n/README.md @@ -67,13 +67,11 @@ const languages = [ { key: 'en', description: 'English', - flag: '🇺🇸', translation: en, }, { key: 'de', description: 'Deutsch', - flag: '🇩🇪', translation: de, }, ] From f4a6a97d3966408ad5395f24c9e9a319af6b68be Mon Sep 17 00:00:00 2001 From: Thebora Kompanioni Date: Sat, 3 Dec 2022 13:20:00 +0100 Subject: [PATCH 11/12] Update src/i18n/locales/fr/translation.json --- src/i18n/locales/fr/translation.json | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/i18n/locales/fr/translation.json b/src/i18n/locales/fr/translation.json index f34b75497..21056ad94 100644 --- a/src/i18n/locales/fr/translation.json +++ b/src/i18n/locales/fr/translation.json @@ -163,20 +163,12 @@ "jm_twitter": "JoinMarket Twitter", "jam_twitter": "Jam Twitter", "confirm_locking_modal_title": "Verrouiller le Portefeuille", - "confirm_locking_modal_body_earn": "Earn is active. Locking the wallet will stop the service. You can close the browser window to let it run in the background.", - "confirm_locking_modal_body_jam": "A collaborative transaction is being executed. Locking the wallet will stop the service. You can close the browser window to let it run in the background.", "fees": { "text_button_cancel": "Annuler", "text_button_submit": "Sauvegarder", - "text_button_submitting": "Sauvant...", - "error_loading_fee_config_failed": "Error while loading fee config values. ", - "error_saving_fee_config_failed": "Error while saving fee config values. Reason: {{ reason }}" + "text_button_submitting": "Sauvant..." } }, - "logs": { - "title": "Logs", - "error_loading_logs_failed": "Could not retrieve log file." - }, "send": { "loading": "Chargement", "title": "Envoyer du bitcoin", From 31079357356bba4ea2af94155830b2bba8d2961f Mon Sep 17 00:00:00 2001 From: Thebora Kompanioni Date: Sat, 3 Dec 2022 13:20:09 +0100 Subject: [PATCH 12/12] Update src/components/Settings.test.jsx --- src/components/Settings.test.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Settings.test.jsx b/src/components/Settings.test.jsx index a92bca005..a40fdef58 100644 --- a/src/components/Settings.test.jsx +++ b/src/components/Settings.test.jsx @@ -41,7 +41,7 @@ describe('', () => { expect(screen.queryByText(/settings.jm_twitter/)).toBeVisible() expect(screen.getByText('settings.section_title_community')).toBeVisible() - expect(screnn.queryByText(/settings.documentation/)).toBeVisible() + expect(screen.queryByText(/settings.documentation/)).toBeVisible() expect(screen.queryByText(/settings.github/)).toBeVisible() }) })