diff --git a/web/src/features/topbar/topbar.tsx b/web/src/features/topbar/topbar.tsx index 8db41162dd7dd0764b8fba73d94e8ae7eb1b95a5..74921709c775d8e2e2d8931363151e453ee5c75c 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>