diff --git a/.env.example b/.env.example index f8670395a..e32b4224f 100644 --- a/.env.example +++ b/.env.example @@ -13,6 +13,7 @@ SUPABASE_ANON_PUBLIC="{ANON_PUBLIC}" SUPABASE_SERVICE_ROLE="{SERVICE_ROLE}" SUPABASE_URL="https://{YOUR_INSTANCE_NAME}.supabase.co" SERVER_URL="http://localhost:3000" +APP_NAME="Shelf" # Set this to false to disable requirement of subscription for premium features. This will make premium features available for all users @@ -36,6 +37,6 @@ INVITE_TOKEN_SECRET="secret-test-invite" GEOCODE_API_KEY="geocode-api-key" # Used for Sentry error logging -SENTRY_DSN="sentry-dsn" SENTRY_ORG="sentry-org" -SENTRY_PROJECT="sentry-project" \ No newline at end of file +SENTRY_PROJECT="sentry-project" +SENTRY_DSN="sentry-dsn" diff --git a/app/components/assets/asset-image.tsx b/app/components/assets/asset-image.tsx index 118ef43fc..9033ef52e 100644 --- a/app/components/assets/asset-image.tsx +++ b/app/components/assets/asset-image.tsx @@ -24,7 +24,7 @@ export const AssetImage = ({ const url = mainImage || fetcher?.data?.asset?.mainImage || - "/images/asset-placeholder.jpg"; + "/static/images/asset-placeholder.jpg"; useEffect(() => { if (mainImage && mainImageExpiration) { diff --git a/app/components/assets/custom-fields-inputs.tsx b/app/components/assets/custom-fields-inputs.tsx index 86fc31b34..022931e0a 100644 --- a/app/components/assets/custom-fields-inputs.tsx +++ b/app/components/assets/custom-fields-inputs.tsx @@ -23,7 +23,7 @@ import { SelectValue, SelectItem, } from "../forms"; -import { Calendar } from "../forms/calender-input"; +import { Calendar } from "../forms/calendar-input"; import FormRow from "../forms/form-row"; import Input from "../forms/input"; import { Switch } from "../forms/switch"; diff --git a/app/components/assets/form.tsx b/app/components/assets/form.tsx index 26fbe3655..bf11e548f 100644 --- a/app/components/assets/form.tsx +++ b/app/components/assets/form.tsx @@ -252,6 +252,7 @@ export const AssetForm = ({ label={zo.fields.description()} name={zo.fields.description()} defaultValue={description || ""} + hideLabel placeholder="Add a description for your asset." disabled={disabled} data-test-id="assetDescription" diff --git a/app/components/assets/notes/notes.tsx b/app/components/assets/notes/notes.tsx index 695d4e1f1..6515ecedd 100644 --- a/app/components/assets/notes/notes.tsx +++ b/app/components/assets/notes/notes.tsx @@ -50,7 +50,7 @@ export const Notes = () => {
Graphic for no notes diff --git a/app/components/custody/custodian-select.tsx b/app/components/custody/custodian-select.tsx index d505a6be6..140a5bc43 100644 --- a/app/components/custody/custodian-select.tsx +++ b/app/components/custody/custodian-select.tsx @@ -88,7 +88,7 @@ export default function CustodianSelect( {`${member.user.firstName}(); return announcement ? ( -
+
diff --git a/app/components/dashboard/custodians.tsx b/app/components/dashboard/custodians.tsx index 4d7e52cbc..f8142c518 100644 --- a/app/components/dashboard/custodians.tsx +++ b/app/components/dashboard/custodians.tsx @@ -76,7 +76,7 @@ function Row({ src={ custodian?.user?.profilePicture ? custodian?.user?.profilePicture - : "/images/default_pfp.jpg" + : "/static/images/default_pfp.jpg" } className={"size-10 rounded-[4px]"} alt={`${custodian.name}'s profile`} diff --git a/app/components/dashboard/empty-state.tsx b/app/components/dashboard/empty-state.tsx index c486995b8..9c8c68c4c 100644 --- a/app/components/dashboard/empty-state.tsx +++ b/app/components/dashboard/empty-state.tsx @@ -2,7 +2,7 @@ export function EmptyState({ text }: { text: string }) { return (
Empty state diff --git a/app/components/errors/content.tsx b/app/components/errors/content.tsx index 133f4de50..8085f762a 100644 --- a/app/components/errors/content.tsx +++ b/app/components/errors/content.tsx @@ -37,7 +37,7 @@ const InnerContent = ({ title, message, showReload }: ErrorContentProps) => { return (
- {title} + {title}

{title}

{NODE_ENV === "production" diff --git a/app/components/errors/index.tsx b/app/components/errors/index.tsx index 85630f7da..e025dd83e 100644 --- a/app/components/errors/index.tsx +++ b/app/components/errors/index.tsx @@ -73,6 +73,7 @@ export const ErrorBoundryComponent = ({ ) } /> + ); } else { return ( diff --git a/app/components/forms/calendar-input.tsx b/app/components/forms/calendar-input.tsx new file mode 100644 index 000000000..f6b3e6440 --- /dev/null +++ b/app/components/forms/calendar-input.tsx @@ -0,0 +1,83 @@ +"use client"; + +import { ChevronLeftIcon, ChevronRightIcon } from "@radix-ui/react-icons"; +import { DayPicker } from "react-day-picker"; + +import { tw } from "~/utils"; + +type CalendarProps = { + className?: any; + classNames?: any; + showOutsideDays?: boolean; + selected: any; + onSelect: any; + [x: string]: any; +}; + +const Calendar: React.ForwardRefRenderFunction = ( + { + className, + classNames, + showOutsideDays = true, + selected, + onSelect, + ...props + }, + _ref // This is the forwarded ref +) => ( + <> + { + onSelect(d); + }} + selected={selected} + showOutsideDays={showOutsideDays} + className={tw( + "border-indigo z-100 z-50 border-4 bg-slate-200 p-3", + className + )} + classNames={{ + months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0", + month: "space-y-4", + caption: "flex justify-center pt-1 relative items-center", + caption_label: "text-sm font-medium", + nav: "space-x-1 flex items-center", + nav_button: tw( + "size-7 bg-transparent p-0 opacity-50 hover:opacity-100" + ), + nav_button_previous: "absolute left-1", + nav_button_next: "absolute right-1", + table: "w-full border-collapse space-y-1", + head_row: "flex", + head_cell: + "text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]", + row: "flex w-full mt-2", + cell: tw( + "[&:has([aria-selected])]:bg-accent relative p-0 text-center text-sm focus-within:relative focus-within:z-20", + props.mode === "range" + ? "[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md" + : "[&:has([aria-selected])]:rounded-md" + ), + day: tw("size-8 p-0 font-normal aria-selected:opacity-100"), + day_range_start: "day-range-start", + day_range_end: "day-range-end", + day_selected: + "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground", + day_today: "bg-accent text-accent-foreground", + day_outside: "text-muted-foreground opacity-50", + day_disabled: "text-muted-foreground opacity-50", + day_range_middle: + "aria-selected:bg-accent aria-selected:text-accent-foreground", + day_hidden: "invisible", + ...classNames, + }} + components={{ + IconLeft: () => , + IconRight: () => , + }} + {...props} + /> + +); + +export { Calendar }; diff --git a/app/components/forms/calender-input.tsx b/app/components/forms/calender-input.tsx deleted file mode 100644 index ea4a73b7b..000000000 --- a/app/components/forms/calender-input.tsx +++ /dev/null @@ -1,85 +0,0 @@ -"use client"; - -import { forwardRef } from "react"; -import { ChevronLeftIcon, ChevronRightIcon } from "@radix-ui/react-icons"; -import { DayPicker } from "react-day-picker"; - -import { tw } from "~/utils"; - -export type CalendarProps = React.ComponentProps; - -const Calendar = forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(function Calendar( - { - className, - classNames, - showOutsideDays = true, - selected, - onSelect, - ...props - }, - _ref -) { - return ( - <> - { - onSelect(d); - }} - selected={selected} - showOutsideDays={showOutsideDays} - className={tw( - "border-indigo z-100 z-50 border-4 bg-slate-200 p-3", - className - )} - classNames={{ - months: - "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0", - month: "space-y-4", - caption: "flex justify-center pt-1 relative items-center", - caption_label: "text-sm font-medium", - nav: "space-x-1 flex items-center", - nav_button: tw( - "size-7 bg-transparent p-0 opacity-50 hover:opacity-100" - ), - nav_button_previous: "absolute left-1", - nav_button_next: "absolute right-1", - table: "w-full border-collapse space-y-1", - head_row: "flex", - head_cell: - "text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]", - row: "flex w-full mt-2", - cell: tw( - "[&:has([aria-selected])]:bg-accent relative p-0 text-center text-sm focus-within:relative focus-within:z-20", - props.mode === "range" - ? "[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md" - : "[&:has([aria-selected])]:rounded-md" - ), - day: tw("size-8 p-0 font-normal aria-selected:opacity-100"), - day_range_start: "day-range-start", - day_range_end: "day-range-end", - day_selected: - "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground", - day_today: "bg-accent text-accent-foreground", - day_outside: "text-muted-foreground opacity-50", - day_disabled: "text-muted-foreground opacity-50", - day_range_middle: - "aria-selected:bg-accent aria-selected:text-accent-foreground", - day_hidden: "invisible", - ...classNames, - }} - components={{ - IconLeft: () => , - IconRight: () => , - }} - {...props} - /> - - ); -}); - -// Calendar.displayName = "Calendar" - -export { Calendar }; diff --git a/app/components/forms/input.tsx b/app/components/forms/input.tsx index 9c1a4ffde..5413af3a2 100644 --- a/app/components/forms/input.tsx +++ b/app/components/forms/input.tsx @@ -1,3 +1,4 @@ +import type { RefObject } from "react"; import { forwardRef } from "react"; import { tw } from "~/utils"; @@ -95,18 +96,21 @@ const Input = forwardRef(function Input( ref, ...rest, }; - // @TODO dont know how to fix that. - // @ts-ignore - let input = ; + + let input = ( + | undefined} + /> + ); if (inputType === "textarea") { input = ( - // @TODO dont know how to fix that. - // @ts-ignore