From f4459af56d125949dd621e4f27523f1ffca4ec23 Mon Sep 17 00:00:00 2001 From: deewakar Date: Wed, 20 Nov 2024 11:19:53 +0530 Subject: [PATCH] refac: dirs --- apps/frontend/components/ui/select.tsx | 164 ------------------ .../src/components/Dropdown/Dropdown.tsx | 2 +- apps/frontend/src/components/Icon.tsx | 2 +- .../Inbox/RescheduleCalendar/Calendar.tsx | 2 +- .../frontend/src/components/InboxTextArea.tsx | 16 -- apps/frontend/src/components/Skeleton.tsx | 2 +- apps/frontend/src/components/Surface.tsx | 2 +- .../frontend/src/components/TodayMeetings.tsx | 57 ------ apps/frontend/src/components/atoms/Select.tsx | 2 +- apps/frontend/src/components/atoms/Switch.tsx | 2 +- .../frontend/src/components/atoms/Tooltip.tsx | 2 +- apps/frontend/src/components/ui/button.tsx | 2 +- apps/frontend/src/components/ui/calendar.tsx | 2 +- .../src/components/{atoms => }/ui/card.tsx | 2 +- .../src/components/ui/context-menu.tsx | 2 +- apps/frontend/src/components/ui/dialog.tsx | 2 +- apps/frontend/src/components/ui/dropdown.tsx | 2 +- apps/frontend/src/components/ui/input.tsx | 2 +- apps/frontend/src/components/ui/popover.tsx | 2 +- .../src/components/{atoms => }/ui/select.tsx | 2 +- apps/frontend/src/components/ui/textarea.tsx | 2 +- apps/frontend/src/components/ui/toast.tsx | 2 +- .../src/extensions/SlashCommand/MenuList.tsx | 2 +- apps/frontend/{lib => src/utils}/utils.ts | 0 24 files changed, 20 insertions(+), 257 deletions(-) delete mode 100644 apps/frontend/components/ui/select.tsx delete mode 100644 apps/frontend/src/components/TodayMeetings.tsx rename apps/frontend/src/components/{atoms => }/ui/card.tsx (98%) rename apps/frontend/src/components/{atoms => }/ui/select.tsx (99%) rename apps/frontend/{lib => src/utils}/utils.ts (100%) diff --git a/apps/frontend/components/ui/select.tsx b/apps/frontend/components/ui/select.tsx deleted file mode 100644 index 825d38d0b..000000000 --- a/apps/frontend/components/ui/select.tsx +++ /dev/null @@ -1,164 +0,0 @@ -"use client" - -import * as React from "react" - -import * as SelectPrimitive from "@radix-ui/react-select" -import { Check, ChevronDown, ChevronUp } from "lucide-react" - -import { cn } from "@/lib/utils" - -const Select = SelectPrimitive.Root - -const SelectGroup = SelectPrimitive.Group - -const SelectValue = SelectPrimitive.Value - -const SelectTrigger = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, children, ...props }, ref) => ( - span]:line-clamp-1 dark:border-neutral-800 dark:bg-neutral-950 dark:ring-offset-neutral-950 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-300", - className - )} - {...props} - > - {children} - - - - -)) -SelectTrigger.displayName = SelectPrimitive.Trigger.displayName - -const SelectScrollUpButton = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - - - -)) -SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName - -const SelectScrollDownButton = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - - - -)) -SelectScrollDownButton.displayName = - SelectPrimitive.ScrollDownButton.displayName - -const SelectContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, children, position = "popper", ...props }, ref) => ( - - - - - {children} - - - - -)) -SelectContent.displayName = SelectPrimitive.Content.displayName - -const SelectLabel = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) -SelectLabel.displayName = SelectPrimitive.Label.displayName - -const SelectItem = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, children, ...props }, ref) => ( - - - - - - - - {children} - -)) -SelectItem.displayName = SelectPrimitive.Item.displayName - -const SelectSeparator = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) -SelectSeparator.displayName = SelectPrimitive.Separator.displayName - -export { - Select, - SelectGroup, - SelectValue, - SelectTrigger, - SelectContent, - SelectLabel, - SelectItem, - SelectSeparator, - SelectScrollUpButton, - SelectScrollDownButton, -} diff --git a/apps/frontend/src/components/Dropdown/Dropdown.tsx b/apps/frontend/src/components/Dropdown/Dropdown.tsx index 31267ba27..86ee0ba20 100644 --- a/apps/frontend/src/components/Dropdown/Dropdown.tsx +++ b/apps/frontend/src/components/Dropdown/Dropdown.tsx @@ -1,6 +1,6 @@ import React from "react" -import { cn } from "@/lib/utils" +import { cn } from "@/src/utils/utils" export const DropdownCategoryTitle = ({ children, diff --git a/apps/frontend/src/components/Icon.tsx b/apps/frontend/src/components/Icon.tsx index 92b97315e..3e0b4eb39 100644 --- a/apps/frontend/src/components/Icon.tsx +++ b/apps/frontend/src/components/Icon.tsx @@ -2,7 +2,7 @@ import { memo } from "react" import { icons } from "lucide-react" -import { cn } from "../../lib/utils" +import { cn } from "@/src/utils/utils" export interface IconProps { name: keyof typeof icons diff --git a/apps/frontend/src/components/Inbox/RescheduleCalendar/Calendar.tsx b/apps/frontend/src/components/Inbox/RescheduleCalendar/Calendar.tsx index d135e93ba..b98feb4be 100644 --- a/apps/frontend/src/components/Inbox/RescheduleCalendar/Calendar.tsx +++ b/apps/frontend/src/components/Inbox/RescheduleCalendar/Calendar.tsx @@ -5,7 +5,7 @@ import { DayPicker } from "react-day-picker" import { ChevronLeftIcon, ChevronRightIcon } from "@radix-ui/react-icons" -import { cn } from "@/lib/utils" +import { cn } from "@/src/utils/utils" export type CalendarProps = React.ComponentProps diff --git a/apps/frontend/src/components/InboxTextArea.tsx b/apps/frontend/src/components/InboxTextArea.tsx index 042955336..e69de29bb 100644 --- a/apps/frontend/src/components/InboxTextArea.tsx +++ b/apps/frontend/src/components/InboxTextArea.tsx @@ -1,16 +0,0 @@ -import { useState } from "react" - -import TextEditor from "./atoms/Editor" -import useEditorHook from "../hooks/useEditor.hook" - -export const InboxTextArea = (): JSX.Element => { - const [content, setContent] = useState("

