From 278c947be0e273cb7d0f6e9834f31b32bb492d26 Mon Sep 17 00:00:00 2001 From: Igor Shadurin Date: Fri, 8 Sep 2023 15:05:35 +0300 Subject: [PATCH 01/55] fix: removed .bzz links, changed medium logo --- .../Footers/MainFooter/MainFooter.tsx | 10 ++--- src/media/branding/blog-dark.svg | 41 +++++++++++++++++++ src/media/branding/blog-light.svg | 41 +++++++++++++++++++ src/media/branding/medium-dark.svg | 3 -- src/media/branding/medium-light.svg | 3 -- src/pages/overview/index.tsx | 2 +- 6 files changed, 88 insertions(+), 12 deletions(-) create mode 100644 src/media/branding/blog-dark.svg create mode 100644 src/media/branding/blog-light.svg delete mode 100644 src/media/branding/medium-dark.svg delete mode 100644 src/media/branding/medium-light.svg diff --git a/src/components/Footers/MainFooter/MainFooter.tsx b/src/components/Footers/MainFooter/MainFooter.tsx index c309a9fa..cf1f91ce 100644 --- a/src/components/Footers/MainFooter/MainFooter.tsx +++ b/src/components/Footers/MainFooter/MainFooter.tsx @@ -18,8 +18,8 @@ import GithubDarkIcon from '@media/branding/github-dark.svg'; import DiscordLightIcon from '@media/branding/discord-light.svg'; import DiscordDarkIcon from '@media/branding/discord-dark.svg'; -import MediumLightIcon from '@media/branding/medium-light.svg'; -import MediumDarkIcon from '@media/branding/medium-dark.svg'; +import BlogLightIcon from '@media/branding/blog-light.svg'; +import BlogDarkIcon from '@media/branding/blog-dark.svg'; import { useLocales } from '@context/LocalesContext'; const MainFooter: FC = () => { @@ -114,14 +114,14 @@ const MainFooter: FC = () => { {theme === 'light' ? ( - + ) : ( - + )} diff --git a/src/media/branding/blog-dark.svg b/src/media/branding/blog-dark.svg new file mode 100644 index 00000000..50f7ab52 --- /dev/null +++ b/src/media/branding/blog-dark.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + diff --git a/src/media/branding/blog-light.svg b/src/media/branding/blog-light.svg new file mode 100644 index 00000000..fffceba3 --- /dev/null +++ b/src/media/branding/blog-light.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + diff --git a/src/media/branding/medium-dark.svg b/src/media/branding/medium-dark.svg deleted file mode 100644 index 992382c3..00000000 --- a/src/media/branding/medium-dark.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/media/branding/medium-light.svg b/src/media/branding/medium-light.svg deleted file mode 100644 index f15876c5..00000000 --- a/src/media/branding/medium-light.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/pages/overview/index.tsx b/src/pages/overview/index.tsx index db8e9da7..83f339f2 100644 --- a/src/pages/overview/index.tsx +++ b/src/pages/overview/index.tsx @@ -98,7 +98,7 @@ const Overview: FC = () => { imageDark={} button={ From 0b976722228d9aa9012c8086576b3f97124291b3 Mon Sep 17 00:00:00 2001 From: Vladan Date: Fri, 8 Sep 2023 14:34:56 +0200 Subject: [PATCH 02/55] fix: drive dropdown z-index --- .../Dropdowns/DriveItemDropdown/DriveItemDropdown.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Dropdowns/DriveItemDropdown/DriveItemDropdown.tsx b/src/components/Dropdowns/DriveItemDropdown/DriveItemDropdown.tsx index 358e8e7b..1facfcd9 100644 --- a/src/components/Dropdowns/DriveItemDropdown/DriveItemDropdown.tsx +++ b/src/components/Dropdowns/DriveItemDropdown/DriveItemDropdown.tsx @@ -21,7 +21,7 @@ const DriveDropdown: FC = ({ }) => { return (
event.stopPropagation()} > From 91d07f5a3e39ac5c47d2674e051581ce70920c84 Mon Sep 17 00:00:00 2001 From: Vladan Date: Fri, 8 Sep 2023 14:53:04 +0200 Subject: [PATCH 03/55] fix: layout padding --- src/components/Layouts/MainLayout/MainLayout.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Layouts/MainLayout/MainLayout.tsx b/src/components/Layouts/MainLayout/MainLayout.tsx index bf7a9ee6..2ce852c6 100644 --- a/src/components/Layouts/MainLayout/MainLayout.tsx +++ b/src/components/Layouts/MainLayout/MainLayout.tsx @@ -64,7 +64,7 @@ const MainLayout: FC = ({ >
{showDriveSideBar ? : null} -
+
{loginType === 'metamask' && inviteKey && ( Date: Mon, 11 Sep 2023 11:28:28 +0200 Subject: [PATCH 04/55] fix: sidebar (#395) --- .../MainSideBarItem/MainSideBarItem.tsx | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/components/Buttons/MainSideBarItem/MainSideBarItem.tsx b/src/components/Buttons/MainSideBarItem/MainSideBarItem.tsx index 1e3dac34..08840f1b 100644 --- a/src/components/Buttons/MainSideBarItem/MainSideBarItem.tsx +++ b/src/components/Buttons/MainSideBarItem/MainSideBarItem.tsx @@ -20,6 +20,8 @@ interface MainSideBarItemProps { driveSideBarToggle: any; } +const DRIVE_PATH = '/drive'; + const MainSideBarItem: FC = ({ icons, label, @@ -39,26 +41,26 @@ const MainSideBarItem: FC = ({ }, [link]); useEffect(() => { - if (router.pathname === '/drive') { + if (router.pathname === DRIVE_PATH) { driveSideBarToggle(); } // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return ( - + ); }; From 04936df192dc224a81859c58e436b93b1e3124e3 Mon Sep 17 00:00:00 2001 From: Vladan Date: Mon, 11 Sep 2023 11:53:21 +0200 Subject: [PATCH 05/55] feat: new gas estimation --- .../MetamaskCreateAccount.tsx | 10 +--------- src/utils/ens.ts | 19 ++----------------- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/src/components/Dialogs/MetamaskMigrationDialog/MetamaskCreateAccount.tsx b/src/components/Dialogs/MetamaskMigrationDialog/MetamaskCreateAccount.tsx index 665bf1d7..3a1d12e0 100644 --- a/src/components/Dialogs/MetamaskMigrationDialog/MetamaskCreateAccount.tsx +++ b/src/components/Dialogs/MetamaskMigrationDialog/MetamaskCreateAccount.tsx @@ -130,15 +130,7 @@ export default function MetamaskCreateAccount({ }; const getFeePrice = async () => { - const { address } = fdpClientRef.current.account.wallet; - const { publicKey } = fdpClientRef.current.account; - - const price = await estimateRegistrationPrice( - username, - address, - publicKey, - network - ); + const price = await estimateRegistrationPrice(network); setMinBalance(price); }; diff --git a/src/utils/ens.ts b/src/utils/ens.ts index ff944c68..c54aa1d1 100644 --- a/src/utils/ens.ts +++ b/src/utils/ens.ts @@ -5,26 +5,11 @@ import { BigNumber, providers } from 'ethers'; const FDS_DOMAIN = 'fds'; export async function estimateRegistrationPrice( - username: string, - address: string, - publicKey: string, network: Network ): Promise { const provider = new providers.JsonRpcProvider(network.config.rpcUrl); - const ens = new ENS( - // A workaround for gas estimation on sepolia - network.id === Environments.SEPOLIA - ? { ...network.config, rpcUrl: 'http://rpc.sepolia.org' } - : network.config, - provider, - FDS_DOMAIN - ); - const [gasAmount, gasPrice] = await Promise.all([ - ens.registerUsernameEstimateGas(username, address, publicKey), - provider.getFeeData(), - ]); - - return gasPrice.maxFeePerGas.mul(gasAmount); + const ens = new ENS(network.config, provider, FDS_DOMAIN); + return ens.registerUsernameApproximatePrice(); } export function getAccountBalance( From 53a9c32201c0c09452473fe6f755b2191b91a142 Mon Sep 17 00:00:00 2001 From: Vladan Date: Mon, 11 Sep 2023 12:57:45 +0200 Subject: [PATCH 06/55] fix: spinner for pods (#494) --- src/pages/drive/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/drive/index.tsx b/src/pages/drive/index.tsx index df57c293..6d021b0f 100644 --- a/src/pages/drive/index.tsx +++ b/src/pages/drive/index.tsx @@ -263,7 +263,7 @@ const Drive: FC = () => {
) : null} - + {!loading && (activePod ? ( From 99498aee10bf2eb01c73773892f25cc1d0b61150 Mon Sep 17 00:00:00 2001 From: Vladan Date: Wed, 13 Sep 2023 12:45:14 +0200 Subject: [PATCH 07/55] feat: file path redesign for mobile --- src/api/directory.ts | 5 +++- .../DirectoryPath/DirectoryPath.tsx | 4 ++- .../PodDropdown/PodDropdownToggle.tsx | 2 +- .../DriveActionHeaderMobile.tsx | 28 +++++++++++++++++-- src/pages/drive/index.tsx | 11 ++++++-- 5 files changed, 42 insertions(+), 8 deletions(-) diff --git a/src/api/directory.ts b/src/api/directory.ts index 7b09f900..e9980284 100644 --- a/src/api/directory.ts +++ b/src/api/directory.ts @@ -13,7 +13,10 @@ export async function createDirectory( directory = ''; } - await fdp.directory.create(podName, combine(directory, directoryName)); + await fdp.directory.create( + podName, + combine(...directory.split('/'), directoryName) + ); const time = getUnixTimestamp(); return { name: directoryName, diff --git a/src/components/DirectoryPath/DirectoryPath.tsx b/src/components/DirectoryPath/DirectoryPath.tsx index 295b3e39..a8908fae 100644 --- a/src/components/DirectoryPath/DirectoryPath.tsx +++ b/src/components/DirectoryPath/DirectoryPath.tsx @@ -9,6 +9,7 @@ interface DirectoryPathProps { directory: string; onDirectorySelect: (newDirectory: string) => void; onBackToDrive: () => void; + className?: string; } const MAX_FOLDERS = 3; @@ -21,6 +22,7 @@ const DirectoryPath = ({ directory, onDirectorySelect, onBackToDrive, + className, }: DirectoryPathProps) => { const { theme } = useContext(ThemeContext); const [folders, displayedFolders] = useMemo(() => { @@ -35,7 +37,7 @@ const DirectoryPath = ({ }; return ( -
+
{podName && (
+ +
+ + + ); +} diff --git a/src/components/Dropdowns/PodDropdown/PodDropdownToggle.tsx b/src/components/Dropdowns/PodDropdown/PodDropdownToggle.tsx index 949aba1e..47b1ebc8 100644 --- a/src/components/Dropdowns/PodDropdown/PodDropdownToggle.tsx +++ b/src/components/Dropdowns/PodDropdown/PodDropdownToggle.tsx @@ -35,7 +35,11 @@ const PodDropdownToggele = () => { className="m-auto sm:block md:hidden" /> )} - + setDirectoryName('root')} className="font-semibold text-lg cursor-pointer hover:bg-color-shade-dark-3-day text-color-accents-purple-heavy dark:text-color-accents-grey-lavendar" diff --git a/src/components/NavigationBars/DriveActionBar/DriveActionBarMobile.tsx b/src/components/NavigationBars/DriveActionBar/DriveActionBarMobile.tsx index f373b350..08970eb6 100644 --- a/src/components/NavigationBars/DriveActionBar/DriveActionBarMobile.tsx +++ b/src/components/NavigationBars/DriveActionBar/DriveActionBarMobile.tsx @@ -68,29 +68,29 @@ const DriveActionBarMobile: FC = ({ {DriveActionBarItem( theme, intl.get('NEW_POD'), - , - , + , + , () => setShowCreatePodModal(true) )} {DriveActionBarItem( theme, intl.get('UPLOAD'), - , - , + , + , () => setShowUploadFileModal(true) )} {DriveActionBarItem( theme, intl.get('IMPORT'), - , - , + , + , () => setShowImportFileModal(true) )} {DriveActionBarItem( theme, intl.get('FOLDER'), - , - , + , + , () => setShowCreateFolderModal(true) )} {showCreatePodModal ? ( diff --git a/src/components/NavigationBars/MainNavigationBar/MainNavigationBar.tsx b/src/components/NavigationBars/MainNavigationBar/MainNavigationBar.tsx index 9abcc575..82698200 100644 --- a/src/components/NavigationBars/MainNavigationBar/MainNavigationBar.tsx +++ b/src/components/NavigationBars/MainNavigationBar/MainNavigationBar.tsx @@ -4,22 +4,44 @@ import { useFdpStorage } from '@context/FdpStorageContext'; import Logo from '@components/Logo/Logo'; import { SearchBar } from '@components/Inputs'; -import { UserDropdownToggle } from '@components/Buttons'; +import { Button, UserDropdownToggle } from '@components/Buttons'; // import { ActivityDropdownToggle } from '@components/Buttons'; import UserDropdown from './UserDropdown/UserDropdown'; import UserContext from '@context/UserContext'; import LanguageDropdown from '@components/Dropdowns/LanguageDropdown/LanguageDropdown'; +import { useDialogs } from '@context/DialogsContext'; + +import NavigationMenuLight from '@media/UI/drive-view-list-light.svg'; +import NavigationMenuDark from '@media/UI/drive-view-list-dark.svg'; +import ThemeContext from '@context/ThemeContext'; + // import ActivityDropdown from './ActivityDropdown/ActivityDropdown'; const MainNavigationBar: FC> = () => { + const { theme } = useContext(ThemeContext); const [showUserDropdown, setShowUserDropdown] = useState(false); const { wallet } = useFdpStorage(); const { metamaskMigrationNotification } = useContext(UserContext); + const { setMobileNavigationOpen } = useDialogs(); return (