Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

Chore: Rename Badge variants #381

Merged
merged 3 commits into from
Mar 11, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Implements the expanded mode of `Searchbar` in mobile devices.
- Updates Lighthouse and Cypress URL with valid product links
- `Hero` image responsive sizes for mobile and desktop.
- `Badge` variants names

### Deprecated

Expand Down
2 changes: 1 addition & 1 deletion src/components/cart/CartSidebar/CartSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function CartSidebar() {
<header data-testid="cart-sidebar">
<div className="cart-sidebar__title">
<p className="title-display">Your Cart</p>
<Badge variant="new" small>
<Badge variant="info" small>
{totalItems}
</Badge>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/product/ProductCard/ProductCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function ProductCard({
</div>

{outOfStock ? (
<Badge small variant="outOfStock">
<Badge small variant="neutral">
Out of stock
</Badge>
) : (
Expand Down
2 changes: 1 addition & 1 deletion src/components/search/Suggestions/SuggestionsTopSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const SuggestionsTopSearch = forwardRef<
{searchedItems.map((item, index) => (
<li key={index}>
<Link variant="display" to={item.href}>
<Badge variant="new" small>
<Badge variant="info" small>
{index + 1}
</Badge>
{item.name}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/Badge/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'react'

import './badge.scss'

export type BadgeVariants = 'outOfStock' | 'new' | 'recommended' | 'neutral'
export type BadgeVariants = 'info' | 'highlighted' | 'neutral'

type Props = {
small?: boolean
Expand Down
10 changes: 3 additions & 7 deletions src/components/ui/Badge/badge.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,18 @@
}
}

[data-store-badge-variant="outOfStock"] {
[data-store-badge-variant="neutral"] {
background-color: var(--bg-neutral);
}

[data-store-badge-variant="recommended"] {
[data-store-badge-variant="highlighted"] {
background-color: var(--bg-highlighted);
}

[data-store-badge-variant="new"] {
[data-store-badge-variant="info"] {
background-color: var(--bg-info);
}

[data-store-badge-variant="neutral"] {
background-color: var(--bg-neutral);
}

[data-store-discount-badge-variant="low"] {
background-color: var(--bg-discount-low);
}
Expand Down