Link am Betrieb hinzugefügt
This commit is contained in:
@@ -240,7 +240,7 @@ const StoreWatchPage = ({ authorizedFetch, knownStores = [], userLocation }) =>
|
||||
const storeId = String(store.id || store.storeId);
|
||||
const existing = prev.find((entry) => entry.storeId === storeId);
|
||||
if (checked) {
|
||||
if (existing) {
|
||||
if (store.isOpen || existing) {
|
||||
return prev;
|
||||
}
|
||||
setDirty(true);
|
||||
@@ -323,10 +323,27 @@ const StoreWatchPage = ({ authorizedFetch, knownStores = [], userLocation }) =>
|
||||
</div>
|
||||
),
|
||||
cell: ({ row }) => (
|
||||
<div className="flex items-start justify-between gap-3">
|
||||
<div>
|
||||
<p className="font-medium text-gray-900">{row.original.name}</p>
|
||||
<p className="font-medium text-gray-900 flex items-center gap-2">
|
||||
{row.original.name}
|
||||
</p>
|
||||
<p className="text-xs text-gray-500">#{row.original.id}</p>
|
||||
</div>
|
||||
<a
|
||||
href={`https://foodsharing.de/store/${row.original.id}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-gray-400 hover:text-blue-600"
|
||||
title="Store öffnen"
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" className="h-4 w-4" viewBox="0 0 20 20" fill="currentColor">
|
||||
<path d="M12.293 2.293a1 1 0 011.414 0L18 6.586V7a1 1 0 01-1 1h-.586l-3.707-3.707a1 1 0 010-1.414z" />
|
||||
<path d="M3 5a2 2 0 012-2h5a1 1 0 010 2H5v10h10v-5a1 1 0 112 0v5a2 2 0 01-2 2H5a2 2 0 01-2-2V5z" />
|
||||
<path d="M11 3a1 1 0 100 2h2v2a1 1 0 102 0V4a1 1 0 00-1-1h-3z" />
|
||||
</svg>
|
||||
</a>
|
||||
</div>
|
||||
),
|
||||
sortingFn: 'alphanumeric',
|
||||
enableColumnFilter: true,
|
||||
@@ -380,7 +397,7 @@ const StoreWatchPage = ({ authorizedFetch, knownStores = [], userLocation }) =>
|
||||
const label = value
|
||||
? new Date(value).toLocaleDateString('de-DE', { year: 'numeric', month: '2-digit', day: '2-digit' })
|
||||
: '–';
|
||||
return <div className="text-center font-mono text-xs text-gray-600">{label}</div>;
|
||||
return <div className="text-center text-xs text-gray-700 tracking-wide">{label}</div>;
|
||||
},
|
||||
sortingFn: (rowA, rowB, columnId) => {
|
||||
const a = rowA.getValue(columnId);
|
||||
@@ -541,6 +558,7 @@ const StoreWatchPage = ({ authorizedFetch, knownStores = [], userLocation }) =>
|
||||
cell: ({ row }) => {
|
||||
const store = row.original;
|
||||
const checked = watchedIds.has(String(store.id));
|
||||
const disabled = store.isOpen;
|
||||
return (
|
||||
<div className="text-center">
|
||||
<input
|
||||
@@ -548,6 +566,10 @@ const StoreWatchPage = ({ authorizedFetch, knownStores = [], userLocation }) =>
|
||||
className="h-5 w-5"
|
||||
checked={checked}
|
||||
onChange={(event) => handleToggleStore(store, event.target.checked)}
|
||||
disabled={disabled}
|
||||
title={
|
||||
disabled ? 'Store ist bereits offen – Überwachung nicht verfügbar.' : undefined
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user