add 🌱 for organic groceries

This commit is contained in:
2025-05-26 12:36:39 +02:00
parent 71b36f7749
commit 1b984d18d9
3 changed files with 9 additions and 4 deletions

View File

@@ -140,7 +140,9 @@ const GroceryList: React.FC = () => {
{groceries.map((grocery) => ( {groceries.map((grocery) => (
<tr key={grocery.id} className="hover:bg-gray-50"> <tr key={grocery.id} className="hover:bg-gray-50">
<td className="px-6 py-4 whitespace-nowrap"> <td className="px-6 py-4 whitespace-nowrap">
<div className="text-sm font-medium text-gray-900">{grocery.name}</div> <div className="text-sm font-medium text-gray-900">
{grocery.name} {grocery.organic ? '🌱' : ''}
</div>
</td> </td>
<td className="px-6 py-4 whitespace-nowrap"> <td className="px-6 py-4 whitespace-nowrap">
<span className="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-blue-100 text-blue-800"> <span className="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-blue-100 text-blue-800">

View File

@@ -190,7 +190,8 @@ const ShoppingEventForm: React.FC = () => {
if (!grocery) return 'Unknown'; if (!grocery) return 'Unknown';
const weightInfo = grocery.weight ? `${grocery.weight}${grocery.weight_unit}` : grocery.weight_unit; const weightInfo = grocery.weight ? `${grocery.weight}${grocery.weight_unit}` : grocery.weight_unit;
return `${grocery.name} ${weightInfo}`; const organicEmoji = grocery.organic ? ' 🌱' : '';
return `${grocery.name}${organicEmoji} ${weightInfo}`;
}; };
if (loadingEvent) { if (loadingEvent) {
@@ -282,7 +283,7 @@ const ShoppingEventForm: React.FC = () => {
<option value={0}>Select a grocery</option> <option value={0}>Select a grocery</option>
{groceries.map(grocery => ( {groceries.map(grocery => (
<option key={grocery.id} value={grocery.id}> <option key={grocery.id} value={grocery.id}>
{grocery.name} ({grocery.category}) {grocery.weight ? `${grocery.weight}${grocery.weight_unit}` : grocery.weight_unit} {grocery.name}{grocery.organic ? '🌱' : ''} ({grocery.category}) {grocery.weight ? `${grocery.weight}${grocery.weight_unit}` : grocery.weight_unit}
</option> </option>
))} ))}
</select> </select>

View File

@@ -115,7 +115,9 @@ const ShoppingEventList: React.FC = () => {
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-2"> <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-2">
{event.groceries.map((grocery) => ( {event.groceries.map((grocery) => (
<div key={grocery.id} className="bg-gray-50 rounded px-3 py-2"> <div key={grocery.id} className="bg-gray-50 rounded px-3 py-2">
<div className="text-sm text-gray-900">{grocery.name}</div> <div className="text-sm text-gray-900">
{grocery.name} {grocery.organic ? '🌱' : ''}
</div>
<div className="text-xs text-gray-600"> <div className="text-xs text-gray-600">
{grocery.amount} × ${grocery.price.toFixed(2)} = ${(grocery.amount * grocery.price).toFixed(2)} {grocery.amount} × ${grocery.price.toFixed(2)} = ${(grocery.amount * grocery.price).toFixed(2)}
</div> </div>