Skip to content

Commit

Permalink
Merge pull request #271 from sima-land/268-product-carousel-finite
Browse files Browse the repository at this point in the history
#268 Изменить ProductInfo в соответствии с переделанными дизайн-гайдами
  • Loading branch information
krutoo authored Jun 18, 2024
2 parents 52ea916 + cb3c920 commit 37e9c60
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function NotEnough() {
price={250.48}
oldPrice={320.96}
currencyGrapheme=''
unavailableReason='Товара нет в наличии'
unavailableReason='Нет в наличии'
/>

<Parts.Title href='https://www.sima-land.ru'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function NotEnoughWaited() {
price={250.48}
oldPrice={320.96}
currencyGrapheme=''
unavailableReason='Товара нет в наличии'
unavailableReason='Нет в наличии'
/>

<Parts.Title href='https://www.sima-land.ru'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function Adult() {
price={250.48}
oldPrice={320.96}
currencyGrapheme=''
unavailableReason='Товар доступен только для юридических лиц'
unavailableReason='Товар для взрослых'
/>

<Parts.Title href='https://www.sima-land.ru'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ describe('ProductInfo', () => {

expect(queryAllByTestId('product-image')).toHaveLength(1);
expect(queryAllByTestId('badge')).toHaveLength(0);
expect(queryAllByTestId('product-info:price')).toHaveLength(1);
expect(queryAllByTestId('product-info:price')).toHaveLength(0);
expect(queryAllByTestId('product-info:old-price')).toHaveLength(0);
expect(queryAllByTestId('product-info:name-link')).toHaveLength(0);
expect(queryAllByTestId('product-info:trademark-link')).toHaveLength(0);
Expand Down
8 changes: 2 additions & 6 deletions src/common/components/product-info/parts/parts.m.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
@use 'node_modules/@sima-land/ui-nucleons/breakpoints';

.text-button {
font-size: 16px;
line-height: 24px;
font-size: 14px;
line-height: 20px;
font-weight: 600;
&:hover,
&:active {
font-weight: 600;
}
@include breakpoints.down('ml') {
font-size: 14px;
line-height: 20px;
}
}
6 changes: 3 additions & 3 deletions src/common/components/product-info/parts/prices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ export function ProductInfoPrices({
const { restriction } = useContext(ProductInfoContext);

const rootClassName = classNames(styles.root, {
[styles['height-limit']]: !restriction || restriction === 'adult',
[styles['height-limit']]: !restriction,
});

return (
<div className={rootClassName} data-testid='product-info:prices'>
{(!restriction || restriction === 'adult') && (
{!restriction && (
<>
<Price
value={price}
Expand All @@ -45,7 +45,7 @@ export function ProductInfoPrices({
</>
)}

{restriction === 'unavailable' && unavailableReason}
{restriction && unavailableReason}
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,5 @@

.root {
margin-top: 8px;
@include breakpoints.down('mm') {
@include rating-counter-util.size-s;
}
@include breakpoints.up('mm') {
@include rating-counter-util.size-m;
}
@include rating-counter-util.size-s;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
@use 'node_modules/@sima-land/ui-nucleons/breakpoints';

.root {
font-size: 16px;
line-height: 24px;
font-size: 14px;
line-height: 20px;
font-weight: 600;
color: colors.$basic-gray24;
@include breakpoints.down('ml') {
font-size: 14px;
line-height: 20px;
}
}
1 change: 1 addition & 0 deletions src/common/components/product-info/product-info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const UNAVAILABLE_REASON = {
notEnough: 'Нет в наличии',
unavailableInRegion: 'Товар недоступен в вашем регионе',
onlyForLegalEntities: 'Товар доступен только для юридических лиц',
adult: 'Товар для взрослых',
} as const;

/**
Expand Down

0 comments on commit 37e9c60

Please sign in to comment.