mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 03:29:16 +01:00
refactor: ♻️ Refactor toaster code for more accessibility and better UI
This commit is contained in:
parent
2b14813555
commit
5e6e881b98
14 changed files with 96 additions and 151 deletions
|
|
@ -29,7 +29,7 @@ export const useCacheRefresh = (client: MaybeRef<LysandClient | null>) => {
|
|||
useEvent("notification:new", {
|
||||
type: "error",
|
||||
title: "Your session has expired",
|
||||
message:
|
||||
description:
|
||||
"You have been logged out. Please log in again.",
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ export const useClient = (
|
|||
useEvent("notification:new", {
|
||||
title: "An error occured",
|
||||
type: "error",
|
||||
message:
|
||||
description:
|
||||
error.response.data.error ??
|
||||
"No error message provided",
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,14 +1,11 @@
|
|||
import type { createToaster } from "@ark-ui/vue";
|
||||
import type { Attachment, Status } from "@lysand-org/client/types";
|
||||
import mitt from "mitt";
|
||||
import type { Identity } from "./Identities";
|
||||
|
||||
export type NotificationEvent = {
|
||||
type: "error" | "success" | "progress";
|
||||
title: string;
|
||||
message?: string;
|
||||
persistent?: boolean;
|
||||
onDismiss?: () => void;
|
||||
};
|
||||
export type NotificationEvent = Parameters<
|
||||
ReturnType<typeof createToaster>["create"]
|
||||
>[0];
|
||||
|
||||
type ApplicationEvents = {
|
||||
"note:reply": Status;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue