mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-18 23:44:12 +01:00
Fix body change setting headers/method
This commit is contained in:
@@ -55,7 +55,6 @@ export const placeholders = function (variables: { name: string }[]) {
|
||||
}
|
||||
|
||||
const isFunction = groupMatch.includes('(');
|
||||
console.log('VAIRABLES', variables, groupMatch);
|
||||
return Decoration.replace({
|
||||
inclusive: true,
|
||||
widget: new PlaceholderWidget(
|
||||
|
||||
@@ -15,10 +15,11 @@ export interface ToastProps {
|
||||
className?: string;
|
||||
timeout: number | null;
|
||||
action?: ReactNode;
|
||||
variant?: 'copied' | 'success' | 'info' | 'warning' | 'error';
|
||||
variant?: 'custom' | 'copied' | 'success' | 'info' | 'warning' | 'error';
|
||||
}
|
||||
|
||||
const ICONS: Record<NonNullable<ToastProps['variant']>, IconProps['icon']> = {
|
||||
const ICONS: Record<NonNullable<ToastProps['variant']>, IconProps['icon'] | null> = {
|
||||
custom: null,
|
||||
copied: 'copyCheck',
|
||||
warning: 'alert',
|
||||
error: 'alert',
|
||||
@@ -33,7 +34,7 @@ export function Toast({
|
||||
onClose,
|
||||
timeout,
|
||||
action,
|
||||
variant,
|
||||
variant = 'info',
|
||||
}: ToastProps) {
|
||||
useKey(
|
||||
'Escape',
|
||||
@@ -45,6 +46,8 @@ export function Toast({
|
||||
[open],
|
||||
);
|
||||
|
||||
const icon = variant in ICONS && ICONS[variant];
|
||||
|
||||
return (
|
||||
<motion.div
|
||||
initial={{ opacity: 0, right: '-10%' }}
|
||||
@@ -65,9 +68,9 @@ export function Toast({
|
||||
)}
|
||||
>
|
||||
<div className="px-3 py-3 flex items-center gap-2">
|
||||
{variant != null && (
|
||||
{icon && (
|
||||
<Icon
|
||||
icon={ICONS[variant]}
|
||||
icon={icon}
|
||||
className={classNames(
|
||||
variant === 'success' && 'text-fg-success',
|
||||
variant === 'warning' && 'text-fg-warning',
|
||||
|
||||
Reference in New Issue
Block a user