Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mgmman committed Nov 23, 2024
1 parent 2c68c6a commit c8a15c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Pages/offer-page/offer-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function OfferPage(): React.JSX.Element {
<Rating
rating={currentOffer.rating}
usePlace="offer"
isInOffer
showRatingValue
/>
<ul className="offer__features">
<li className="offer__feature offer__feature--entire">
Expand Down
6 changes: 3 additions & 3 deletions src/components/rating.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import React from 'react';
interface RatingProps {
rating: number;
usePlace: string;
isInOffer?: boolean;
showRatingValue?: boolean;
}

export function Rating({
rating,
isInOffer,
showRatingValue,
usePlace,
}: RatingProps): React.JSX.Element {
return (
Expand All @@ -17,7 +17,7 @@ export function Rating({
<span style={{ width: `${Math.round(rating) * 20}%` }}></span>
<span className="visually-hidden">Rating</span>
</div>
{isInOffer && (
{showRatingValue && (
<span className="offer__rating-value rating__value">{rating}</span>
)}
</div>
Expand Down

0 comments on commit c8a15c2

Please sign in to comment.