Skip to content

Commit

Permalink
Link element instead of Button
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl-OW committed Nov 11, 2024
1 parent 8ad26fc commit 4011dc2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 31 deletions.
21 changes: 0 additions & 21 deletions src/components/Breadcrumb/_breadcrumb.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,3 @@
font-stretch: normal;
line-height: 1.25;
}

.ssb-breadcrumbs .breadcrumb-item + .breadcrumb-item::before {
content: none !important;
}

.breadcrumb-button {
cursor: pointer;
color: inherit;
text-decoration: none;
background: none;
border: none;
padding: 0;
font-size: 16px;
font-family: 'Open Sans', sans-serif;

&:focus {
outline: 2px solid rgb(146 114 252 / 100%);
outline-offset: 4px;
border-radius: 2px;
}
}
13 changes: 3 additions & 10 deletions src/components/Breadcrumb/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,12 @@ const Breadcrumb = ({ className, items, mobileCompressedView = false }) => {

const shouldShowCompressed = isMobile && mobileCompressedView && items.length > 1

const handleNavigation = (link) => {
window.location.href = link
}

return (
<div className={`ssb-breadcrumbs${className ? ` ${className}` : ''}`}>
{shouldShowCompressed ? (
<div className='breadcrumb-item' style={{ display: 'flex', alignItems: 'center' }}>
<ArrowLeft style={{ color: '#00824d', marginRight: '10px' }} />
<button onClick={() => handleNavigation(items[items.length - 2].link)} className='breadcrumb-button'>
{items[items.length - 2].text}
</button>
</div>
<Link href={items[items.length - 2].link} icon={<ArrowLeft size={20} />}>
{items[items.length - 2].text}
</Link>
) : (
<>
{items.slice(0, -1).map((item) => (
Expand Down

0 comments on commit 4011dc2

Please sign in to comment.