diff --git a/index.html b/index.html index d84e83d..83b682b 100644 --- a/index.html +++ b/index.html @@ -160,7 +160,75 @@ -
+
+ +
+ +
+
+
+ diff --git a/src/components/ProtectedRoute.tsx b/src/components/ProtectedRoute.tsx index e9f4bb0..0310ba3 100644 --- a/src/components/ProtectedRoute.tsx +++ b/src/components/ProtectedRoute.tsx @@ -33,12 +33,10 @@ export const ProtectedRoute: React.FC<{ children: React.ReactNode }> = ({ } }; - if (isAuthenticated) { - checkAuth(); - } else { - setIsChecking(false); - } - }, [dispatch, isAuthenticated]); + // Всегда проверяем статус аутентификации при монтировании, + // независимо от начального состояния Redux (localStorage может быть устаревшим) + checkAuth(); + }, [dispatch]); if (isChecking) { return ; diff --git a/src/components/common/LoadingOverlay.tsx b/src/components/common/LoadingOverlay.tsx index 4eec3be..81c6f89 100644 --- a/src/components/common/LoadingOverlay.tsx +++ b/src/components/common/LoadingOverlay.tsx @@ -4,7 +4,7 @@ export const LoadingOverlay: React.FC = () => { return (
-
Загрузка...
+
); diff --git a/src/styles/style.css b/src/styles/style.css index c984662..a1cb390 100644 --- a/src/styles/style.css +++ b/src/styles/style.css @@ -4866,14 +4866,28 @@ textarea:focus { display: flex; align-items: center; justify-content: center; - min-width: 150px; + min-width: 80px; + min-height: 80px; } -.loading-text { - color: var(--text-color); - font-size: 16px; - font-weight: 500; - text-align: center; +/* Анимированный спиннер */ +.loading-spinner { + width: 50px; + height: 50px; + border: 4px solid transparent; + border-top: 4px solid var(--accent-color, #007bff); + border-right: 4px solid var(--accent-color, #007bff); + border-bottom: 4px solid transparent; + border-left: 4px solid transparent; + border-radius: 50%; + animation: loading-spin 0.8s linear infinite; + opacity: 0.8; +} + +@keyframes loading-spin { + to { + transform: rotate(360deg); + } } /* Темная тема для загрузочного оверлея */