feat: update color carrier

This commit is contained in:
2026-05-05 15:07:18 +03:00
parent e3469763ce
commit 6af95bb449
25 changed files with 620 additions and 80 deletions

View File

@@ -121,8 +121,11 @@ export const SightListPage = observer(() => {
}] : []),
];
const { selectedCityId } = selectedCityStore;
const filteredSights = useMemo(() => {
const { selectedCityId } = selectedCityStore;
if (!selectedCityId) {
return [];
}
const allowedCityIds = canReadCities
? null
: authStore.meCities["ru"].map((c) => c.city_id);
@@ -131,12 +134,12 @@ export const SightListPage = observer(() => {
if (allowedCityIds && !allowedCityIds.includes(sight.city_id)) {
return false;
}
if (selectedCityId && sight.city_id !== selectedCityId) {
if (sight.city_id !== selectedCityId) {
return false;
}
return true;
});
}, [sights, selectedCityStore.selectedCityId, canReadCities, authStore.meCities]);
}, [sights, selectedCityId, canReadCities, authStore.meCities]);
const query = searchQuery.trim().toLowerCase();
const rows = filteredSights
@@ -161,6 +164,7 @@ export const SightListPage = observer(() => {
<CreateButton
label="Создать достопримечательность"
path="/sight/create"
disabled={!selectedCityStore.selectedCityId}
/>
)}
</div>
@@ -216,6 +220,8 @@ export const SightListPage = observer(() => {
<Box sx={{ mt: 5, textAlign: "center", color: "text.secondary" }}>
{isLoading ? (
<CircularProgress size={20} />
) : !selectedCityId ? (
"Выберите город"
) : (
"Нет достопримечательностей"
)}