Исправлены отступы в списке слов
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 56s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 56s
This commit is contained in:
@@ -89,42 +89,28 @@ function DictionaryList({ onNavigate, refreshTrigger = 0 }) {
|
||||
setSelectedDictionary(null)
|
||||
}
|
||||
|
||||
// Показываем загрузку только при первой инициализации и если нет данных для отображения
|
||||
const shouldShowLoading = loading && !isInitializedRef.current && dictionaries.length === 0
|
||||
|
||||
if (shouldShowLoading) {
|
||||
return (
|
||||
<div className="dictionary-list">
|
||||
<div className="fixed inset-0 bottom-20 flex justify-center items-center">
|
||||
<div className="flex flex-col items-center">
|
||||
<div className="w-12 h-12 border-4 border-indigo-200 border-t-indigo-600 rounded-full animate-spin mb-4"></div>
|
||||
<div className="text-gray-600 font-medium">Загрузка...</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
if (error) {
|
||||
return (
|
||||
<div className="dictionary-list">
|
||||
<LoadingError onRetry={fetchDictionaries} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="dictionary-list">
|
||||
{/* Кнопка закрытия */}
|
||||
<button
|
||||
<button
|
||||
className="dictionary-close-button"
|
||||
onClick={() => onNavigate?.('profile')}
|
||||
title="Закрыть"
|
||||
>
|
||||
✕
|
||||
</button>
|
||||
|
||||
<div className="dictionaries-grid">
|
||||
{/* Показываем загрузку только при первой инициализации и если нет данных для отображения */}
|
||||
{loading && !isInitializedRef.current && dictionaries.length === 0 ? (
|
||||
<div className="fixed inset-0 bottom-20 flex justify-center items-center">
|
||||
<div className="flex flex-col items-center">
|
||||
<div className="w-12 h-12 border-4 border-indigo-200 border-t-indigo-600 rounded-full animate-spin mb-4"></div>
|
||||
<div className="text-gray-600 font-medium">Загрузка...</div>
|
||||
</div>
|
||||
</div>
|
||||
) : error ? (
|
||||
<LoadingError onRetry={fetchDictionaries} />
|
||||
) : (
|
||||
<div className="dictionaries-grid">
|
||||
{dictionaries.map((dict) => (
|
||||
<div
|
||||
key={dict.id}
|
||||
@@ -151,7 +137,8 @@ function DictionaryList({ onNavigate, refreshTrigger = 0 }) {
|
||||
<div className="add-dictionary-icon">+</div>
|
||||
<div className="add-dictionary-text">Добавить</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{selectedDictionary && (
|
||||
<div className="dictionary-modal-overlay" onClick={closeDictionaryModal}>
|
||||
|
||||
Reference in New Issue
Block a user