From 6b14e4a53ee9aba4e00d9bd114ee90db08a60e8a Mon Sep 17 00:00:00 2001 From: Vladan Date: Wed, 13 Dec 2023 15:12:32 +0100 Subject: [PATCH 1/8] feat: hidden functionalities --- package-lock.json | 27 ++-- package.json | 2 +- .../Connect/Metamask/MetamaskConnect.tsx | 2 +- src/components/Forms/LoginForm/LoginForm.tsx | 147 ++++++++++-------- .../Layouts/MainLayout/MainLayout.tsx | 3 +- .../AuthenticationNavbar.tsx | 11 +- .../MainNavigationBar/MainNavigationBar.tsx | 4 +- .../MainSideBar/MainSideBar.tsx | 4 +- 8 files changed, 110 insertions(+), 90 deletions(-) diff --git a/package-lock.json b/package-lock.json index 73874493..b9d5d7c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@emotion/react": "^11.4.1", "@emotion/styled": "^11.3.0", "@fairdatasociety/blossom": "^0.5.0", - "@fairdatasociety/fdp-storage": "^0.13.0", + "@fairdatasociety/fdp-storage": "^0.16.0", "@headlessui/react": "^1.7.14", "@metamask/sdk": "^0.5.6", "@types/react-blockies": "^1.4.1", @@ -3080,13 +3080,13 @@ } }, "node_modules/@fairdatasociety/fdp-storage": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/@fairdatasociety/fdp-storage/-/fdp-storage-0.13.0.tgz", - "integrity": "sha512-7AWAC/enq1SQCisMuD3wT5cKSOxe8KdC5f3nolWcruCUpdWcwe65YtjDeL88m/E/kcituQGAl2IgWGkqoysB/g==", + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/@fairdatasociety/fdp-storage/-/fdp-storage-0.16.0.tgz", + "integrity": "sha512-UM8NBAHyN9yTUi0S8ddyr/lo2cg9oia1xDarS/K8pLCW8CAcvDx4rLC1qUsSmN80fbkOnJpiU0/DY4T7EN6iwQ==", "dependencies": { "@ethersphere/bee-js": "^6.2.0", "@fairdatasociety/fdp-contracts-js": "^3.8.0", - "crypto-js": "^4.1.1", + "crypto-js": "^4.2.0", "ethers": "^5.5.2", "js-sha3": "^0.8.0" }, @@ -9819,8 +9819,9 @@ } }, "node_modules/crypto-js": { - "version": "4.1.1", - "license": "MIT" + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz", + "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==" }, "node_modules/crypto-random-string": { "version": "2.0.0", @@ -25008,13 +25009,13 @@ "requires": {} }, "@fairdatasociety/fdp-storage": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/@fairdatasociety/fdp-storage/-/fdp-storage-0.13.0.tgz", - "integrity": "sha512-7AWAC/enq1SQCisMuD3wT5cKSOxe8KdC5f3nolWcruCUpdWcwe65YtjDeL88m/E/kcituQGAl2IgWGkqoysB/g==", + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/@fairdatasociety/fdp-storage/-/fdp-storage-0.16.0.tgz", + "integrity": "sha512-UM8NBAHyN9yTUi0S8ddyr/lo2cg9oia1xDarS/K8pLCW8CAcvDx4rLC1qUsSmN80fbkOnJpiU0/DY4T7EN6iwQ==", "requires": { "@ethersphere/bee-js": "^6.2.0", "@fairdatasociety/fdp-contracts-js": "^3.8.0", - "crypto-js": "^4.1.1", + "crypto-js": "^4.2.0", "ethers": "^5.5.2", "js-sha3": "^0.8.0" } @@ -29926,7 +29927,9 @@ } }, "crypto-js": { - "version": "4.1.1" + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz", + "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==" }, "crypto-random-string": { "version": "2.0.0" diff --git a/package.json b/package.json index f1cd9020..186b57df 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@emotion/react": "^11.4.1", "@emotion/styled": "^11.3.0", "@fairdatasociety/blossom": "^0.5.0", - "@fairdatasociety/fdp-storage": "^0.13.0", + "@fairdatasociety/fdp-storage": "^0.16.0", "@headlessui/react": "^1.7.14", "@metamask/sdk": "^0.5.6", "@types/react-blockies": "^1.4.1", diff --git a/src/components/Connect/Metamask/MetamaskConnect.tsx b/src/components/Connect/Metamask/MetamaskConnect.tsx index 9917e233..6a1c4ccf 100644 --- a/src/components/Connect/Metamask/MetamaskConnect.tsx +++ b/src/components/Connect/Metamask/MetamaskConnect.tsx @@ -74,7 +74,7 @@ const MetamaskConnect = ({ onConnect }: MetamaskConnectProps) => { setAddress(wallet.address); setMnemonic(mnemonic); - router.push('/overview'); + router.push('/drive'); } catch (error) { console.error(error); setErrorMessage(String(error.message || error)); diff --git a/src/components/Forms/LoginForm/LoginForm.tsx b/src/components/Forms/LoginForm/LoginForm.tsx index 3443a668..ff06b46d 100644 --- a/src/components/Forms/LoginForm/LoginForm.tsx +++ b/src/components/Forms/LoginForm/LoginForm.tsx @@ -19,6 +19,7 @@ import { setDefaultNetwork } from '@utils/localStorage'; import { useLocales } from '@context/LocalesContext'; import CustomCheckbox from '@components/Inputs/CustomCheckbox/CustomCheckbox'; import { useMatomoContext } from '@context/Matomo'; +import MetamaskConnect from '@components/Connect/Metamask/MetamaskConnect'; const ALLOW_TRACKING_KEY = 'allow-matomo'; @@ -51,6 +52,7 @@ const LoginForm: FC = () => { } = useFdpStorage(); const router = useRouter(); const { intl } = useLocales(); + const fdsLoginEnabled = router?.query['fdsLogin'] === 'true'; const onSubmit = async (data: { user_name: string; password: string }) => { try { @@ -131,78 +133,87 @@ const LoginForm: FC = () => { -
- - - - - - - - - {intl.get('ALLOW_TRACKING')} - - -
-
-
- - {intl.get('REGISTER_NEW_ACCOUNT')} - + {intl.get('ALLOW_TRACKING')} + + +
+
+ + + + ) : ( +
+ + {/* eslint-disable-next-line @typescript-eslint/no-empty-function */} + {}} onError={() => {}} /> +
- + )}
); diff --git a/src/components/Layouts/MainLayout/MainLayout.tsx b/src/components/Layouts/MainLayout/MainLayout.tsx index 54a802f2..6f5e1a86 100644 --- a/src/components/Layouts/MainLayout/MainLayout.tsx +++ b/src/components/Layouts/MainLayout/MainLayout.tsx @@ -49,7 +49,8 @@ const MainLayout: FC = ({
-
+ {/* sm:w-28 */} +
{ const { intl } = useLocales(); + const router = useRouter(); + const fdsLoginEnabled = router?.query['fdsLogin'] === 'true'; return (
{
- - - + {fdsLoginEnabled && ( + + + + )} diff --git a/src/components/NavigationBars/MainNavigationBar/MainNavigationBar.tsx b/src/components/NavigationBars/MainNavigationBar/MainNavigationBar.tsx index 0678c37c..8ddc77d1 100644 --- a/src/components/NavigationBars/MainNavigationBar/MainNavigationBar.tsx +++ b/src/components/NavigationBars/MainNavigationBar/MainNavigationBar.tsx @@ -31,7 +31,7 @@ const MainNavigationBar: FC> = () => {