Added ellipsis to loading status string
This commit is contained in:
parent
619fd952a5
commit
d041df0bbd
@ -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<AbortController>()
|
||||
|
||||
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
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -159,7 +159,7 @@ function AddPage() {
|
||||
{trashboxes.loading
|
||||
? (
|
||||
<div style={{ height: 400 }}>
|
||||
<p>Загрузка</p>
|
||||
<p>Загрузка...</p>
|
||||
</div>
|
||||
) : (
|
||||
trashboxes.error ? (
|
||||
|
Loading…
x
Reference in New Issue
Block a user