From dba3b3b08769c41d6d89d89a06dd571e97d6115b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Zeppelin?= Date: Tue, 15 Oct 2024 11:56:59 +0200 Subject: [PATCH 1/2] Move baker intro text to translations --- .../EarningRewards/Baker/Intro/BakerIntro.tsx | 52 +++++-------------- .../popupX/pages/EarningRewards/i18n/en.ts | 16 ++++++ 2 files changed, 29 insertions(+), 39 deletions(-) diff --git a/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Baker/Intro/BakerIntro.tsx b/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Baker/Intro/BakerIntro.tsx index 4498512c..a1f81d24 100644 --- a/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Baker/Intro/BakerIntro.tsx +++ b/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Baker/Intro/BakerIntro.tsx @@ -1,55 +1,29 @@ import React from 'react'; import Carousel from '@popup/popupX/shared/Carousel'; -import { relativeRoutes } from '@popup/popupX/constants/routes'; +import { absoluteRoutes } from '@popup/popupX/constants/routes'; import { useNavigate } from 'react-router-dom'; +import Page from '@popup/popupX/shared/Page'; +import { Trans, useTranslation } from 'react-i18next'; export default function BakerIntro() { const nav = useNavigate(); + const { t } = useTranslation('x', { keyPrefix: 'earn.validator.intro' }); return ( -
-
- Become a baker -
- nav(`../${relativeRoutes.settings.earn.baker.register}`)}> + + nav(absoluteRoutes.settings.earn.baker.register.path)}> -
- A baker is a mode that participates in the network by baking (creating) new blocks that are - added to the chain. Each baker has a set of cryptographic keys called baker keys that are node - needs to bake blocks. -
-
- You generate the baker keys in the Mobile Wallet when you add a baker account. Once the baker - node has been restarted with the baker keys, it will start baking two epochs after the - transaction has been approved. -
+ +
-
- To become a baker you must run a node on the Concordium blockchain. Make sure that you have a - setup where the node can operate around the clock. -
-
- You can run the node yourself or use a third-party provider. Make sure your account in the - wallet has the required amount of CCD to become a baker. -
+ +
-
- You have the option when adding a baker to open a staking pool or not. A staking pool allows - others who want to earn rewards to do so without the need to run a node or become a baker - themselves. -
-
- To do this they delegate an amount to your staking pool which then increases your total stake - and your chances of winning the lottery to bake a block. At each pay day the rewards will be - distributed to you and your delegators. -
-
- You can also choose not to open a pool, in which case only your own stake applies toward the - lottery. You can always open or close a pool later. -
+ +
-
+ ); } diff --git a/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/i18n/en.ts b/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/i18n/en.ts index 9a368833..9871392c 100644 --- a/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/i18n/en.ts +++ b/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/i18n/en.ts @@ -38,6 +38,22 @@ const t = { }, }, }, + validator: { + intro: { + '1': { + title: 'Become a validator', + body: 'A validator is a node that participates in the network by producing new blocks that are added to the chain.\n\nEach validator has a set of cryptographic keys called validator keys that the node needs to produce blocks. You generate the validator keys when you add a validator account.\n\nOnce the validator node has been restarted with the validator keys, it will start validation two epochs after the transaction has been approved.', + }, + '2': { + title: 'The node', + body: 'To become a validator you must run a node on the Concordium blockchain. Make sure that you have a setup where the node can operate around the clock. You can run the node yourself or use a third-party provider. Make sure your account in the wallet has the required amount of CCD to become a validator.', + }, + '3': { + title: 'Opening a pool', + body: 'You have the option when adding a validator to open a staking pool or not. A staking pool allows others who want to earn rewards to do so without the need to run a node or become a validator themselves.\n\nTo do this they delegate an amount to your staking pool which then increases your total stake and your chances of winning the lottery to bake a block. At each pay day the rewards will be distributed to you and your delegators.\n\nYou can also choose not to open a pool, in which case only your own stake applies toward the lottery. You can always open or close a pool later.', + }, + }, + }, }; export default t; From ff0f2192f768f30c37867bb5846e5919f467a59f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Zeppelin?= Date: Tue, 15 Oct 2024 12:14:22 +0200 Subject: [PATCH 2/2] Align baker intro spacing with delegator intro --- .../pages/EarningRewards/Baker/Intro/BakerIntro.scss | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Baker/Intro/BakerIntro.scss b/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Baker/Intro/BakerIntro.scss index 8f03f15c..090dba05 100644 --- a/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Baker/Intro/BakerIntro.scss +++ b/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Baker/Intro/BakerIntro.scss @@ -3,16 +3,4 @@ flex-direction: column; height: 100%; padding-bottom: rem(48px); - - .capture__main_small { - display: flex; - flex-direction: column; - gap: rem(16px); - } - - .baker-intro { - &__title { - margin-bottom: rem(12px); - } - } }