") - const [isSaved, setIsSaved] = useState(false) - const editor = useEditorHook({ - content, - setContent, - setIsSaved, - placeholder: "press / for markdown format", - }) - return -} diff --git a/apps/frontend/src/components/Skeleton.tsx b/apps/frontend/src/components/Skeleton.tsx index 01b8b6d4f..7c8f62e54 100644 --- a/apps/frontend/src/components/Skeleton.tsx +++ b/apps/frontend/src/components/Skeleton.tsx @@ -1,4 +1,4 @@ -import { cn } from "@/lib/utils" +import { cn } from "../utils/utils" function Skeleton({ className, diff --git a/apps/frontend/src/components/Surface.tsx b/apps/frontend/src/components/Surface.tsx index e24d69081..18ed75786 100644 --- a/apps/frontend/src/components/Surface.tsx +++ b/apps/frontend/src/components/Surface.tsx @@ -1,6 +1,6 @@ import { HTMLProps, forwardRef } from "react" -import { cn } from "../../lib/utils" +import { cn } from "@/src/utils/utils" export type SurfaceProps = HTMLProps & { withShadow?: boolean diff --git a/apps/frontend/src/components/TodayMeetings.tsx b/apps/frontend/src/components/TodayMeetings.tsx deleted file mode 100644 index ac1f02827..000000000 --- a/apps/frontend/src/components/TodayMeetings.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import React, { useCallback, useEffect } from "react" - -import { useAuth } from "../contexts/AuthContext" -import { Event } from "../lib/@types/Items/event" -import { useEventsStore } from "../lib/store/events.store" - -interface TodayAgendaProps { - selectedDate: Date -} - -interface AgendaItem { - title: string -} - -export const TodayMeetings: React.FC = ({ selectedDate }) => { - const { session } = useAuth() - const { events, fetchEventsByDate, currentEvent, setCurrentEvent } = - useEventsStore() - - useEffect(() => { - fetchEventsByDate(session, selectedDate.toISOString()) - }, [fetchEventsByDate, selectedDate]) - - { - /* if (isLoading) { - return ( -
    -
  1. - -
  2. -
