-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
73d1a3a
commit 84f1d92
Showing
5 changed files
with
87 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { Action, ActionPanel, List, openCommandPreferences } from "@raycast/api"; | ||
import { showFailureToast } from "@raycast/utils"; | ||
|
||
export default function Command() { | ||
return ( | ||
<List> | ||
<List.Item | ||
title="Default Failure Toast" | ||
actions={ | ||
<ActionPanel> | ||
<Action title="Show Toast" onAction={() => showFailureToast(new Error("Some Error"))} /> | ||
</ActionPanel> | ||
} | ||
/> | ||
<List.Item | ||
title="Failure Toast with Title" | ||
actions={ | ||
<ActionPanel> | ||
<Action | ||
title="Show Toast" | ||
onAction={() => | ||
showFailureToast(new Error("Some Error"), { | ||
title: "Custom Title", | ||
}) | ||
} | ||
/> | ||
</ActionPanel> | ||
} | ||
/> | ||
<List.Item | ||
title="Failure Toast with Custom Action" | ||
actions={ | ||
<ActionPanel> | ||
<Action | ||
title="Show Toast" | ||
onAction={() => | ||
showFailureToast(new Error("Some Error"), { | ||
primaryAction: { | ||
title: "Open Command Preferences", | ||
onAction: () => { | ||
openCommandPreferences(); | ||
}, | ||
}, | ||
}) | ||
} | ||
/> | ||
</ActionPanel> | ||
} | ||
/> | ||
<List.Item | ||
title="Failure Toast with Custom Message" | ||
actions={ | ||
<ActionPanel> | ||
<Action | ||
title="Show Toast" | ||
onAction={() => | ||
showFailureToast(new Error("Some Error"), { | ||
message: "Custom Message", | ||
}) | ||
} | ||
/> | ||
</ActionPanel> | ||
} | ||
/> | ||
</List> | ||
); | ||
} |