diff --git a/front/src/hooks/api/useAddAnnouncement.ts b/front/src/hooks/api/useAddAnnouncement.ts index af1103f..c8c4158 100644 --- a/front/src/hooks/api/useAddAnnouncement.ts +++ b/front/src/hooks/api/useAddAnnouncement.ts @@ -8,7 +8,7 @@ type AddError = typeof addErrors[number] const isAddError = (obj: unknown): obj is AddError => isLiteralUnion(obj, addErrors) -const buttonStates = ["Опубликовать", "Загрузка", "Опубликовано", "Отменено"] as const +const buttonStates = ["Опубликовать", "Загрузка...", "Опубликовано", "Отменено"] as const type ButtonState = typeof buttonStates[number] | AddError type AddResponse = { @@ -26,14 +26,14 @@ const useAddAnnouncement = () => { const abortControllerRef = useRef() const doAdd = async (formData: FormData) => { - if (status === "Загрузка") { + if (status === "Загрузка...") { abortControllerRef.current?.abort() setStatus("Отменено") timerIdRef.current = setTimeout(() => setStatus("Опубликовать"), 3000) return } - setStatus("Загрузка") + setStatus("Загрузка...") const abortController = new AbortController() abortControllerRef.current = abortController diff --git a/front/src/hooks/api/useBook.ts b/front/src/hooks/api/useBook.ts index de72a3b..f81dd92 100644 --- a/front/src/hooks/api/useBook.ts +++ b/front/src/hooks/api/useBook.ts @@ -13,7 +13,7 @@ const isBookResponse = (obj: unknown): obj is BookResponse => isObject(obj, { "Success": "boolean" }) -type BookStatus = "" | "Загрузка" | "Забронировано" | "Ошибка бронирования" +type BookStatus = "" | "Загрузка..." | "Забронировано" | "Ошибка бронирования" function useBook(id: number) { const navigate = useNavigate() @@ -24,7 +24,7 @@ function useBook(id: number) { const token = getToken() if (token) { - setStatus("Загрузка") + setStatus("Загрузка...") try { diff --git a/front/src/pages/AddPage.tsx b/front/src/pages/AddPage.tsx index df3a28e..b209170 100644 --- a/front/src/pages/AddPage.tsx +++ b/front/src/pages/AddPage.tsx @@ -159,7 +159,7 @@ function AddPage() { {trashboxes.loading ? (
-

Загрузка

+

Загрузка...

) : ( trashboxes.error ? (