Skip to content

Commit

Permalink
manage more than 100 insights
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfauquette committed Jan 5, 2025
1 parent 65f1357 commit 84ae578
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
7 changes: 4 additions & 3 deletions src/i18n/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"view": "View",
"edit": "Edit",
"remaining": "Remaining: {{count}}",
"remaining_other": "Remaining: >100",
"hide_images": "Hide images (faster loading)",
"display_images": "Display images",
"annotations": "Annotations",
Expand Down Expand Up @@ -325,7 +326,7 @@
"invalid_image": "Invalid image",
"pictures": {
"picture_date": "Photo uploaded",
"selected_as_nutrients": "Selected as nutriment image ✅",
"selected_as_nutrients": "Selected as nutriment image ✅",
"not_selected_as_nutrients": "Not selected as nutriment ❌"
},
"instructions": {
Expand All @@ -334,7 +335,7 @@
"chose_between_empty_and_partially_filled": "You can chose between products for which OpenFoodFacts (OFF) has no data about the nutrients. Or product with partially filled nutrient table.",
"picture_date_is_display": "The date of the picture is displayed on top of it. Allowing you to check if it's a recent one.",
"nutriments_from_off_are_displayed": "You can display data that are already present in the OFF database. They will appear under the inputs:",
"green_for_same": "With <1>green</1> for those matching with the input value.",
"green_for_same": "With <1>green</1> for those matching with the input value.",
"orange_for_empty": "With <1>orange</1> for those with empty input value.",
"red_for_different": "With <1>red</1> for those with different input value.",
"indicate_not_provided_value": "Empty inputs are ignored. If fibers are not present in the table, you can put \"-\" to specify the value is not available.",
Expand Down Expand Up @@ -394,4 +395,4 @@
"subtitle": "Download"
}
}
}
}
7 changes: 4 additions & 3 deletions src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"view": "View",
"edit": "Edit",
"remaining": "Remaining: {{count}}",
"remaining_other": "Remaining: >100",
"hide_images": "Hide images (faster loading)",
"display_images": "Display images",
"annotations": "Annotations",
Expand Down Expand Up @@ -325,7 +326,7 @@
"invalid_image": "Invalid image",
"pictures": {
"picture_date": "Photo uploaded",
"selected_as_nutrients": "Selected as nutriment image ✅",
"selected_as_nutrients": "Selected as nutriment image ✅",
"not_selected_as_nutrients": "Not selected as nutriment ❌"
},
"instructions": {
Expand All @@ -334,7 +335,7 @@
"chose_between_empty_and_partially_filled": "You can chose between products for which OpenFoodFacts (OFF) has no data about the nutrients. Or product with partially filled nutrient table.",
"picture_date_is_display": "The date of the picture is displayed on top of it. Allowing you to check if it's a recent one.",
"nutriments_from_off_are_displayed": "You can display data that are already present in the OFF database. They will appear under the inputs:",
"green_for_same": "With <1>green</1> for those matching with the input value.",
"green_for_same": "With <1>green</1> for those matching with the input value.",
"orange_for_empty": "With <1>orange</1> for those with empty input value.",
"red_for_different": "With <1>red</1> for those with different input value.",
"indicate_not_provided_value": "Empty inputs are ignored. If fibers are not present in the table, you can put \"-\" to specify the value is not available.",
Expand Down Expand Up @@ -394,4 +395,4 @@
"subtitle": "Download"
}
}
}
}
3 changes: 0 additions & 3 deletions src/pages/nutrition/NutrimentCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ function getLegendColor(productValue, value, productUnit, unit) {
return 'green'
}
return 'red'

// Should never reach that part.
return undefined;
}

export const NutrimentCell = (props: NutrimentCellProps) => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/nutrition/useRobotoffPredictions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export function useRobotoffPredictions(partiallyFilled: boolean) {

const nextItem = React.useCallback(() => {
setInsightIndex((p) => p + 1);
setCount((p) => p - 1);
setCount((p) => p === 100 ? p : p - 1);
}, []);

const insight = insights.data[insightIndex];
Expand Down

0 comments on commit 84ae578

Please sign in to comment.