diff --git a/.github/workflows/build-lint-test.yml b/.github/workflows/build-lint-test.yml index c0d7e9bda..c90b1b6bb 100644 --- a/.github/workflows/build-lint-test.yml +++ b/.github/workflows/build-lint-test.yml @@ -3,9 +3,9 @@ name: Build, lint and test on: # Triggers the workflow on push or pull request events but only for the main branch and release branches push: - branches: [main, release**, feature/**] + branches: [main, release**, feature/**, browser-ui-update] pull_request: - branches: [main, release**, feature/**] + branches: [main, release**, feature/**, browser-ui-update] # Allows us to run the workflow manually from the Actions tab workflow_dispatch: diff --git a/packages/browser-wallet/src/popup/pages/Account/TransactionLog/TransactionList.tsx b/packages/browser-wallet/src/popup/pages/Account/TransactionLog/TransactionList.tsx index bb839abc0..7ac3d11ec 100644 --- a/packages/browser-wallet/src/popup/pages/Account/TransactionLog/TransactionList.tsx +++ b/packages/browser-wallet/src/popup/pages/Account/TransactionLog/TransactionList.tsx @@ -239,7 +239,7 @@ export default function TransactionList({ onTransactionClick }: TransactionListP async function loadTransactionsDescending(address: string, appendTransactions: boolean, fromId?: number) { setIsNextPageLoading(true); - return getTransactions(address, transactionResultLimit, 'descending', fromId) + return getTransactions(address, transactionResultLimit, 'descending', { from: fromId }) .then((transactionResult) => { setHasNextPage(transactionResult.full); diff --git a/packages/browser-wallet/src/popup/popupX/constants/routes.ts b/packages/browser-wallet/src/popup/popupX/constants/routes.ts index c4eec85db..d8c7ca488 100644 --- a/packages/browser-wallet/src/popup/popupX/constants/routes.ts +++ b/packages/browser-wallet/src/popup/popupX/constants/routes.ts @@ -1,8 +1,16 @@ -type RoutePath = { +export type RouteConfig = { + hideBackArrow?: boolean; + backTitle?: string; + hideMenu?: boolean; + hideConnection?: boolean; + showAccountSelector?: boolean; +}; +export type RoutePath = { path: string; + config?: RouteConfig; }; -type RouteNode = RouteChildren & RoutePath; -type RouteChildren = { +export type RouteNode = RoutePath & RouteChildren; +export type RouteChildren = { [key: string]: RouteNode | RoutePath; }; diff --git a/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/Header.tsx b/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/Header.tsx index b9f2ca6b2..f7b0f211f 100644 --- a/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/Header.tsx +++ b/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/Header.tsx @@ -1,23 +1,18 @@ -import React, { useMemo } from 'react'; -import { useLocation } from 'react-router-dom'; +import React from 'react'; import { Connection, Fullscreen, MenuButton, MenuTiles } from '@popup/popupX/page-layouts/MainLayout/Header/components'; import clsx from 'clsx'; import AccountSelector from './components/AccountSelector'; -export default function Header({ - isScrolling, - hideMenu, - hideConnection, - menuOpen, - setMenuOpen, -}: { +type HeaderProps = { isScrolling: boolean; hideMenu: boolean; menuOpen: boolean; hideConnection: boolean; setMenuOpen: (open: boolean) => void; -}) { +}; + +export default function Header({ isScrolling, hideMenu, hideConnection, menuOpen, setMenuOpen }: HeaderProps) { return (
diff --git a/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/components/AccountButton.tsx b/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/components/AccountButton.tsx index 9a20648e3..d01085f3a 100644 --- a/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/components/AccountButton.tsx +++ b/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/components/AccountButton.tsx @@ -5,6 +5,7 @@ import UpDown from '@assets/svgX/caret-up-down.svg'; export default function AccountButton() { const [account, setAccount] = React.useState(false); return ( + // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
setAccount(!account)}> Accout 1 / 6gk...k7o diff --git a/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/components/AccountSelector.tsx b/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/components/AccountSelector.tsx index 15fba994c..f1e614f1e 100644 --- a/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/components/AccountSelector.tsx +++ b/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/components/AccountSelector.tsx @@ -1,7 +1,5 @@ import React from 'react'; -import FormInput from '@popup/popupX/shared/Form/Input'; import CarretRight from '@assets/svgX/caret-right.svg'; -import Submit from '@popup/popupX/shared/Form/Submit'; import Form from '@popup/popupX/shared/Form/Form'; import EthLogo from '@assets/svgX/eth-logo.svg'; import DnwLogo from '@assets/svgX/dnw-logo.svg'; @@ -11,7 +9,9 @@ import IconButton from '@popup/popupX/shared/IconButton'; import ArrowsUpDown from '@assets/svgX/arrows-down-up.svg'; import FormSearch from '@popup/popupX/shared/Form/Search'; -export default function AccountSelector({ showAccountSelector }) { +type Props = { showAccountSelector: boolean }; + +export default function AccountSelector({ showAccountSelector }: Props) { if (!showAccountSelector) return null; return (
@@ -25,10 +25,10 @@ export default function AccountSelector({ showAccountSelector }) { {(f) => { return ( ); }} diff --git a/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/components/Connection.tsx b/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/components/Connection.tsx index 06c3765f4..68d7e519d 100644 --- a/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/components/Connection.tsx +++ b/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/components/Connection.tsx @@ -2,7 +2,11 @@ import React from 'react'; import Info from '@assets/svgX/info.svg'; import Dot from '@assets/svgX/dot.svg'; -export default function Connection({ hideConnection }) { +type Props = { + hideConnection: boolean; +}; + +export default function Connection({ hideConnection }: Props) { if (hideConnection) return null; return (
diff --git a/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/components/MenuButton.tsx b/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/components/MenuButton.tsx index d74e95a6e..d6e50f40d 100644 --- a/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/components/MenuButton.tsx +++ b/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/components/MenuButton.tsx @@ -3,9 +3,15 @@ import DotsNine from '@assets/svgX/dots-nine.svg'; import Close from '@assets/svgX/close.svg'; import clsx from 'clsx'; +type Props = { + setMenuOpen: (open: boolean) => void; + menuOpen: boolean; + hideMenu: boolean; +}; + const background = document.getElementsByClassName('bg').item(0); -export default function MenuButton({ setMenuOpen, menuOpen, hideMenu }) { +export default function MenuButton({ setMenuOpen, menuOpen, hideMenu }: Props) { useEffect(() => { if (menuOpen) { background?.classList.add('fade-bg'); diff --git a/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/components/MenuTiles.tsx b/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/components/MenuTiles.tsx index d85a70117..327f9f949 100644 --- a/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/components/MenuTiles.tsx +++ b/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/components/MenuTiles.tsx @@ -14,13 +14,23 @@ import { Link } from 'react-router-dom'; import { relativeRoutes } from '@popup/popupX/constants/routes'; import { useTranslation } from 'react-i18next'; -export default function MenuTiles({ menuOpen, setMenuOpen }) { - const { t } = useTranslation('x', { keyPrefix: 'header.menu' }); +type MenuTilesProps = { + menuOpen: boolean; + setMenuOpen: (open: boolean) => void; +}; +export default function MenuTiles({ menuOpen, setMenuOpen }: MenuTilesProps) { + const { t } = useTranslation('x', { keyPrefix: 'header.menu' }); if (!menuOpen) return null; return (
-
setMenuOpen(false)}> + {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */} +
setMenuOpen(false)} + > diff --git a/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/components/NavButton.tsx b/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/components/NavButton.tsx index 972429f3e..fbabb9579 100644 --- a/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/components/NavButton.tsx +++ b/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/components/NavButton.tsx @@ -3,7 +3,12 @@ import { useNavigate } from 'react-router-dom'; import ArrowsLeft from '@assets/svgX/arrow-left.svg'; import clsx from 'clsx'; -export default function NavButton({ hideBackArrow, backTitle = 'to Main page' }) { +type NavButtonProps = { + hideBackArrow: boolean; + backTitle?: string; +}; + +export default function NavButton({ hideBackArrow, backTitle = 'to Main page' }: NavButtonProps) { const nav = useNavigate(); if (hideBackArrow) return null; return ( diff --git a/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/i18n/da.ts b/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/i18n/da.ts deleted file mode 100644 index d4d6c275e..000000000 --- a/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/Header/i18n/da.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type en from './en'; - -const t: typeof en = {}; - -export default t; diff --git a/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/MainLayout.tsx b/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/MainLayout.tsx index 678f50100..25f702cc6 100644 --- a/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/MainLayout.tsx +++ b/packages/browser-wallet/src/popup/popupX/page-layouts/MainLayout/MainLayout.tsx @@ -3,10 +3,15 @@ import { Outlet, useLocation } from 'react-router-dom'; import clsx from 'clsx'; import Header from '@popup/popupX/page-layouts/MainLayout/Header'; import { AccountButton, NavButton } from '@popup/popupX/page-layouts/MainLayout/Header/components'; -import { relativeRoutes } from '@popup/popupX/constants/routes'; +import { relativeRoutes, RoutePath } from '@popup/popupX/constants/routes'; -function exctractByProps(obj, props) { - return props.reduce((acc, prop) => (typeof acc === 'object' && prop in acc ? acc[prop] : undefined), obj); +function exctractByProps(obj: typeof relativeRoutes, props: string[]): RoutePath | undefined { + return props.reduce( + // FIXME: see if we can get rid of any here... + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (acc: any, prop) => (typeof acc === 'object' && prop in acc ? (acc[prop] as any) : undefined), + obj + ); } const getPageConfig = () => { @@ -20,14 +25,20 @@ export default function MainLayout() { const [scroll, setScroll] = React.useState(0); const isScrolling = useMemo(() => scroll > 0, [!!scroll]); const [menuOpen, setMenuOpen] = React.useState(false); - const { hideBackArrow, backTitle, hideMenu, hideConnection, showAccountSelector } = getPageConfig(); + const { + hideBackArrow = false, + backTitle = '', + hideMenu = false, + hideConnection = false, + showAccountSelector, + } = getPageConfig(); return (
{ - setScroll(e.target.scrollTop); + setScroll(e.currentTarget.scrollTop); }} >
diff --git a/packages/browser-wallet/src/popup/popupX/pages/About/i18n/da.ts b/packages/browser-wallet/src/popup/popupX/pages/About/i18n/da.ts deleted file mode 100644 index d4d6c275e..000000000 --- a/packages/browser-wallet/src/popup/popupX/pages/About/i18n/da.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type en from './en'; - -const t: typeof en = {}; - -export default t; diff --git a/packages/browser-wallet/src/popup/popupX/pages/Accounts/Accounts.tsx b/packages/browser-wallet/src/popup/popupX/pages/Accounts/Accounts.tsx index 1fb3b537f..7e4886367 100644 --- a/packages/browser-wallet/src/popup/popupX/pages/Accounts/Accounts.tsx +++ b/packages/browser-wallet/src/popup/popupX/pages/Accounts/Accounts.tsx @@ -1,12 +1,10 @@ import React from 'react'; -import { useNavigate } from 'react-router-dom'; import Plus from '@assets/svgX/plus.svg'; import Arrows from '@assets/svgX/arrows-down-up.svg'; import MagnifyingGlass from '@assets/svgX/magnifying-glass.svg'; import Pencil from '@assets/svgX/pencil-simple.svg'; import Copy from '@assets/svgX/copy.svg'; import ArrowRight from '@assets/svgX/arrow-right.svg'; -import { relativeRoutes } from '@popup/popupX/constants/routes'; import Page from '@popup/popupX/shared/Page'; import Button from '@popup/popupX/shared/Button'; import { useTranslation } from 'react-i18next'; @@ -36,8 +34,6 @@ const ACCOUNT_LIST = [ export default function Accounts() { const { t } = useTranslation('x', { keyPrefix: 'accounts' }); - const nav = useNavigate(); - const navToConnect = () => nav(relativeRoutes.settings.accounts.connectedSites.path); return ( diff --git a/packages/browser-wallet/src/popup/popupX/pages/Accounts/i18n/da.ts b/packages/browser-wallet/src/popup/popupX/pages/Accounts/i18n/da.ts deleted file mode 100644 index d4d6c275e..000000000 --- a/packages/browser-wallet/src/popup/popupX/pages/Accounts/i18n/da.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type en from './en'; - -const t: typeof en = {}; - -export default t; diff --git a/packages/browser-wallet/src/popup/popupX/pages/ConnectNetwork/i18n/da.ts b/packages/browser-wallet/src/popup/popupX/pages/ConnectNetwork/i18n/da.ts deleted file mode 100644 index d4d6c275e..000000000 --- a/packages/browser-wallet/src/popup/popupX/pages/ConnectNetwork/i18n/da.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type en from './en'; - -const t: typeof en = {}; - -export default t; diff --git a/packages/browser-wallet/src/popup/popupX/pages/ConnectedSites/i18n/da.ts b/packages/browser-wallet/src/popup/popupX/pages/ConnectedSites/i18n/da.ts deleted file mode 100644 index d4d6c275e..000000000 --- a/packages/browser-wallet/src/popup/popupX/pages/ConnectedSites/i18n/da.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type en from './en'; - -const t: typeof en = {}; - -export default t; diff --git a/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Baker/OpenPool/OpenPool.tsx b/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Baker/OpenPool/OpenPool.tsx index 07fd535b4..b350004a7 100644 --- a/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Baker/OpenPool/OpenPool.tsx +++ b/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Baker/OpenPool/OpenPool.tsx @@ -24,7 +24,7 @@ export default function OpenPool() { You can also keep the pool closed, if you want only your own CCDs to be stalked.
- +
); } diff --git a/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Baker/Register/RegisterBaker.tsx b/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Baker/Register/RegisterBaker.tsx index 5941b4bb3..7698bc4f5 100644 --- a/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Baker/Register/RegisterBaker.tsx +++ b/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Baker/Register/RegisterBaker.tsx @@ -39,7 +39,7 @@ export default function RegisterBaker() { balance at each pay day.
- +
); } diff --git a/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Delegator/Register/RegisterDelegator.tsx b/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Delegator/Register/RegisterDelegator.tsx index 4c33a85bd..d4d299202 100644 --- a/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Delegator/Register/RegisterDelegator.tsx +++ b/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Delegator/Register/RegisterDelegator.tsx @@ -48,7 +48,7 @@ export default function RegisterDelegator() { I want to automatically add my baking rewards to my baker stake
- +
); } diff --git a/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Delegator/Result/DelegationResult.tsx b/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Delegator/Result/DelegationResult.tsx index ffcca3cb2..e6819601b 100644 --- a/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Delegator/Result/DelegationResult.tsx +++ b/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Delegator/Result/DelegationResult.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import ExportIcon from '@assets/svgX/sign-out.svg'; import Button from '@popup/popupX/shared/Button'; export default function DelegationResult() { @@ -29,7 +28,7 @@ export default function DelegationResult() {
- +
); } diff --git a/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Delegator/Type/DelegationType.tsx b/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Delegator/Type/DelegationType.tsx index c4f680daa..76d92be93 100644 --- a/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Delegator/Type/DelegationType.tsx +++ b/packages/browser-wallet/src/popup/popupX/pages/EarningRewards/Delegator/Type/DelegationType.tsx @@ -20,7 +20,7 @@ export default function DelegationType() { passive delegation you do not have to worry about the uptime or quality of a baker node. For more info you can visit developer.concordium.software - +
); } diff --git a/packages/browser-wallet/src/popup/popupX/pages/IdCards/IdCards.tsx b/packages/browser-wallet/src/popup/popupX/pages/IdCards/IdCards.tsx index 8f14ab85d..e5787eca4 100644 --- a/packages/browser-wallet/src/popup/popupX/pages/IdCards/IdCards.tsx +++ b/packages/browser-wallet/src/popup/popupX/pages/IdCards/IdCards.tsx @@ -5,7 +5,7 @@ import Page from '@popup/popupX/shared/Page'; import { useTranslation } from 'react-i18next'; import IdCard from '@popup/popupX/shared/IdCard'; -const rowsIdInfo = [ +const rowsIdInfo: [string, string][] = [ ['Identity document type', 'Drivers licence'], ['Identity document number', 'BXM680515'], ['First name', 'Lewis'], @@ -15,7 +15,7 @@ const rowsIdInfo = [ ['ID valid until', '30 October 2051'], ]; -const rowsConnectedAccounts = [ +const rowsConnectedAccounts: [string, string][] = [ ['Accout 1 / 6gk...Fk7o', '4,227.38 USD'], ['Accout 2 / tt2...50eo', '1,195.41 USD'], ['Accout 3 / bnh...JJ76', '123.38 USD'], diff --git a/packages/browser-wallet/src/popup/popupX/pages/IdCards/i18n/da.ts b/packages/browser-wallet/src/popup/popupX/pages/IdCards/i18n/da.ts deleted file mode 100644 index d4d6c275e..000000000 --- a/packages/browser-wallet/src/popup/popupX/pages/IdCards/i18n/da.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type en from './en'; - -const t: typeof en = {}; - -export default t; diff --git a/packages/browser-wallet/src/popup/popupX/pages/MainPage/MainPage.scss b/packages/browser-wallet/src/popup/popupX/pages/MainPage/MainPage.scss index 6e820a2f9..339e36e4e 100644 --- a/packages/browser-wallet/src/popup/popupX/pages/MainPage/MainPage.scss +++ b/packages/browser-wallet/src/popup/popupX/pages/MainPage/MainPage.scss @@ -74,7 +74,8 @@ border-radius: rem(8px); background: $color-main-bg; - svg, img { + svg, + img { width: rem(20px); height: rem(20px); } diff --git a/packages/browser-wallet/src/popup/popupX/pages/MainPage/MainPage.tsx b/packages/browser-wallet/src/popup/popupX/pages/MainPage/MainPage.tsx index c32331f78..83a74fcac 100644 --- a/packages/browser-wallet/src/popup/popupX/pages/MainPage/MainPage.tsx +++ b/packages/browser-wallet/src/popup/popupX/pages/MainPage/MainPage.tsx @@ -37,6 +37,7 @@ function formatBalance(balance: bigint, decimals: number = 0) { const integer = padded.slice(0, -decimals); const fraction = padded.slice(-decimals); const balanceFormatter = new Intl.NumberFormat(undefined, { minimumFractionDigits: decimals }); + // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore format below supports strings, TypeScript is just not aware. return balanceFormatter.format(`${integer}.${fraction}`); } @@ -46,7 +47,7 @@ type TokenBalanceProps = { decimals?: number; tokenId: string; contractAddress: function AccountTokenBalance({ decimals, tokenId, contractAddress, accountAddress }: TokenBalanceProps) { const balanceRaw = useAccountTokenBalance(accountAddress, contractAddress, tokenId) ?? 0n; const balance = useMemo(() => formatBalance(balanceRaw, decimals), [balanceRaw]); - return balance; + return {balance}; } /** Convert and display an amount of CCD to EUR using an exchange rate. */ @@ -109,7 +110,13 @@ function MainPage({ credential }: MainPageProps) {
-
navToTokenDetails()}> + {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */} +
navToTokenDetails()} + >
@@ -134,6 +141,7 @@ function MainPage({ credential }: MainPageProps) {
{tokens.map((token) => ( + // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
navToTokenDetails()} diff --git a/packages/browser-wallet/src/popup/popupX/pages/NetworkSettings/NetworkSettings.tsx b/packages/browser-wallet/src/popup/popupX/pages/NetworkSettings/NetworkSettings.tsx index c050a40ad..48e9fd517 100644 --- a/packages/browser-wallet/src/popup/popupX/pages/NetworkSettings/NetworkSettings.tsx +++ b/packages/browser-wallet/src/popup/popupX/pages/NetworkSettings/NetworkSettings.tsx @@ -14,7 +14,7 @@ import { networkConfigurationAtom } from '@popup/store/settings'; function useNetworks() { const { t } = useTranslation('x', { keyPrefix: 'network' }); - const [currentNetworkConfiguration, setCurrentNetworkConfiguration] = useAtom(networkConfigurationAtom); + const [currentNetworkConfiguration] = useAtom(networkConfigurationAtom); const networks = [mainnet, testnet]; if (isDevelopmentBuild()) { diff --git a/packages/browser-wallet/src/popup/popupX/pages/NetworkSettings/i18n/da.ts b/packages/browser-wallet/src/popup/popupX/pages/NetworkSettings/i18n/da.ts deleted file mode 100644 index d4d6c275e..000000000 --- a/packages/browser-wallet/src/popup/popupX/pages/NetworkSettings/i18n/da.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type en from './en'; - -const t: typeof en = {}; - -export default t; diff --git a/packages/browser-wallet/src/popup/popupX/pages/Onboarding/IdSubmitted.tsx b/packages/browser-wallet/src/popup/popupX/pages/Onboarding/IdSubmitted.tsx index 896765d0a..1cd89b86e 100644 --- a/packages/browser-wallet/src/popup/popupX/pages/Onboarding/IdSubmitted.tsx +++ b/packages/browser-wallet/src/popup/popupX/pages/Onboarding/IdSubmitted.tsx @@ -6,7 +6,7 @@ import Text from '@popup/popupX/shared/Text'; import { useTranslation } from 'react-i18next'; import IdCard from '@popup/popupX/shared/IdCard'; -const rowsIdInfo = [ +const rowsIdInfo: [string, string][] = [ ['Identity document type', 'Drivers licence'], ['Identity document number', 'BXM680515'], ]; diff --git a/packages/browser-wallet/src/popup/popupX/pages/Onboarding/RequestIdentity.tsx b/packages/browser-wallet/src/popup/popupX/pages/Onboarding/RequestIdentity.tsx index cca0c49d2..db5cf5382 100644 --- a/packages/browser-wallet/src/popup/popupX/pages/Onboarding/RequestIdentity.tsx +++ b/packages/browser-wallet/src/popup/popupX/pages/Onboarding/RequestIdentity.tsx @@ -8,7 +8,12 @@ import { useTranslation } from 'react-i18next'; import Page from '@popup/popupX/shared/Page'; import Text from '@popup/popupX/shared/Text'; -function ProviderOption({ icon, name }) { +interface ProviderOptionProps { + icon: React.ReactNode; + name: string; +} + +function ProviderOption({ icon, name }: ProviderOptionProps) { return (
{icon}
diff --git a/packages/browser-wallet/src/popup/popupX/pages/Onboarding/SetupPassword.tsx b/packages/browser-wallet/src/popup/popupX/pages/Onboarding/SetupPassword.tsx index ad7c0094c..d4a5c29ce 100644 --- a/packages/browser-wallet/src/popup/popupX/pages/Onboarding/SetupPassword.tsx +++ b/packages/browser-wallet/src/popup/popupX/pages/Onboarding/SetupPassword.tsx @@ -1,7 +1,6 @@ import React from 'react'; import ConcordiumLogo from '@assets/svgX/concordium-logo.svg'; import FormPassword from '@popup/popupX/shared/Form/Password'; -import Submit from '@popup/popupX/shared/Form/Submit'; import Form from '@popup/popupX/shared/Form/Form'; import { useNavigate } from 'react-router-dom'; import { relativeRoutes } from '@popup/popupX/constants/routes'; diff --git a/packages/browser-wallet/src/popup/popupX/pages/Onboarding/i18n/da.ts b/packages/browser-wallet/src/popup/popupX/pages/Onboarding/i18n/da.ts deleted file mode 100644 index 130769bdf..000000000 --- a/packages/browser-wallet/src/popup/popupX/pages/Onboarding/i18n/da.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type en from './en'; - -const t: typeof en = { - setupPassword: { - enterPasscode: 'Indtast Kodeord', - enterPasscodeAgain: 'Indtast Kodeord Igen', - continue: 'Fortsæt', - }, - idCardsInfo: { - ids: 'ID kort', - noIdentities: 'For at komme igang med at bruge Concordium blockchain, skal du først anmode om en identitet.', - request: 'Anmod Identitet', - }, - requestIdentity: { - requestId: 'Anmod identitet', - request: 'Anmod Identitet', - }, -}; - -export default t; diff --git a/packages/browser-wallet/src/popup/popupX/pages/PrivateKey/i18n/da.ts b/packages/browser-wallet/src/popup/popupX/pages/PrivateKey/i18n/da.ts deleted file mode 100644 index d4d6c275e..000000000 --- a/packages/browser-wallet/src/popup/popupX/pages/PrivateKey/i18n/da.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type en from './en'; - -const t: typeof en = {}; - -export default t; diff --git a/packages/browser-wallet/src/popup/popupX/pages/ReceiveFunds/ReceiveFunds.tsx b/packages/browser-wallet/src/popup/popupX/pages/ReceiveFunds/ReceiveFunds.tsx index ae24b40ba..bc49a0331 100644 --- a/packages/browser-wallet/src/popup/popupX/pages/ReceiveFunds/ReceiveFunds.tsx +++ b/packages/browser-wallet/src/popup/popupX/pages/ReceiveFunds/ReceiveFunds.tsx @@ -13,6 +13,10 @@ export default function ReceiveFunds() { const { t } = useTranslation('x', { keyPrefix: 'receiveFunds' }); const address = useAtomValue(selectedAccountAtom) || ''; + if (address === undefined) { + return null; + } + return ( diff --git a/packages/browser-wallet/src/popup/popupX/pages/ReceiveFunds/i18n/da.ts b/packages/browser-wallet/src/popup/popupX/pages/ReceiveFunds/i18n/da.ts deleted file mode 100644 index d4d6c275e..000000000 --- a/packages/browser-wallet/src/popup/popupX/pages/ReceiveFunds/i18n/da.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type en from './en'; - -const t: typeof en = {}; - -export default t; diff --git a/packages/browser-wallet/src/popup/popupX/pages/Restore/RestoreIntro.tsx b/packages/browser-wallet/src/popup/popupX/pages/Restore/RestoreIntro.tsx index ea4c7ae04..c6e9099ba 100644 --- a/packages/browser-wallet/src/popup/popupX/pages/Restore/RestoreIntro.tsx +++ b/packages/browser-wallet/src/popup/popupX/pages/Restore/RestoreIntro.tsx @@ -15,9 +15,7 @@ export default function RestoreIntro() { installation.
- + {}} label="Restore" />
); } diff --git a/packages/browser-wallet/src/popup/popupX/pages/Restore/RestoreResult.tsx b/packages/browser-wallet/src/popup/popupX/pages/Restore/RestoreResult.tsx index 2d2e430aa..563fddca4 100644 --- a/packages/browser-wallet/src/popup/popupX/pages/Restore/RestoreResult.tsx +++ b/packages/browser-wallet/src/popup/popupX/pages/Restore/RestoreResult.tsx @@ -25,9 +25,7 @@ export default function RestoreResult() {
- + {}} label="Continue" /> ); } diff --git a/packages/browser-wallet/src/popup/popupX/pages/SeedPhrase/i18n/da.ts b/packages/browser-wallet/src/popup/popupX/pages/SeedPhrase/i18n/da.ts deleted file mode 100644 index d4d6c275e..000000000 --- a/packages/browser-wallet/src/popup/popupX/pages/SeedPhrase/i18n/da.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type en from './en'; - -const t: typeof en = {}; - -export default t; diff --git a/packages/browser-wallet/src/popup/popupX/pages/SendFunds/SendConfirm.tsx b/packages/browser-wallet/src/popup/popupX/pages/SendFunds/SendConfirm.tsx index f1a698ce9..d4fd76fa3 100644 --- a/packages/browser-wallet/src/popup/popupX/pages/SendFunds/SendConfirm.tsx +++ b/packages/browser-wallet/src/popup/popupX/pages/SendFunds/SendConfirm.tsx @@ -23,9 +23,7 @@ export default function SendConfirm() { Est. fee: 0.03614 CCD - + navToConfirmed()} label="Send funds" /> ); } diff --git a/packages/browser-wallet/src/popup/popupX/pages/SendFunds/SendFunds.tsx b/packages/browser-wallet/src/popup/popupX/pages/SendFunds/SendFunds.tsx index b26a09e76..e11850543 100644 --- a/packages/browser-wallet/src/popup/popupX/pages/SendFunds/SendFunds.tsx +++ b/packages/browser-wallet/src/popup/popupX/pages/SendFunds/SendFunds.tsx @@ -47,9 +47,7 @@ export default function SendFunds() { Add memo - + navToConfirm()} label="Continue" /> ); } diff --git a/packages/browser-wallet/src/popup/popupX/pages/SendFunds/SendSuccess.tsx b/packages/browser-wallet/src/popup/popupX/pages/SendFunds/SendSuccess.tsx index 7eddcd163..90ca7ca17 100644 --- a/packages/browser-wallet/src/popup/popupX/pages/SendFunds/SendSuccess.tsx +++ b/packages/browser-wallet/src/popup/popupX/pages/SendFunds/SendSuccess.tsx @@ -18,9 +18,7 @@ export default function SendSuccess() { Transaction details - + nav('../../../../home')} label="Return to Account" /> ); } diff --git a/packages/browser-wallet/src/popup/popupX/pages/TransactionLog/TransactionLog.tsx b/packages/browser-wallet/src/popup/popupX/pages/TransactionLog/TransactionLog.tsx index 1b42e584f..1bbd3f84a 100644 --- a/packages/browser-wallet/src/popup/popupX/pages/TransactionLog/TransactionLog.tsx +++ b/packages/browser-wallet/src/popup/popupX/pages/TransactionLog/TransactionLog.tsx @@ -28,7 +28,7 @@ async function fetchLatestAccountTransactions( signal?: AbortSignal ): Promise { const transactions: BrowserWalletTransaction[] = []; - let startingId = undefined; + let startingId; // eslint-disable-next-line no-constant-condition while (true) { const result = await WalletProxy.getTransactions(accountAddress, transactionResultLimit, 'ascending', { @@ -207,7 +207,7 @@ Assumes 'transactions' are sorted by time in descending order. */ function convertToLogEntry(accountAddress: string, transactions: BrowserWalletTransaction[]): DayLogEntry[] { const dayLogs = []; - let dayLog: DayLogEntry | undefined = undefined; + let dayLog: DayLogEntry | undefined; for (const tx of transactions) { const dateTime = new Date(Number(tx.time * 1000n)); const date = onlyDate(dateTime); @@ -254,7 +254,7 @@ export type TransactionLogEntry = { /** Whether this transaction should be considered as income. */ income: boolean; /** The amount of CCD/tokens being transferred/rewarded, includes the token symbol. Is undefined for transactions which are not relevant. */ - amount?: string; //10.02, + amount?: string; // 10.02, /** Fee information. */ info: string; // 'with fee 0.02 CCD', /** Transaction memo. */ @@ -302,9 +302,10 @@ function TransactionLog({ account }: TransactionLogProps) {
{day.date} - {/*${day.total}*/} + {/* ${day.total} */}
{day.transactions.map((transaction) => ( + // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
; - } else { - return ; } + return ; } diff --git a/packages/browser-wallet/src/popup/popupX/pages/Web3Id/i18n/da.ts b/packages/browser-wallet/src/popup/popupX/pages/Web3Id/i18n/da.ts deleted file mode 100644 index d4d6c275e..000000000 --- a/packages/browser-wallet/src/popup/popupX/pages/Web3Id/i18n/da.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type en from './en'; - -const t: typeof en = {}; - -export default t; diff --git a/packages/browser-wallet/src/popup/popupX/shared/Form/Input/Input.tsx b/packages/browser-wallet/src/popup/popupX/shared/Form/Input/Input.tsx index 26cb2709c..fbecd693f 100644 --- a/packages/browser-wallet/src/popup/popupX/shared/Form/Input/Input.tsx +++ b/packages/browser-wallet/src/popup/popupX/shared/Form/Input/Input.tsx @@ -7,7 +7,7 @@ import ErrorMessage from '../ErrorMessage'; type Props = Pick< InputHTMLAttributes, - 'className' | 'type' | 'value' | 'onChange' | 'onBlur' | 'autoFocus' | 'readOnly' + 'className' | 'type' | 'value' | 'onChange' | 'onBlur' | 'autoFocus' | 'readOnly' | 'placeholder' > & RequiredUncontrolledFieldProps & CommonFieldProps; diff --git a/packages/browser-wallet/src/popup/popupX/shared/Form/Search/Search.tsx b/packages/browser-wallet/src/popup/popupX/shared/Form/Search/Search.tsx index 7632a4074..d5c085da3 100644 --- a/packages/browser-wallet/src/popup/popupX/shared/Form/Search/Search.tsx +++ b/packages/browser-wallet/src/popup/popupX/shared/Form/Search/Search.tsx @@ -1,6 +1,4 @@ -import { useTranslation } from 'react-i18next'; -import React, { InputHTMLAttributes, useMemo, useState } from 'react'; -import { passwordStrength } from 'check-password-strength'; +import React, { InputHTMLAttributes } from 'react'; import clsx from 'clsx'; import { Input } from '@popup/popupX/shared/Form/Input'; import Magnifying from '@assets/svgX/magnifying-glass.svg'; diff --git a/packages/browser-wallet/src/popup/popupX/shared/IconButton/IconButton.tsx b/packages/browser-wallet/src/popup/popupX/shared/IconButton/IconButton.tsx index 312d57460..1978c8737 100644 --- a/packages/browser-wallet/src/popup/popupX/shared/IconButton/IconButton.tsx +++ b/packages/browser-wallet/src/popup/popupX/shared/IconButton/IconButton.tsx @@ -4,5 +4,5 @@ import Button from '@popup/popupX/shared/Button'; import { ButtonBase } from '@popup/popupX/shared/Button/Button'; export default function IconButton({ className, ...props }: ComponentProps): JSX.Element { - return ; + return ; } diff --git a/packages/browser-wallet/src/popup/popupX/shared/IdCard/IdCard.tsx b/packages/browser-wallet/src/popup/popupX/shared/IdCard/IdCard.tsx index 1da607c60..c710a2b0b 100644 --- a/packages/browser-wallet/src/popup/popupX/shared/IdCard/IdCard.tsx +++ b/packages/browser-wallet/src/popup/popupX/shared/IdCard/IdCard.tsx @@ -1,9 +1,15 @@ -import React, { ReactNode } from 'react'; +import React from 'react'; import Card from '@popup/popupX/shared/Card'; import Text from '@popup/popupX/shared/Text'; import Button from '@popup/popupX/shared/Button'; -export default function IdCard({ rowsIdInfo = [], rowsConnectedAccounts, onEditName }) { +interface IdCardProps { + rowsIdInfo?: [string, string][]; + rowsConnectedAccounts?: [string, string][]; + onEditName?: () => void; +} + +export default function IdCgrd({ rowsIdInfo = [], rowsConnectedAccounts, onEditName }: IdCardProps) { return ( diff --git a/packages/browser-wallet/src/popup/popupX/shared/Web3IdCard/Web3IdCard.tsx b/packages/browser-wallet/src/popup/popupX/shared/Web3IdCard/Web3IdCard.tsx index dec03d91d..df9e68967 100644 --- a/packages/browser-wallet/src/popup/popupX/shared/Web3IdCard/Web3IdCard.tsx +++ b/packages/browser-wallet/src/popup/popupX/shared/Web3IdCard/Web3IdCard.tsx @@ -1,4 +1,4 @@ -import React, { ReactNode } from 'react'; +import React from 'react'; import ConcordiumLogo from '@assets/svgX/concordium-logo.svg'; import Card from '@popup/popupX/shared/Card'; import Text from '@popup/popupX/shared/Text'; diff --git a/packages/browser-wallet/src/popup/popupX/shared/i18n/en.ts b/packages/browser-wallet/src/popup/popupX/shared/i18n/en.ts new file mode 100644 index 000000000..cf5a5fae0 --- /dev/null +++ b/packages/browser-wallet/src/popup/popupX/shared/i18n/en.ts @@ -0,0 +1,12 @@ +const t = { + form: { + password: { + tooWeak: 'Very weak', + weak: 'Weak', + medium: 'Medium', + strong: 'Strong', + }, + }, +}; + +export default t; diff --git a/packages/browser-wallet/src/popup/popupX/shell/Providers.tsx b/packages/browser-wallet/src/popup/popupX/shell/Providers.tsx index 7e3f22dad..3ff8b9fdc 100644 --- a/packages/browser-wallet/src/popup/popupX/shell/Providers.tsx +++ b/packages/browser-wallet/src/popup/popupX/shell/Providers.tsx @@ -10,7 +10,7 @@ import { isSpawnedWindow, } from '@popup/shared/window-helpers'; import { popupMessageHandler } from '@popup/shared/message-handler'; -import { InternalMessageType } from '@concordium/browser-wallet-message-hub'; +import { InternalMessageType } from '@messaging'; import { noOp } from 'wallet-common-helpers'; import { Theme as ThemeType } from '@shared/storage/types'; @@ -55,7 +55,6 @@ export function Scaling({ children }: { children: ReactElement }) { } if (isFullscreenWindowDemo && body) { - console.log('isFullscreenWindowDemo'); body.style.margin = 'unset'; body.style.width = '100%'; body.style.height = '100%'; diff --git a/packages/browser-wallet/src/popup/shell/Root.tsx b/packages/browser-wallet/src/popup/shell/Root.tsx index e88b9f665..f60639498 100644 --- a/packages/browser-wallet/src/popup/shell/Root.tsx +++ b/packages/browser-wallet/src/popup/shell/Root.tsx @@ -64,7 +64,6 @@ function useScaling() { } if (isFullscreenWindowDemo && body) { - console.log('isFullscreenWindowDemo'); body.style.margin = 'unset'; body.style.width = 'unset'; body.style.height = '100%'; diff --git a/packages/browser-wallet/src/popup/shell/i18n/locales/da.ts b/packages/browser-wallet/src/popup/shell/i18n/locales/da.ts index 6b33e2c61..26f794241 100644 --- a/packages/browser-wallet/src/popup/shell/i18n/locales/da.ts +++ b/packages/browser-wallet/src/popup/shell/i18n/locales/da.ts @@ -24,14 +24,13 @@ import connectAccountsRequest from '@popup/pages/ConnectAccountsRequest/i18n/da' import web3IdProofRequest from '@popup/pages/Web3ProofRequest/i18n/da'; import verifiableCredential from '@popup/pages/VerifiableCredential/i18n/da'; import addWeb3IdCredential from '@popup/pages/AddWeb3IdCredential/i18n/da'; + // TODO dansk import verifiableCredentialBackup from '@popup/pages/VerifiableCredentialBackup/i18n/en'; import ageProofRequest from '@popup/pages/AgeProofRequest/i18n/da'; import viewSeedPhrase from '@popup/pages/ViewSeedPhrase/i18n/da'; -import type en from './en'; - -const t: typeof en = { +const t = { shared, mainLayout, account, diff --git a/packages/browser-wallet/src/popup/shell/i18n/locales/en.ts b/packages/browser-wallet/src/popup/shell/i18n/locales/en.ts index 99625877d..1a5b0208a 100644 --- a/packages/browser-wallet/src/popup/shell/i18n/locales/en.ts +++ b/packages/browser-wallet/src/popup/shell/i18n/locales/en.ts @@ -38,6 +38,7 @@ import privateKey from '@popup/popupX/pages/PrivateKey/i18n/en'; import seedPhrase from '@popup/popupX/pages/SeedPhrase/i18n/en'; import network from '@popup/popupX/pages/NetworkSettings/i18n/en'; import connect from '@popup/popupX/pages/ConnectNetwork/i18n/en'; +import sharedX from '@popup/popupX/shared/i18n/en'; import aboutPage from '@popup/popupX/pages/About/i18n/en'; import header from '@popup/popupX/page-layouts/MainLayout/Header/i18n/en'; import web3Id from '@popup/popupX/pages/Web3Id/i18n/en'; @@ -83,6 +84,7 @@ const t = { seedPhrase, network, connect, + sharedX, aboutPage, header, web3Id,