From d727ab299c125ea04a38f075d14576f533f5a95f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20D=C5=BCaluk?=
Date: Tue, 8 Aug 2023 13:44:11 +0200
Subject: [PATCH 1/4] A0-2318: Update the no-extension warning
---
.../src/Accounts/BannerExtension.tsx | 21 +++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/packages/page-accounts/src/Accounts/BannerExtension.tsx b/packages/page-accounts/src/Accounts/BannerExtension.tsx
index 3cee0a6db24f..75e35fc60013 100644
--- a/packages/page-accounts/src/Accounts/BannerExtension.tsx
+++ b/packages/page-accounts/src/Accounts/BannerExtension.tsx
@@ -2,13 +2,14 @@
// SPDX-License-Identifier: Apache-2.0
import { detect } from 'detect-browser';
-import React, { useRef } from 'react';
+import React from 'react';
import { Trans } from 'react-i18next';
import useExtensionCounter from '@polkadot/app-settings/useCounter';
import { availableExtensions } from '@polkadot/apps-config';
import { isWeb3Injected } from '@polkadot/extension-dapp';
import { onlyOnWeb } from '@polkadot/react-api/hoc';
+import { styled } from '@polkadot/react-components';
import { useApi } from '@polkadot/react-hooks';
import { useTranslation } from '../translate.js';
@@ -25,7 +26,6 @@ function BannerExtension (): React.ReactElement | null {
const { t } = useTranslation();
const { hasInjectedAccounts } = useApi();
const upgradableCount = useExtensionCounter();
- const phishing = useRef(t('Since some extensions, such as the polkadot-js extension, protects you against all community reported phishing sites, there are valid reasons to use them for additional protection, even if you are not storing accounts in it.'));
if (!isSupported || !browserName || !isWeb3Injected) {
return null;
@@ -53,10 +53,23 @@ function BannerExtension (): React.ReactElement | null {
return (
{t('One or more extensions are detected in your browser, however no accounts have been injected.')}
- {t('Ensure that the extension has accounts, some accounts are visible globally and available for this chain and that you gave the application permission to access accounts from the extension to use them.')}
- {phishing.current}
+
+ {t('Ensure that:')}
+
+ {t('the extension has accounts,')}
+ {t('at least one account is available for this chain,')}
+ {t('the extension allows azero.dev to access accounts')}
+
+
+ {t('For extra protection, consider using the Threat Slayer extension which protects you from dangerous websites in real-time.')}
);
}
export default onlyOnWeb(React.memo(BannerExtension));
+
+const SafetyInfoList = styled.ul`
+ margin-block: 0;
+ padding-left: 20px;
+ list-style-type: '- ';
+`;
From 138a8d4e3b81bd7f0d4f7edfbf1881c6855263aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20D=C5=BCaluk?=
Date: Thu, 10 Aug 2023 18:00:25 +0200
Subject: [PATCH 2/4] A0-2318: Apply marketing suggestions
---
.../src/Accounts/BannerExtension.tsx | 28 ++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/packages/page-accounts/src/Accounts/BannerExtension.tsx b/packages/page-accounts/src/Accounts/BannerExtension.tsx
index 75e35fc60013..a358c0a5f606 100644
--- a/packages/page-accounts/src/Accounts/BannerExtension.tsx
+++ b/packages/page-accounts/src/Accounts/BannerExtension.tsx
@@ -22,7 +22,7 @@ const browserInfo = detect();
const browserName: Browser | null = (browserInfo && (browserInfo.name as Browser)) || null;
const isSupported = browserName && Object.keys(availableExtensions).includes(browserName);
-function BannerExtension (): React.ReactElement | null {
+function ExtensionWarning (): React.ReactElement | null {
const { t } = useTranslation();
const { hasInjectedAccounts } = useApi();
const upgradableCount = useExtensionCounter();
@@ -66,6 +66,32 @@ function BannerExtension (): React.ReactElement | null {
);
}
+function BannerExtension () {
+ const { t } = useTranslation();
+
+ return (
+ <>
+
+
+
+ {t('For extra protection, consider using the')}
+
+
+ Threat Slayer
+
+
+ {t('extension which protects you from dangerous websites in real-time.')}
+
+
+
+ >
+ );
+}
+
export default onlyOnWeb(React.memo(BannerExtension));
const SafetyInfoList = styled.ul`
From bfb4fbbae8d6c609e59f48c83d67c599b1928b33 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20D=C5=BCaluk?=
Date: Thu, 10 Aug 2023 19:50:50 +0200
Subject: [PATCH 3/4] A0-2318: Turn off a disturbing eslint rule
Hard to say what it requires, but whatever it is - doesn't
seem there's anything to be fixed where it says.
---
.eslintrc.cjs | 1 +
1 file changed, 1 insertion(+)
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
index 7f5ae5097514..0be2eda90045 100644
--- a/.eslintrc.cjs
+++ b/.eslintrc.cjs
@@ -25,5 +25,6 @@ module.exports = {
// this seems very broken atm, false positives
'@typescript-eslint/unbound-method': 'off',
'header/header' : 'off',
+ 'react/jsx-newline': 'off',
}
};
From 0c27722ea11d12794a5d7b565672944a37016880 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20D=C5=BCaluk?=
Date: Thu, 10 Aug 2023 19:53:56 +0200
Subject: [PATCH 4/4] A0-2318: Dedupe a duplicated paragraph
---
packages/page-accounts/src/Accounts/BannerExtension.tsx | 1 -
1 file changed, 1 deletion(-)
diff --git a/packages/page-accounts/src/Accounts/BannerExtension.tsx b/packages/page-accounts/src/Accounts/BannerExtension.tsx
index a358c0a5f606..9e6f9e2c58bb 100644
--- a/packages/page-accounts/src/Accounts/BannerExtension.tsx
+++ b/packages/page-accounts/src/Accounts/BannerExtension.tsx
@@ -61,7 +61,6 @@ function ExtensionWarning (): React.ReactElement | null {
{t('the extension allows azero.dev to access accounts')}
- {t('For extra protection, consider using the Threat Slayer extension which protects you from dangerous websites in real-time.')}
);
}