- ) - } */ - } - - const handleExpand = (item: Event) => { - if (!currentEvent || currentEvent.id !== item.id) { - setCurrentEvent(item) - } - } - - return ( -
- {events.map((item, index) => ( - - ))} -
- ) -} diff --git a/apps/frontend/src/components/atoms/Select.tsx b/apps/frontend/src/components/atoms/Select.tsx index b09133000..4e822944c 100644 --- a/apps/frontend/src/components/atoms/Select.tsx +++ b/apps/frontend/src/components/atoms/Select.tsx @@ -4,7 +4,7 @@ import { SelectItem, SelectTrigger, SelectValue, -} from "./ui/select" +} from "../ui/select" interface Props { placeholder: string diff --git a/apps/frontend/src/components/atoms/Switch.tsx b/apps/frontend/src/components/atoms/Switch.tsx index af03d0237..e026f1381 100644 --- a/apps/frontend/src/components/atoms/Switch.tsx +++ b/apps/frontend/src/components/atoms/Switch.tsx @@ -3,7 +3,7 @@ import * as React from "react" import * as SwitchPrimitives from "@radix-ui/react-switch" -import { cn } from "@/lib/utils" +import { cn } from "@/src/utils/utils" const Switch = React.forwardRef< React.ElementRef, diff --git a/apps/frontend/src/components/atoms/Tooltip.tsx b/apps/frontend/src/components/atoms/Tooltip.tsx index e56ac86ac..1689a6b94 100644 --- a/apps/frontend/src/components/atoms/Tooltip.tsx +++ b/apps/frontend/src/components/atoms/Tooltip.tsx @@ -4,7 +4,7 @@ import * as React from "react" import * as TooltipPrimitive from "@radix-ui/react-tooltip" -import { cn } from "@/lib/utils" +import { cn } from "@/src/utils/utils" const TooltipProvider = TooltipPrimitive.Provider diff --git a/apps/frontend/src/components/ui/button.tsx b/apps/frontend/src/components/ui/button.tsx index 9d9183012..87b112bc4 100644 --- a/apps/frontend/src/components/ui/button.tsx +++ b/apps/frontend/src/components/ui/button.tsx @@ -3,7 +3,7 @@ import * as React from "react" import { Slot } from "@radix-ui/react-slot" import { cva, type VariantProps } from "class-variance-authority" -import { cn } from "@/lib/utils" +import { cn } from "@/src/utils/utils" const buttonVariants = cva( "focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", diff --git a/apps/frontend/src/components/ui/calendar.tsx b/apps/frontend/src/components/ui/calendar.tsx index 14d19d919..1066a3bd5 100644 --- a/apps/frontend/src/components/ui/calendar.tsx +++ b/apps/frontend/src/components/ui/calendar.tsx @@ -4,8 +4,8 @@ import { DayPicker } from "react-day-picker" import { ChevronLeft, ChevronRight } from "lucide-react" -import { cn } from "@/lib/utils" import { buttonVariants } from "@/src/components/ui/button" +import { cn } from "@/src/utils/utils" export type CalendarProps = React.ComponentProps function Calendar({ className, diff --git a/apps/frontend/src/components/atoms/ui/card.tsx b/apps/frontend/src/components/ui/card.tsx similarity index 98% rename from apps/frontend/src/components/atoms/ui/card.tsx rename to apps/frontend/src/components/ui/card.tsx index 3b592ef2f..932fd7949 100644 --- a/apps/frontend/src/components/atoms/ui/card.tsx +++ b/apps/frontend/src/components/ui/card.tsx @@ -1,6 +1,6 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "@/src/utils/utils" const Card = React.forwardRef< HTMLDivElement, diff --git a/apps/frontend/src/components/ui/context-menu.tsx b/apps/frontend/src/components/ui/context-menu.tsx index 637b4a37e..2d6bdd6f3 100644 --- a/apps/frontend/src/components/ui/context-menu.tsx +++ b/apps/frontend/src/components/ui/context-menu.tsx @@ -5,7 +5,7 @@ import * as React from "react" import * as ContextMenuPrimitive from "@radix-ui/react-context-menu" import { Check, ChevronRight, Circle } from "lucide-react" -import { cn } from "@/lib/utils" +import { cn } from "@/src/utils/utils" const ContextMenu = ContextMenuPrimitive.Root diff --git a/apps/frontend/src/components/ui/dialog.tsx b/apps/frontend/src/components/ui/dialog.tsx index 3c570ac06..75a4ea4c9 100644 --- a/apps/frontend/src/components/ui/dialog.tsx +++ b/apps/frontend/src/components/ui/dialog.tsx @@ -5,7 +5,7 @@ import * as React from "react" import * as DialogPrimitive from "@radix-ui/react-dialog" import { Cross2Icon } from "@radix-ui/react-icons" -import { cn } from "@/lib/utils" +import { cn } from "@/src/utils/utils" const Dialog = DialogPrimitive.Root diff --git a/apps/frontend/src/components/ui/dropdown.tsx b/apps/frontend/src/components/ui/dropdown.tsx index 4bf8d147f..52cdc4474 100644 --- a/apps/frontend/src/components/ui/dropdown.tsx +++ b/apps/frontend/src/components/ui/dropdown.tsx @@ -5,7 +5,7 @@ import * as React from "react" import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu" import { Check, ChevronRight, Circle } from "lucide-react" -import { cn } from "@/lib/utils" +import { cn } from "@/src/utils/utils" const DropdownMenu = DropdownMenuPrimitive.Root diff --git a/apps/frontend/src/components/ui/input.tsx b/apps/frontend/src/components/ui/input.tsx index f1c140e38..e124ea697 100644 --- a/apps/frontend/src/components/ui/input.tsx +++ b/apps/frontend/src/components/ui/input.tsx @@ -1,6 +1,6 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "@/src/utils/utils" export interface InputProps extends React.InputHTMLAttributes {} diff --git a/apps/frontend/src/components/ui/popover.tsx b/apps/frontend/src/components/ui/popover.tsx index ec9322fc7..8a92c4a52 100644 --- a/apps/frontend/src/components/ui/popover.tsx +++ b/apps/frontend/src/components/ui/popover.tsx @@ -4,7 +4,7 @@ import * as React from "react" import * as PopoverPrimitive from "@radix-ui/react-popover" -import { cn } from "@/lib/utils" +import { cn } from "@/src/utils/utils" const Popover = PopoverPrimitive.Root diff --git a/apps/frontend/src/components/atoms/ui/select.tsx b/apps/frontend/src/components/ui/select.tsx similarity index 99% rename from apps/frontend/src/components/atoms/ui/select.tsx rename to apps/frontend/src/components/ui/select.tsx index d2f79f4b0..6a43afc20 100644 --- a/apps/frontend/src/components/atoms/ui/select.tsx +++ b/apps/frontend/src/components/ui/select.tsx @@ -5,7 +5,7 @@ import * as React from "react" import * as SelectPrimitive from "@radix-ui/react-select" import { Check, ChevronDown, ChevronUp } from "lucide-react" -import { cn } from "@/lib/utils" +import { cn } from "@/src/utils/utils" const Select = SelectPrimitive.Root diff --git a/apps/frontend/src/components/ui/textarea.tsx b/apps/frontend/src/components/ui/textarea.tsx index dd18bc65c..8687dbe90 100644 --- a/apps/frontend/src/components/ui/textarea.tsx +++ b/apps/frontend/src/components/ui/textarea.tsx @@ -1,6 +1,6 @@ import * as React from "react" -import { cn } from "@/lib/utils" +import { cn } from "@/src/utils/utils" export interface TextareaProps extends React.TextareaHTMLAttributes {} diff --git a/apps/frontend/src/components/ui/toast.tsx b/apps/frontend/src/components/ui/toast.tsx index 29fbdfcc5..1704eefd0 100644 --- a/apps/frontend/src/components/ui/toast.tsx +++ b/apps/frontend/src/components/ui/toast.tsx @@ -6,7 +6,7 @@ import { Cross2Icon } from "@radix-ui/react-icons" import * as ToastPrimitives from "@radix-ui/react-toast" import { cva, type VariantProps } from "class-variance-authority" -import { cn } from "@/lib/utils" +import { cn } from "@/src/utils/utils" const ToastProvider = ToastPrimitives.Provider diff --git a/apps/frontend/src/extensions/SlashCommand/MenuList.tsx b/apps/frontend/src/extensions/SlashCommand/MenuList.tsx index 7c234a8f3..c0d4a692e 100644 --- a/apps/frontend/src/extensions/SlashCommand/MenuList.tsx +++ b/apps/frontend/src/extensions/SlashCommand/MenuList.tsx @@ -1,10 +1,10 @@ import React, { useCallback, useEffect, useRef, useState } from "react" import type { MenuListProps } from "./types" -import { cn } from "@/lib/utils" import { DropdownButton } from "@/src/components/Dropdown" import { Icon } from "@/src/components/Icon" import { Surface } from "@/src/components/Surface" +import { cn } from "@/src/utils/utils" export const MenuList = React.forwardRef((props: MenuListProps, ref) => { const scrollContainer = useRef(null) diff --git a/apps/frontend/lib/utils.ts b/apps/frontend/src/utils/utils.ts similarity index 100% rename from apps/frontend/lib/utils.ts rename to apps/frontend/src/utils/utils.ts