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
import { registerOverriddenValidators } from '@medusajs/medusa' | |
import { type Constructor } from '@medusajs/types' | |
type DecoratorFunction = MethodDecorator | PropertyDecorator | |
type ExtensionDefinition = { | |
[key: string]: DecoratorFunction | DecoratorFunction[] | |
} | |
function extendValidator<Base extends Constructor<any>>( |
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
import type RedisCacheService from '@medusajs/cache-redis/dist/services/redis-cache'; | |
import { ProductService as MedusaProductService, Product } from '@medusajs/medusa'; | |
import { CreateProductInput, FindProductConfig, ProductSelector, UpdateProductInput } from '@medusajs/medusa/dist/types/product'; | |
import type { Redis } from 'ioredis'; | |
type InjectedDependencies = { | |
cacheService: RedisCacheService | |
redisClient: Redis | |
} |
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
import { useRef, useState, type ChangeEvent, type DragEvent } from "react"; | |
import { cn } from "~/lib/utils"; | |
type FileUploadProps = { | |
onUpload?: (_files: File[]) => void; | |
accept: string[]; | |
error?: string; | |
className?: string; | |
multiple?: boolean; | |
text?: React.ReactElement | string; |
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
/** @type {import('tailwindcss').Config} */ | |
export default { | |
// Other values... | |
theme: { | |
extend: { | |
keyframes: { | |
svg: { | |
from: { | |
strokeDasharray: "1000", | |
strokeDashoffset: "1000", |
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
import { memo, useEffect, useRef, useState } from 'react' | |
import { useAnimate } from 'framer-motion' | |
import { cn } from '~/utils/cn' | |
/** | |
* @name AnimatedNumberDisplay | |
* @description A component that animates a number from an initial value to a new value | |
* | |
* @param {Object} props - The options for the component | |
* @param {string | number} props.initialValue - The initial value of the number |
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
"use client"; | |
import React, { | |
Fragment, | |
createContext, | |
useContext, | |
type HTMLAttributes, | |
type ReactNode, | |
} from "react"; |
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
import clsx from "clsx"; | |
import { | |
useEffect, | |
useRef, | |
useState, | |
type HTMLAttributes, | |
type ReactNode, | |
type RefObject, | |
} from "react"; |
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
import Link from "next/link"; | |
import { useSearchParams } from "next/navigation"; | |
import type { ComponentProps, MouseEvent } from "react"; | |
type Props = ComponentProps<typeof Link> & { | |
message?: string; | |
}; | |
const LinkWithBeforeUnload = (props: Props) => { | |
const searchParams = useSearchParams(); |
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
const isDev = process.env.NODE_ENV === "development"; | |
const DevIndicator = () => { | |
if (!isDev) { | |
return null; | |
} | |
return ( | |
<> | |
<div className="w-full h-full fixed ring-4 opacity-80 ring-orange-300 ring-inset z-[9999]"></div> |
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
Show hidden characters
{ | |
"Add React className": { | |
"scope": "javascript,javascriptreact,typescriptreact", | |
"prefix": "cn", | |
"body": [ | |
"className='${1}'" | |
], | |
"description": "Quickly add a React className attribute" | |
} | |
} |
NewerOlder