mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-30 14:12:07 +02:00
snake_case icons and better toast styles
This commit is contained in:
@@ -169,27 +169,43 @@ pub struct RenderHttpRequestResponse {
|
||||
#[ts(export, export_to="events.ts")]
|
||||
pub struct ShowToastRequest {
|
||||
pub message: String,
|
||||
pub variant: ToastVariant,
|
||||
#[ts(optional = nullable)]
|
||||
pub color: Option<Color>,
|
||||
#[ts(optional = nullable)]
|
||||
pub icon: Option<Icon>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[ts(export, export_to="events.ts")]
|
||||
pub enum ToastVariant {
|
||||
pub enum Color {
|
||||
Custom,
|
||||
Copied,
|
||||
Success,
|
||||
Default,
|
||||
Primary,
|
||||
Secondary,
|
||||
Info,
|
||||
Success,
|
||||
Notice,
|
||||
Warning,
|
||||
Error,
|
||||
Danger,
|
||||
}
|
||||
|
||||
impl Default for ToastVariant {
|
||||
impl Default for Color {
|
||||
fn default() -> Self {
|
||||
ToastVariant::Info
|
||||
Color::Default
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[ts(export, export_to="events.ts")]
|
||||
pub enum Icon {
|
||||
Copy,
|
||||
Info,
|
||||
CheckCircle,
|
||||
AlertTriangle,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default, Serialize, Deserialize, TS)]
|
||||
#[serde(default, rename_all = "camelCase")]
|
||||
#[ts(export, export_to="events.ts")]
|
||||
|
||||
Reference in New Issue
Block a user