mirror of
https://github.com/idanoo/autobrr
synced 2025-07-27 18:59:13 +00:00
enhancement(web): mutation improvements and toast updates (#913)
* make notification switch take onToggleMutation Instead of opening it like the edit button, it now enables/disables it directly. * improved toast for update checks * improved toast for download clients it now mentions what client is enabled/disabled * improved irc network toast * added toast when copying apikey * added toast to log download implemented an info variant for the toasts * improved feed toast * improved toast for update checks * Merge branch 'develop' into enhancement/mutation-improvements-toast-updates
This commit is contained in:
parent
96e38e649a
commit
8acf33589d
8 changed files with 68 additions and 20 deletions
|
@ -6,6 +6,8 @@
|
|||
import { useToggle } from "@hooks/hooks";
|
||||
import { CheckIcon, DocumentDuplicateIcon, EyeIcon, EyeSlashIcon } from "@heroicons/react/24/outline";
|
||||
import { useState } from "react";
|
||||
import { toast } from "react-hot-toast";
|
||||
import Toast from "@components/notifications/Toast";
|
||||
|
||||
interface KeyFieldProps {
|
||||
value: string;
|
||||
|
@ -30,12 +32,29 @@ export const KeyField = ({ value }: KeyFieldProps) => {
|
|||
.then(() => {
|
||||
// If successful, update the isCopied state value
|
||||
setIsCopied(true);
|
||||
|
||||
toast.custom(t => (
|
||||
<Toast
|
||||
type="success"
|
||||
body="API key copied to clipboard!"
|
||||
t={t}
|
||||
/>
|
||||
));
|
||||
|
||||
setTimeout(() => {
|
||||
setIsCopied(false);
|
||||
}, 1500);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
|
||||
toast.custom(t => (
|
||||
<Toast
|
||||
type="error"
|
||||
body="Failed to copy API key."
|
||||
t={t}
|
||||
/>
|
||||
));
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue