mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
show alert on error
This commit is contained in:
@@ -1,9 +1,10 @@
|
|||||||
import { Trans } from "@lingui/macro"
|
import { Trans } from "@lingui/macro"
|
||||||
import { Button, Group, Stack, Textarea } from "@mantine/core"
|
import { Box, Button, Group, Stack, Textarea } from "@mantine/core"
|
||||||
import { useForm } from "@mantine/form"
|
import { useForm } from "@mantine/form"
|
||||||
import { client } from "app/client"
|
import { client, errorToStrings } from "app/client"
|
||||||
import { redirectToSelectedSource } from "app/slices/redirect"
|
import { redirectToSelectedSource } from "app/slices/redirect"
|
||||||
import { useAppDispatch, useAppSelector } from "app/store"
|
import { useAppDispatch, useAppSelector } from "app/store"
|
||||||
|
import { Alert } from "components/Alert"
|
||||||
import { useEffect } from "react"
|
import { useEffect } from "react"
|
||||||
import { useAsyncCallback } from "react-async-hook"
|
import { useAsyncCallback } from "react-async-hook"
|
||||||
import { TbDeviceFloppy } from "react-icons/tb"
|
import { TbDeviceFloppy } from "react-icons/tb"
|
||||||
@@ -40,6 +41,13 @@ export function CustomCss() {
|
|||||||
}, [setValues, customCss])
|
}, [setValues, customCss])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
|
{saveCustomCss.error && (
|
||||||
|
<Box mb="md">
|
||||||
|
<Alert messages={errorToStrings(saveCustomCss.error)} />
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
|
|
||||||
<form onSubmit={form.onSubmit(saveCustomCss.execute)}>
|
<form onSubmit={form.onSubmit(saveCustomCss.execute)}>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Textarea
|
<Textarea
|
||||||
@@ -64,5 +72,6 @@ export function CustomCss() {
|
|||||||
</Group>
|
</Group>
|
||||||
</Stack>
|
</Stack>
|
||||||
</form>
|
</form>
|
||||||
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user