Skip to content

Commit

Permalink
Merge pull request #142 from VasylievYurii/BloodCircle
Browse files Browse the repository at this point in the history
Fix blood circles in Diary & Product
  • Loading branch information
VasylievYurii authored Nov 20, 2023
2 parents 8e9ddd8 + 1fab5d1 commit fae90de
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/DayProductItem/DayProductItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const DayProductItem = ({ meal, points }) => {
<DiarySupTitle>Recommend</DiarySupTitle>
<ValueBox $maxwidth='76px' display='flex' width={(points < 1440 && points >= 768) ? '80px' : ((points >= 1440) ? '110px' : '100%')}>
<Circle color={`${groupBloodNotAllowed[blood]}`} />
{groupBloodNotAllowed[blood] ? 'Yes' : 'No'}
{groupBloodNotAllowed[blood] ? 'No' : 'Yes'}
</ValueBox>
</DescriptionItem>
<DiaryTrashButton
Expand Down
2 changes: 1 addition & 1 deletion src/components/DayProductItem/DayProductItem.styled.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export const Circle = styled.div`
height: 14px;
border-radius: 10px;
background: ${(props) =>
props.color === 'true' ? 'var(--color-approved-two)': 'var(--color-wrong-two)'|| 'var(--color-back-two)'};
props.color === 'false' ? 'var(--color-approved-two)': 'var(--color-wrong-two)'|| 'var(--color-back-two)'};
`;
5 changes: 2 additions & 3 deletions src/components/ProductsItem/ProductsItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const ProductsItem = ({
}) => {
const [showModal, setShowModal] = useState(false);
const [showModalSuccess, setShowModalSuccess] = useState(false);

console.log('recommended', recommended);
const toggleModal = () => {
setShowModal((prevState) => !prevState);
};
Expand Down Expand Up @@ -57,8 +57,7 @@ const ProductsItem = ({
<LeftTopLabelWrapper>
<p>DIET</p>
</LeftTopLabelWrapper>
<RightTopBlockWrapper>
{/* <RightTopBlockWrapper isrecommended={`${recommended}`}> */}
<RightTopBlockWrapper color={`${recommended}`}>
<div></div>
<p>{recommended ? `Recommended` : `Not recommended`}</p>
<AddButton type="button" onClick={toggleModal}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProductsItem/ProductsItem.styled.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const RightTopBlockWrapper = styled.div`
> div {
background-color: ${(props) =>
Boolean(props.isrecommended)
(props.color === 'true')
? 'var(--color-approved-two)'
: 'var(--color-wrong-two)'};
display: block;
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProductsList/ProductsList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const ProductsList = () => {
const category = useSelector(selectCategoryFilter);
const recommended = useSelector(selectRecommendedFilter);
const blood = useSelector(selectUserBlood);

console.log('blood', blood);
const products = useSelector(selectProducts);
const total = useSelector(selectProductsTotal);

Expand Down

0 comments on commit fae90de

Please sign in to comment.