snake_case icons and better toast styles

This commit is contained in:
Gregory Schier
2024-09-20 07:30:11 -07:00
parent a18271d306
commit 93633875ac
55 changed files with 309 additions and 262 deletions

View File

@@ -15,7 +15,8 @@ export function useCopy({ disableToast }: { disableToast?: boolean } = {}) {
if (text != '' && !disableToast) {
toast.show({
id: 'copied',
variant: 'copied',
color: 'secondary',
icon: 'copy',
message: 'Copied to clipboard',
});
}

View File

@@ -1,7 +1,7 @@
import { useMemo } from 'react';
import type { DropdownItem } from '../components/core/Dropdown';
import { Icon } from '../components/core/Icon';
import { BODY_TYPE_GRAPHQL } from '../lib/models';
import { BODY_TYPE_GRAPHQL } from '../lib/model_util';
import { useCreateFolder } from './useCreateFolder';
import { useCreateGrpcRequest } from './useCreateGrpcRequest';
import { useCreateHttpRequest } from './useCreateHttpRequest';

View File

@@ -33,7 +33,7 @@ export function useExportData() {
activeWorkspace={activeWorkspace}
onSuccess={() => {
toast.show({
variant: 'success',
color: 'success',
message: 'Data export successful',
});
}}

View File

@@ -39,7 +39,7 @@ export function useImportCurl() {
}
toast.show({
variant: 'success',
color: 'success',
message: `${verb} request from Curl`,
});
},

View File

@@ -51,7 +51,7 @@ export function useImportQuerystring(requestId: string) {
if (additionalUrlParameters.length > 0) {
toast.show({
id: 'querystring-imported',
variant: 'info',
color: 'info',
message: `Imported ${additionalUrlParameters.length} ${pluralize('param', additionalUrlParameters.length)} from URL`,
});
}

View File

@@ -1,4 +1,4 @@
import { isResponseLoading } from '../lib/models';
import { isResponseLoading } from '../lib/model_util';
import { useLatestHttpResponse } from './useLatestHttpResponse';
export function useIsResponseLoading(requestId: string | null): boolean {

View File

@@ -27,7 +27,7 @@ export function useNotificationToast() {
id: payload.id,
timeout: null,
message: payload.message,
variant: 'custom',
color: 'custom',
onClose: () => markRead(payload.id),
action:
actionLabel && actionUrl ? (

View File

@@ -5,7 +5,7 @@ import slugify from 'slugify';
import { InlineCode } from '../components/core/InlineCode';
import { useToast } from '../components/ToastContext';
import type { HttpResponse } from '@yaakapp/api';
import { getContentTypeHeader } from '../lib/models';
import { getContentTypeHeader } from '../lib/model_util';
import { getHttpRequest } from '../lib/store';
import { invokeCmd } from '../lib/tauri';