feat(dashboard,ui): Streamline spacing and sizing (#6061)

This commit is contained in:
Kasper Fabricius Kristensen
2024-01-15 11:43:16 +01:00
committed by GitHub
parent 5dacd4ac9f
commit a2c149e7e5
266 changed files with 10738 additions and 4646 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,20 @@
type Options = {
leading?: boolean
}
export const debounce = (
func: (...args: any[]) => void,
delay: number,
{ leading }: Options = {}
): ((...args: any[]) => void) => {
let timerId: NodeJS.Timeout | undefined
return (...args) => {
if (!timerId && leading) {
func(...args)
}
clearTimeout(timerId)
timerId = setTimeout(() => func(...args), delay)
}
}
@@ -0,0 +1,5 @@
import type { AxiosError } from "axios"
export const isAxiosError = (error: any): error is AxiosError => {
return error.isAxiosError
}
@@ -1,6 +1,9 @@
import Medusa from "@medusajs/medusa-js"
import { QueryClient } from "@tanstack/react-query"
export const MEDUSA_BACKEND_URL =
import.meta.env.VITE_MEDUSA_ADMIN_BACKEND_URL || "http://localhost:9000"
export const queryClient = new QueryClient({
defaultOptions: {
queries: {
@@ -12,6 +15,6 @@ export const queryClient = new QueryClient({
})
export const medusa = new Medusa({
baseUrl: "http://localhost:9000",
maxRetries: 3,
baseUrl: MEDUSA_BACKEND_URL,
maxRetries: 1,
})