Refactor alerts to TypeScript, remove react-notification
dependency (#34239)
This commit is contained in:
parent
e1dbbf6c9d
commit
94d71c992e
14 changed files with 171 additions and 121 deletions
14
app/javascript/mastodon/models/alert.ts
Normal file
14
app/javascript/mastodon/models/alert.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
import type { MessageDescriptor } from 'react-intl';
|
||||
|
||||
export type TranslatableString = string | MessageDescriptor;
|
||||
|
||||
export type TranslatableValues = Record<string, string | number | Date>;
|
||||
|
||||
export interface Alert {
|
||||
key: number;
|
||||
title?: TranslatableString;
|
||||
message: TranslatableString;
|
||||
action?: TranslatableString;
|
||||
values?: TranslatableValues;
|
||||
onClick?: () => void;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue