From fb89e233b62e14c2c3ff15deed4ff4866219c132 Mon Sep 17 00:00:00 2001 From: brunoravera <bruno@process.st> Date: Sat, 2 Mar 2024 12:54:44 -0300 Subject: [PATCH] WIP --- web/src/features/topbar/topbar.tsx | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/web/src/features/topbar/topbar.tsx b/web/src/features/topbar/topbar.tsx index 8db4116..7492170 100644 --- a/web/src/features/topbar/topbar.tsx +++ b/web/src/features/topbar/topbar.tsx @@ -1,23 +1,27 @@ -import { Divider, HStack, Icon, IconButton, Text } from '@chakra-ui/react' +import { Box, Divider, HStack, Icon, IconButton, Text } from '@chakra-ui/react' import { Link, back, routes, useLocation } from '@redwoodjs/router' import React from 'react' import { FaArrowLeft } from 'react-icons/fa' export const Topbar: React.FC = () => { - const asd = useLocation() - console.log({ asd }) + const { pathname } = useLocation() + const handleOnBack = () => { back() } return ( <> - <HStack h="10" w="full" justifyContent="space-between"> - <IconButton - aria-label="back" - variant="unstyled" - onClick={handleOnBack} - icon={<Icon as={FaArrowLeft} />} - /> + <HStack h="10" w="full" justifyContent="space-between" pr="4"> + {pathname !== '/' ? ( + <IconButton + aria-label="back" + variant="unstyled" + onClick={handleOnBack} + icon={<Icon as={FaArrowLeft} />} + /> + ) : ( + <Box /> + )} <Link to={routes.patterns()}> <Text textAlign="right">Patrones</Text> -- GitLab