From 464e7f394fe42ad836333e185d4d2a6c120d7d86 Mon Sep 17 00:00:00 2001 From: Diogo Soares <32431609+DiogoSoaress@users.noreply.github.com> Date: Thu, 26 Sep 2024 14:14:38 +0200 Subject: [PATCH] styles: update Breadcrumbs style --- src/components/Blog/BreadcrumbsNav/index.tsx | 31 +++++++------------ .../Blog/BreadcrumbsNav/styles.module.css | 26 +++++++++------- 2 files changed, 26 insertions(+), 31 deletions(-) diff --git a/src/components/Blog/BreadcrumbsNav/index.tsx b/src/components/Blog/BreadcrumbsNav/index.tsx index 47014b9a5..31e3b2ea6 100644 --- a/src/components/Blog/BreadcrumbsNav/index.tsx +++ b/src/components/Blog/BreadcrumbsNav/index.tsx @@ -1,13 +1,12 @@ +import type { ReactNode } from 'react' +import type { UrlObject } from 'url' import { Breadcrumbs, Typography } from '@mui/material' import Link from 'next/link' -import css from './styles.module.css' -import { type UrlObject } from 'url' -import CategoryIcon from '@/public/images/Blog/category-icon.svg' -import { type ReactNode } from 'react' import { AppRoutes } from '@/config/routes' +import AngleIcon from '@/public/images/angle-icon.svg' +import css from './styles.module.css' -const TYPOGRAPHY_VARIANT = 'caption' -const TYPOGRAPHY_COLOR = 'text.primary' +const TYPOGRAPHY_VARIANT = 'body2' type BreadcrumbsType = { category: string @@ -16,30 +15,24 @@ type BreadcrumbsType = { const createBreadcrumb = (key: string, text: ReactNode, linkProps: string | UrlObject) => ( - - {text} - + {text} ) const BreadcrumbsNav = ({ category, title }: BreadcrumbsType) => { const breadcrumbs = [ createBreadcrumb('1', 'Blog', { pathname: AppRoutes.blog.index }), - createBreadcrumb( - '2', -
- - {category} -
, - { pathname: AppRoutes.blog.index, query: { category } }, - ), - + createBreadcrumb('2', <>{category}, { + pathname: AppRoutes.blog.index, + query: { category }, + }), + {title} , ] return ( - + } className={css.breadcrumbs}> {breadcrumbs} ) diff --git a/src/components/Blog/BreadcrumbsNav/styles.module.css b/src/components/Blog/BreadcrumbsNav/styles.module.css index 688b20cbb..4406e5276 100644 --- a/src/components/Blog/BreadcrumbsNav/styles.module.css +++ b/src/components/Blog/BreadcrumbsNav/styles.module.css @@ -1,23 +1,25 @@ -.breadcrumbs, +.breadcrumbs li { + display: flex; + align-items: center; +} + .breadcrumbs a { - color: var(--mui-palette-text-primary); - margin-bottom: 24px; + transition-duration: var(--transition-duration); } .breadcrumbs a:hover { + color: var(--mui-palette-text-primary); text-decoration: underline; } .breadcrumbs :global .MuiBreadcrumbs-separator { - margin: 0 4px; -} - -.breadcrumbs :global .MuiTypography-root { - line-height: inherit; + width: 8px; + height: 8px; } -.category { - display: flex; - gap: 4px; - align-items: center; +.title { + width: 290px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; }