Skip to content

Instantly share code, notes, and snippets.

View ajayvignesh01's full-sized avatar
💥
Building tradeloop.app

Ajay ajayvignesh01

💥
Building tradeloop.app
View GitHub Profile
@ajayvignesh01
ajayvignesh01 / features-2.tsx
Created April 18, 2024 08:58
Features Component 2 - shadcn/ui
'use client'
// https://ui.shadcn.com/docs/components/accordion
import { Accordion, AccordionContent, AccordionItem } from '@/components/ui/accordion'
// https://ui.shadcn.com/docs/components/card
import { Card, CardContent } from '@/components/ui/card'
// https://ui.shadcn.com/docs/components/carousel
import { Carousel, CarouselApi, CarouselContent, CarouselItem } from '@/components/ui/carousel'
@ajayvignesh01
ajayvignesh01 / features.tsx
Created April 9, 2024 21:52
Features Component - shadcn/ui
'use client'
// https://ui.shadcn.com/docs/components/tabs
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
// https://github.com/shadcn-ui/ui/blob/bf0c8b596bd7fb32daed989cab318430fd4c8919/apps/www/hooks/use-media-query.tsx#L4
import { useMediaQuery } from '@/lib/hooks/use-media-query'
// https://github.com/shadcn-ui/ui/blob/bf0c8b596bd7fb32daed989cab318430fd4c8919/apps/www/lib/utils.ts
import { cn } from '@/lib/utils'
@ajayvignesh01
ajayvignesh01 / Tweet.tsx
Created February 24, 2024 06:03
A Tiptap extension to embed Tweets
import { NodeViewProps, NodeViewWrapper } from '@tiptap/react'
import { nodePasteRule, ReactNodeViewRenderer } from '@tiptap/react'
import { mergeAttributes, Node } from '@tiptap/core'
import { Tweet } from 'react-tweet'
export const TweetComponent = ({ node }: NodeViewProps) => {
const url = node.attrs.url
const tweetIdRegex = /\/status\/(\d+)/g
const id = tweetIdRegex.exec(url)?.[1]