From 3da016e35eec7459304f4148acfd2d5402e3cb8b Mon Sep 17 00:00:00 2001 From: David Colon <38386583+Da-Colon@users.noreply.github.com> Date: Wed, 17 Apr 2024 15:37:08 -0400 Subject: [PATCH 01/17] reaarange header and footer --- src/components/ui/page/Header/index.tsx | 117 +++++++++++++++++- src/components/ui/page/Layout/index.tsx | 10 +- src/components/ui/page/Navigation/index.tsx | 126 +++----------------- 3 files changed, 135 insertions(+), 118 deletions(-) diff --git a/src/components/ui/page/Header/index.tsx b/src/components/ui/page/Header/index.tsx index 1b6595da76..bfe1a63f96 100644 --- a/src/components/ui/page/Header/index.tsx +++ b/src/components/ui/page/Header/index.tsx @@ -1,8 +1,122 @@ -import { Flex, Show } from '@chakra-ui/react'; +import { + Box, + Divider, + Drawer, + DrawerCloseButton, + DrawerContent, + DrawerOverlay, + Flex, + Hide, + IconButton, + Show, + useDisclosure, +} from '@chakra-ui/react'; +import { FractalBrandBurger, FractalBrand } from '@decent-org/fractal-ui'; +import { useRef } from 'react'; +import { useTranslation } from 'react-i18next'; +import { Link } from 'react-router-dom'; +import { BASE_ROUTES } from '../../../../constants/routes'; +import { useFractal } from '../../../../providers/App/AppProvider'; import { AccountDisplay } from '../../menus/AccountDisplay'; import { DAOSearch } from '../../menus/DAOSearch'; import { FavoritesMenu } from '../../menus/FavoritesMenu'; +import { NavigationLinks } from '../Navigation/NavigationLinks'; +function HeaderLogo() { + const { t } = useTranslation('navigation'); + const { isOpen, onOpen, onClose } = useDisclosure(); + const btnRef = useRef(null); + + const { + node: { daoAddress }, + } = useFractal(); + + const showDAOLinks = !!daoAddress; + return ( + + + <> + + } + /> + + + + + + + + + + + + + + + + + + + + + + + ); +} function Header() { return ( + diff --git a/src/components/ui/page/Layout/index.tsx b/src/components/ui/page/Layout/index.tsx index d267c0f34f..389244764e 100644 --- a/src/components/ui/page/Layout/index.tsx +++ b/src/components/ui/page/Layout/index.tsx @@ -8,9 +8,9 @@ export default function Layout() { return (
@@ -49,7 +48,6 @@ export default function Layout() { display="flex" flexDirection="column" flexGrow="1" - bg="chocolate.900" position="fixed" w="4.25rem" minHeight={{ base: undefined, md: '100vh' }} diff --git a/src/components/ui/page/Navigation/index.tsx b/src/components/ui/page/Navigation/index.tsx index e83bec9175..daa7151fea 100644 --- a/src/components/ui/page/Navigation/index.tsx +++ b/src/components/ui/page/Navigation/index.tsx @@ -1,124 +1,28 @@ -import { - Box, - Divider, - Drawer, - DrawerCloseButton, - DrawerContent, - DrawerOverlay, - Flex, - Hide, - IconButton, - Show, - useDisclosure, -} from '@chakra-ui/react'; -import { FractalBrandBurger, FractalBrand } from '@decent-org/fractal-ui'; -import React from 'react'; -import { useTranslation } from 'react-i18next'; -import { Link } from 'react-router-dom'; -import { BASE_ROUTES } from '../../../../constants/routes'; +import { Box, Flex, Show } from '@chakra-ui/react'; import { useFractal } from '../../../../providers/App/AppProvider'; -import { DAOSearch } from '../../menus/DAOSearch'; import { NavigationLinks } from './NavigationLinks'; function Navigation() { - const { t } = useTranslation('navigation'); - const { isOpen, onOpen, onClose } = useDisclosure(); - const btnRef = React.useRef(null); - const { node: { daoAddress }, } = useFractal(); const showDAOLinks = !!daoAddress; return ( - <> - - - <> - - } - /> - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + ); } From 0f54af645bd532a0d2991f7820939b56a530eb82 Mon Sep 17 00:00:00 2001 From: David Colon <38386583+Da-Colon@users.noreply.github.com> Date: Wed, 17 Apr 2024 15:42:36 -0400 Subject: [PATCH 02/17] replace logo --- src/components/ui/page/Header/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/ui/page/Header/index.tsx b/src/components/ui/page/Header/index.tsx index bfe1a63f96..a7f42f9c5f 100644 --- a/src/components/ui/page/Header/index.tsx +++ b/src/components/ui/page/Header/index.tsx @@ -11,7 +11,7 @@ import { Show, useDisclosure, } from '@chakra-ui/react'; -import { FractalBrandBurger, FractalBrand } from '@decent-org/fractal-ui'; +import { DecentLogo } from '@decent-org/fractal-ui'; import { useRef } from 'react'; import { useTranslation } from 'react-i18next'; import { Link } from 'react-router-dom'; @@ -52,7 +52,7 @@ function HeaderLogo() { minW={0} variant="unstyled" icon={ - @@ -108,7 +108,7 @@ function HeaderLogo() { to={BASE_ROUTES.landing} aria-label={t('ariaLabelFractalBrand')} > - From 11c06973c230218b77fa27a46e3a5d120c353f0b Mon Sep 17 00:00:00 2001 From: David Colon <38386583+Da-Colon@users.noreply.github.com> Date: Wed, 17 Apr 2024 20:52:39 -0400 Subject: [PATCH 03/17] adjust header height; adjust DecentLogo size --- src/components/ui/page/Header/index.tsx | 7 +++++-- src/constants/common.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/ui/page/Header/index.tsx b/src/components/ui/page/Header/index.tsx index a7f42f9c5f..8bf946c0cf 100644 --- a/src/components/ui/page/Header/index.tsx +++ b/src/components/ui/page/Header/index.tsx @@ -54,7 +54,8 @@ function HeaderLogo() { icon={ } /> @@ -110,7 +111,9 @@ function HeaderLogo() { > diff --git a/src/constants/common.ts b/src/constants/common.ts index c50e79f836..3c481ffe9d 100644 --- a/src/constants/common.ts +++ b/src/constants/common.ts @@ -1,4 +1,4 @@ -export const HEADER_HEIGHT = '4rem'; +export const HEADER_HEIGHT = '4.5rem'; export const CONTENT_HEIGHT = `calc(100vh - ${HEADER_HEIGHT})`; export const BACKGROUND_SEMI_TRANSPARENT = 'black.900-semi-transparent'; /** From 26ba23553b5318af4b1f57ad229778e0ba12dd69 Mon Sep 17 00:00:00 2001 From: David Colon <38386583+Da-Colon@users.noreply.github.com> Date: Wed, 17 Apr 2024 20:53:01 -0400 Subject: [PATCH 04/17] update DAO Search position and Update icon --- src/components/ui/menus/DAOSearch/index.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/ui/menus/DAOSearch/index.tsx b/src/components/ui/menus/DAOSearch/index.tsx index e6c1fca388..bab64f7f98 100644 --- a/src/components/ui/menus/DAOSearch/index.tsx +++ b/src/components/ui/menus/DAOSearch/index.tsx @@ -8,7 +8,7 @@ import { useDisclosure, useOutsideClick, } from '@chakra-ui/react'; -import { Search } from '@decent-org/fractal-ui'; +import { MagnifyingGlass } from '@phosphor-icons/react'; import React, { useEffect, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useSearchDao } from '../../../../hooks/DAO/useSearchDao'; @@ -41,7 +41,7 @@ export function DAOSearch({ closeDrawer }: { closeDrawer?: () => void }) { ref={ref} width="full" maxW={{ base: 'full', md: '31.125rem' }} - height="4rem" + height="full" > void }) { justifyContent="center" > - Date: Wed, 17 Apr 2024 22:39:12 -0400 Subject: [PATCH 05/17] Update Header Menu Buttons to match figma --- .../AccountDisplay/MenuButtonDisplay.tsx | 20 ++++++++---- .../ui/menus/AccountDisplay/index.tsx | 23 +++++++------ .../ui/menus/FavoritesMenu/index.tsx | 32 ++++++++++--------- src/components/ui/page/Navigation/index.tsx | 2 +- 4 files changed, 42 insertions(+), 35 deletions(-) diff --git a/src/components/ui/menus/AccountDisplay/MenuButtonDisplay.tsx b/src/components/ui/menus/AccountDisplay/MenuButtonDisplay.tsx index 91030b445a..e66368a4ce 100644 --- a/src/components/ui/menus/AccountDisplay/MenuButtonDisplay.tsx +++ b/src/components/ui/menus/AccountDisplay/MenuButtonDisplay.tsx @@ -1,5 +1,5 @@ -import { Box, Flex, Text } from '@chakra-ui/react'; -import { ArrowDown } from '@decent-org/fractal-ui'; +import { Box, Flex } from '@chakra-ui/react'; +import { CaretDown } from '@phosphor-icons/react'; import { useTranslation } from 'react-i18next'; import useAvatar from '../../../../hooks/utils/useAvatar'; import useDisplayName from '../../../../hooks/utils/useDisplayName'; @@ -13,8 +13,11 @@ export function NotConnected() { alignItems="center" gap="1" > - {t('connectWallet')} - + {t('connectWallet')} + ); } @@ -36,14 +39,17 @@ export function Connected() { alignItems="center" gap="0.75rem" > - + - {accountDisplayName} - + {accountDisplayName} + ); } diff --git a/src/components/ui/menus/AccountDisplay/index.tsx b/src/components/ui/menus/AccountDisplay/index.tsx index d4e1da528c..346eba0384 100644 --- a/src/components/ui/menus/AccountDisplay/index.tsx +++ b/src/components/ui/menus/AccountDisplay/index.tsx @@ -1,21 +1,20 @@ -import { Menu, MenuButton } from '@chakra-ui/react'; -import { Fragment } from 'react'; +import { Button, Menu, MenuButton } from '@chakra-ui/react'; import { MenuButtonDisplay } from './MenuButtonDisplay'; import { MenuItems } from './MenuItems'; export function AccountDisplay() { return ( - - - - - - + + ); } diff --git a/src/components/ui/menus/FavoritesMenu/index.tsx b/src/components/ui/menus/FavoritesMenu/index.tsx index d2f4a4ed33..0b01639f87 100644 --- a/src/components/ui/menus/FavoritesMenu/index.tsx +++ b/src/components/ui/menus/FavoritesMenu/index.tsx @@ -1,5 +1,5 @@ -import { Flex, Menu, MenuButton, Show, Text } from '@chakra-ui/react'; -import { ArrowDown, StarGoldSolid } from '@decent-org/fractal-ui'; +import { Button, Flex, Menu, MenuButton, Show, Text } from '@chakra-ui/react'; +import { CaretDown, Star } from '@phosphor-icons/react'; import { Fragment } from 'react'; import { useTranslation } from 'react-i18next'; import { FavoritesList } from './FavoritesList'; @@ -10,31 +10,33 @@ export function FavoritesMenu() { {({ isOpen }) => ( - - {t('titleFavorites')} - + - + {isOpen && } )} diff --git a/src/components/ui/page/Navigation/index.tsx b/src/components/ui/page/Navigation/index.tsx index daa7151fea..61c600b5a4 100644 --- a/src/components/ui/page/Navigation/index.tsx +++ b/src/components/ui/page/Navigation/index.tsx @@ -15,7 +15,7 @@ function Navigation() { justifyContent="space-between" flexGrow={1} > - + Date: Thu, 18 Apr 2024 22:36:23 -0400 Subject: [PATCH 06/17] centers header content --- src/components/ui/menus/DAOSearch/index.tsx | 2 +- src/components/ui/page/Header/index.tsx | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/ui/menus/DAOSearch/index.tsx b/src/components/ui/menus/DAOSearch/index.tsx index bab64f7f98..f74c08904d 100644 --- a/src/components/ui/menus/DAOSearch/index.tsx +++ b/src/components/ui/menus/DAOSearch/index.tsx @@ -53,7 +53,7 @@ export function DAOSearch({ closeDrawer }: { closeDrawer?: () => void }) { flexDirection="column" justifyContent="center" > - + @@ -134,7 +133,6 @@ function Header() { From 9d8722e74006b877d2438c47dc530d026a491b27 Mon Sep 17 00:00:00 2001 From: David Colon <38386583+Da-Colon@users.noreply.github.com> Date: Thu, 18 Apr 2024 22:40:21 -0400 Subject: [PATCH 07/17] adjust decent logo --- src/components/ui/page/Header/index.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/ui/page/Header/index.tsx b/src/components/ui/page/Header/index.tsx index a2d2956a47..9f8de3a01b 100644 --- a/src/components/ui/page/Header/index.tsx +++ b/src/components/ui/page/Header/index.tsx @@ -44,10 +44,8 @@ function HeaderLogo() { } /> @@ -113,7 +112,7 @@ function HeaderLogo() { aria-hidden h="2.5rem" w="2.125rem" - mx="2rem" + mx="1.75rem" /> From f86e2a0b61c7feeef6a32b1841f3a9554ddc84c4 Mon Sep 17 00:00:00 2001 From: David Colon <38386583+Da-Colon@users.noreply.github.com> Date: Thu, 18 Apr 2024 22:52:38 -0400 Subject: [PATCH 08/17] small header adjustment --- src/components/ui/menus/AccountDisplay/index.tsx | 1 - src/components/ui/menus/FavoritesMenu/index.tsx | 1 - src/components/ui/page/Header/index.tsx | 5 ++++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/ui/menus/AccountDisplay/index.tsx b/src/components/ui/menus/AccountDisplay/index.tsx index 346eba0384..d93a92b90c 100644 --- a/src/components/ui/menus/AccountDisplay/index.tsx +++ b/src/components/ui/menus/AccountDisplay/index.tsx @@ -10,7 +10,6 @@ export function AccountDisplay() { variant="tertiary" data-testid="header-accountMenu" pr="1rem" - my="0.75rem" > diff --git a/src/components/ui/menus/FavoritesMenu/index.tsx b/src/components/ui/menus/FavoritesMenu/index.tsx index 0b01639f87..ae2c18a9b5 100644 --- a/src/components/ui/menus/FavoritesMenu/index.tsx +++ b/src/components/ui/menus/FavoritesMenu/index.tsx @@ -14,7 +14,6 @@ export function FavoritesMenu() { as={MenuButton} variant="tertiary" data-testid="header-favoritesMenuButton" - my="0.75rem" mx="1rem" > diff --git a/src/components/ui/page/Header/index.tsx b/src/components/ui/page/Header/index.tsx index 9f8de3a01b..94e7d822e9 100644 --- a/src/components/ui/page/Header/index.tsx +++ b/src/components/ui/page/Header/index.tsx @@ -15,6 +15,7 @@ import { DecentLogo } from '@decent-org/fractal-ui'; import { useRef } from 'react'; import { useTranslation } from 'react-i18next'; import { Link } from 'react-router-dom'; +import { HEADER_HEIGHT } from '../../../../constants/common'; import { BASE_ROUTES } from '../../../../constants/routes'; import { useFractal } from '../../../../providers/App/AppProvider'; import { AccountDisplay } from '../../menus/AccountDisplay'; @@ -124,8 +125,8 @@ function Header() { @@ -133,7 +134,9 @@ function Header() { From 29ee8b3bd83a25936ca8bf4e79ad82eb5fafad83 Mon Sep 17 00:00:00 2001 From: David Colon <38386583+Da-Colon@users.noreply.github.com> Date: Thu, 18 Apr 2024 23:22:21 -0400 Subject: [PATCH 09/17] add blur to header --- src/components/ui/page/Layout/index.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/ui/page/Layout/index.tsx b/src/components/ui/page/Layout/index.tsx index 389244764e..cf993b2899 100644 --- a/src/components/ui/page/Layout/index.tsx +++ b/src/components/ui/page/Layout/index.tsx @@ -35,6 +35,11 @@ export default function Layout() { *': { + backdropFilter: 'blur(12px)', + }, + }} position="fixed" zIndex={5} w="full" From 805afe1a9da2008e567173ae31989b1c72b4bddd Mon Sep 17 00:00:00 2001 From: David Colon <38386583+Da-Colon@users.noreply.github.com> Date: Fri, 19 Apr 2024 21:22:52 -0400 Subject: [PATCH 10/17] replace `sx` property with `backdropFilter` --- src/components/ui/page/Layout/index.tsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/components/ui/page/Layout/index.tsx b/src/components/ui/page/Layout/index.tsx index cf993b2899..1098e8ac30 100644 --- a/src/components/ui/page/Layout/index.tsx +++ b/src/components/ui/page/Layout/index.tsx @@ -34,12 +34,7 @@ export default function Layout() { *': { - backdropFilter: 'blur(12px)', - }, - }} + backdropFilter="blur(12px)" position="fixed" zIndex={5} w="full" From 0de9cadd6fdd0b4cdcef2784778b17d0d50bf8a8 Mon Sep 17 00:00:00 2001 From: David Colon <38386583+Da-Colon@users.noreply.github.com> Date: Thu, 18 Apr 2024 22:32:30 -0400 Subject: [PATCH 11/17] Update Wallet Menu with new styles --- .../menus/AccountDisplay/MenuItemButton.tsx | 32 ++++---- .../menus/AccountDisplay/MenuItemNetwork.tsx | 43 ++++++++-- .../menus/AccountDisplay/MenuItemWallet.tsx | 79 ++++++++----------- .../ui/menus/AccountDisplay/MenuItems.tsx | 25 +++--- 4 files changed, 97 insertions(+), 82 deletions(-) diff --git a/src/components/ui/menus/AccountDisplay/MenuItemButton.tsx b/src/components/ui/menus/AccountDisplay/MenuItemButton.tsx index 7c869082be..7a47140e44 100644 --- a/src/components/ui/menus/AccountDisplay/MenuItemButton.tsx +++ b/src/components/ui/menus/AccountDisplay/MenuItemButton.tsx @@ -1,5 +1,4 @@ -import { Flex, MenuItem, Text } from '@chakra-ui/react'; -import { Fragment } from 'react'; +import { Box, Button, MenuItem, Text } from '@chakra-ui/react'; /** * Used to display a simple clickable item to the menu. @@ -17,27 +16,24 @@ export function MenuItemButton({ onClick?: () => void; }) { return ( - + + } > - - {label} - - + {label} - + ); } diff --git a/src/components/ui/menus/AccountDisplay/MenuItemNetwork.tsx b/src/components/ui/menus/AccountDisplay/MenuItemNetwork.tsx index b86d21dd58..e8f70f62b7 100644 --- a/src/components/ui/menus/AccountDisplay/MenuItemNetwork.tsx +++ b/src/components/ui/menus/AccountDisplay/MenuItemNetwork.tsx @@ -1,4 +1,5 @@ import { Box, Flex, Select, Text } from '@chakra-ui/react'; +import { CaretDown } from '@phosphor-icons/react'; import { useTranslation } from 'react-i18next'; import { useSwitchChain } from 'wagmi'; import { @@ -17,26 +18,52 @@ export function MenuItemNetwork() { return ( {t('network')} } - borderRadius="4px" - onChange={async e => { - e.preventDefault(); - switchChain({ chainId: Number(e.target.value) }); + - {supportedNetworks.map(network => ( - - ))} - + + ); diff --git a/src/components/ui/menus/AccountDisplay/MenuItemWallet.tsx b/src/components/ui/menus/AccountDisplay/MenuItemWallet.tsx index 8e108b4fd6..7be2251327 100644 --- a/src/components/ui/menus/AccountDisplay/MenuItemWallet.tsx +++ b/src/components/ui/menus/AccountDisplay/MenuItemWallet.tsx @@ -27,9 +27,9 @@ export function MenuItemWallet() { return ( copyTextToClipboard(account)} whiteSpace="pre-wrap" wordBreak="break-all" diff --git a/src/components/ui/menus/AccountDisplay/MenuItems.tsx b/src/components/ui/menus/AccountDisplay/MenuItems.tsx index 2e44b64b59..07f97acd9a 100644 --- a/src/components/ui/menus/AccountDisplay/MenuItems.tsx +++ b/src/components/ui/menus/AccountDisplay/MenuItems.tsx @@ -19,19 +19,11 @@ export function MenuItems() { return ( :nth-of-type(1)': { - borderTopRadius: 'lg', - }, - '& > :last-child': { - borderBottomRadius: 'lg', - }, - }} > {user.address && ( <> diff --git a/src/components/ui/menus/AccountDisplay/index.tsx b/src/components/ui/menus/AccountDisplay/index.tsx index d93a92b90c..a3c975ca6a 100644 --- a/src/components/ui/menus/AccountDisplay/index.tsx +++ b/src/components/ui/menus/AccountDisplay/index.tsx @@ -4,7 +4,7 @@ import { MenuItems } from './MenuItems'; export function AccountDisplay() { return ( - +