+ {label} +
+ > + )} + + {error &&{messageBody}
+
+ A new way
to buy and sell cars
+
{description}
++ <> + " + {text} + " + > +
++ {firstName} {lastName} +
+{`Continue with ${serviceData.name}`}
+ + ); +}; + +export default AuthServiceButton; diff --git a/src/modules/auth/components/services-block.tsx b/src/modules/auth/components/services-block.tsx new file mode 100644 index 0000000000000000000000000000000000000000..41aab2c6cac7a6eae13d1eb68943748ea7f4828b --- /dev/null +++ b/src/modules/auth/components/services-block.tsx @@ -0,0 +1,16 @@ +import React from "react"; +import { ServiceType } from "../../user/models/user/service-type"; +import AuthServiceButton from "./service-button"; + +const AuthServicesBlock = () => { + return ( +{description}
+ + {buttonTitle} + +{question}
+ + {linkTitle} + +{title}
++ © {new Date().getFullYear()} All rights reserved +
++ {children} +
+ + ); +}; + +export default SidebarItem; diff --git a/src/modules/navigation/components/sidebar/components/top-bar/index.tsx b/src/modules/navigation/components/sidebar/components/top-bar/index.tsx deleted file mode 100644 index 163f3291677e676b1bc255fb4edc291e430cb71a..0000000000000000000000000000000000000000 --- a/src/modules/navigation/components/sidebar/components/top-bar/index.tsx +++ /dev/null @@ -1,159 +0,0 @@ -import { - Flex, - Stack, - Text, - IconButton, - ButtonGroup, - Button, - useMediaQuery, - useTheme, - Box, - useDisclosure, -} from "@chakra-ui/react"; -import Link from "next/link"; -import { useRouter } from "next/router"; -import React, { FC, memo, useEffect, useState } from "react"; -import { MdArrowBack, MdMenu } from "react-icons/md"; -import { Person } from "../../../../../../components/header"; -import { useGetMeQuery } from "../../../../../user/hooks/use-get-me-query"; -import friendlyBarNames from "../../../../data/friendly-bar-names"; -import { sidebarItems } from "../../../../data/sidebar-items"; -import AvatarWithMenu from "../../../avatar-with-menu"; -import MobileSidebar from "../../../mobile-sidebar"; -import NotificationBadge from "../../../notification-badge"; - -const SidebarTopBar: FC = () => { - const theme = useTheme(); - const router = useRouter(); - const { isAuthenticated, user } = useGetMeQuery(); - - const { isOpen, onOpen, onClose } = useDisclosure(); - - const [tabTitle, setTabTitle] = useState(""); - const currentTabIds = router.pathname.split("/"); - - useEffect(() => { - [...sidebarItems, ...friendlyBarNames].forEach( - (item, sidebarIndex, arr) => { - if (typeof item === "string") return; - - const index = currentTabIds.findIndex( - (currentTab) => currentTab === item.id - ); - - if (index > -1) { - const value = arr[sidebarIndex]; - - if (typeof value === "string") return; - - setTabTitle(value.title || "unknown"); - } - } - ); - }, [currentTabIds]); - - const goBack = () => { - router.back(); - return; - }; - - const isUniquePage = router.pathname.includes("["); - - const isMobile = useMediaQuery( - `(max-width: ${theme.breakpoints.largePlus})` - )[0]; - - return ( - <> -+ {tabTitle} +
+ ); +}; + +const useTabTitle = () => { + const pathname = useRouter().pathname; + const currentTabIds = pathname.split("/"); + const [tabTitle, setTabTitle] = useState(""); + + useEffect(() => { + [...sidebarItems, ...friendlyBarNames].forEach( + (item, sidebarIndex, arr) => { + if (typeof item === "string") return; + + const index = currentTabIds.findIndex( + (currentTab) => currentTab === item.id + ); + + if (index > -1) { + const value = arr[sidebarIndex]; + if (typeof value === "string") return; + setTabTitle(value.title || "unknown"); + } + } + ); + }, [currentTabIds]); + + return tabTitle; +}; + +export default TopNavigationBarTitle; diff --git a/src/modules/navigation/components/sidebar/components/user-badge.tsx b/src/modules/navigation/components/sidebar/components/user-badge.tsx new file mode 100644 index 0000000000000000000000000000000000000000..a2dc905ba538787c387fe5f0feff719f1e1772f5 --- /dev/null +++ b/src/modules/navigation/components/sidebar/components/user-badge.tsx @@ -0,0 +1,57 @@ +import Link from "next/link"; +import Avatar from "../../../../../components/avatar"; +import { useUser } from "../../../../user/hooks/use-user"; + +const UserBadge = () => { + const { user, query } = useUser(); + + if (!!user && query.isSuccess) { + return ( ++ {user.firstName} {user.lastName} +
+{user.email}
++ Get an FREE account to enjoy all the service features +
++ {mileage} Miles +
+ +
Please try to search another vehicles or apply
different sorting
filters{" "}
-