diff --git a/frontend/src/App.css b/frontend/src/App.css index 1186370f..c8ed02c8 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -91,18 +91,6 @@ form button:hover { border-color: white; } -.about-section { - max-width: 800px; - margin: 2em auto; - text-align: left; - padding: 0 1em; -} - -.about-section p { - margin-bottom: 1em; - line-height: 1.6; -} - @media (max-width: 600px) { .about-section { font-size: 0.9em; diff --git a/frontend/src/components/modals/EditAddressModal.tsx b/frontend/src/components/modals/EditAddressModal.tsx index efc60b0a..65c7b9f6 100644 --- a/frontend/src/components/modals/EditAddressModal.tsx +++ b/frontend/src/components/modals/EditAddressModal.tsx @@ -1,8 +1,8 @@ import React, { useState } from "react"; +import { Input } from "@/components/ui/Input/Input"; import Modal from "@/components/ui/Modal"; import { Button } from "@/components/ui/button"; -import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { useAlertQueue } from "@/hooks/useAlertQueue"; import { useAuthentication } from "@/hooks/useAuth"; diff --git a/frontend/src/components/modals/EditRobotModal.tsx b/frontend/src/components/modals/EditRobotModal.tsx index d81445c9..db381962 100644 --- a/frontend/src/components/modals/EditRobotModal.tsx +++ b/frontend/src/components/modals/EditRobotModal.tsx @@ -1,5 +1,6 @@ import { useCallback, useEffect, useState } from "react"; +import { Input } from "@/components/ui/Input/Input"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -7,7 +8,6 @@ import { DialogHeader, DialogTitle, } from "@/components/ui/dialog"; -import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Textarea } from "@/components/ui/textarea"; import { ApiError } from "@/lib/types/api"; diff --git a/frontend/src/components/modals/RegisterRobotModal.tsx b/frontend/src/components/modals/RegisterRobotModal.tsx index 86b3985b..8e5a6e53 100644 --- a/frontend/src/components/modals/RegisterRobotModal.tsx +++ b/frontend/src/components/modals/RegisterRobotModal.tsx @@ -2,6 +2,7 @@ import { useState } from "react"; import { FaPlus } from "react-icons/fa"; import { useNavigate } from "react-router-dom"; +import { Input } from "@/components/ui/Input/Input"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -9,7 +10,6 @@ import { DialogHeader, DialogTitle, } from "@/components/ui/dialog"; -import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Textarea } from "@/components/ui/textarea"; import { useAlertQueue } from "@/hooks/useAlertQueue"; diff --git a/frontend/src/components/orders/OrderCard.tsx b/frontend/src/components/orders/OrderCard.tsx index 424d0d8c..2713d2c6 100644 --- a/frontend/src/components/orders/OrderCard.tsx +++ b/frontend/src/components/orders/OrderCard.tsx @@ -9,6 +9,12 @@ import { DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import type { OrderWithProduct } from "@/lib/types/orders"; +import { + activeStatuses, + canModifyStatuses, + orderStatuses, + redStatuses, +} from "@/lib/types/orders"; import { formatPrice } from "@/lib/utils/formatNumber"; import { normalizeStatus } from "@/lib/utils/formatString"; @@ -21,37 +27,6 @@ enum OrderStatus { DELIVERED = 4, } -const orderStatuses = [ - "processing", - "in_development", - "being_assembled", - "shipped", - "delivered", - "awaiting_final_payment", - "preorder_placed", - "cancelled", - "refunded", - "failed", -]; - -const activeStatuses = [ - "preorder_placed", - "processing", - "in_development", - "being_assembled", - "shipped", - "awaiting_final_payment", -]; - -const redStatuses = ["cancelled", "refunded", "failed"]; -const canModifyStatuses = [ - "preorder_placed", - "processing", - "in_development", - "being_assembled", - "awaiting_final_payment", -]; - const OrderCard: React.FC<{ orderWithProduct: OrderWithProduct }> = ({ orderWithProduct: initialOrderWithProduct, }) => { @@ -265,9 +240,7 @@ const OrderCard: React.FC<{ orderWithProduct: OrderWithProduct }> = ({ {isRedStatus && (

- {order.status === "failed" - ? "This order has failed." - : `This order has been ${normalizeStatus(order.status)}.`} + This order has been {normalizeStatus(order.status)}.

)} diff --git a/frontend/src/components/ui/input.tsx b/frontend/src/components/ui/input.tsx deleted file mode 100644 index 84607ef9..00000000 --- a/frontend/src/components/ui/input.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import * as React from "react"; - -import { cn } from "@/lib/utils"; - -export type InputProps = React.InputHTMLAttributes; - -const Input = React.forwardRef( - ({ className, type, ...props }, ref) => { - return ( - - ); - }, -); -Input.displayName = "Input"; - -export { Input }; diff --git a/frontend/src/gen/api.ts b/frontend/src/gen/api.ts index 8f1ab6b1..6f229f96 100644 --- a/frontend/src/gen/api.ts +++ b/frontend/src/gen/api.ts @@ -1684,7 +1684,7 @@ export interface components { * Status * @enum {string} */ - status: "processing" | "in_development" | "being_assembled" | "shipped" | "delivered" | "preorder_placed" | "awaiting_final_payment" | "cancelled" | "refunded" | "failed"; + status: "processing" | "in_development" | "being_assembled" | "shipped" | "delivered" | "preorder_placed" | "awaiting_final_payment" | "cancelled" | "refunded"; /** Price Amount */ price_amount: number; /** Currency */ diff --git a/frontend/src/lib/cn.ts b/frontend/src/lib/cn.ts deleted file mode 100644 index 365058ce..00000000 --- a/frontend/src/lib/cn.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { type ClassValue, clsx } from "clsx"; -import { twMerge } from "tailwind-merge"; - -export function cn(...inputs: ClassValue[]) { - return twMerge(clsx(inputs)); -} diff --git a/frontend/src/lib/types/colors.ts b/frontend/src/lib/types/colors.ts deleted file mode 100644 index c825d936..00000000 --- a/frontend/src/lib/types/colors.ts +++ /dev/null @@ -1,4 +0,0 @@ -// External brand colors (used in social links) -export const LinkedinPrimaryColor = "#0a66c2"; -export const GithubPrimaryColor = "#333"; -export const DiscordPrimaryColor = "#5865F2"; diff --git a/frontend/src/lib/types/orders.ts b/frontend/src/lib/types/orders.ts index 1bcdc5d7..7a0fae4b 100644 --- a/frontend/src/lib/types/orders.ts +++ b/frontend/src/lib/types/orders.ts @@ -15,3 +15,33 @@ export type ProductInfo = { images: string[]; metadata: Record; }; + +export const orderStatuses = [ + "processing", + "in_development", + "being_assembled", + "shipped", + "delivered", + "awaiting_final_payment", + "preorder_placed", + "cancelled", + "refunded", +]; + +export const activeStatuses = [ + "preorder_placed", + "processing", + "in_development", + "being_assembled", + "shipped", + "awaiting_final_payment", +]; + +export const redStatuses = ["cancelled", "refunded"]; +export const canModifyStatuses = [ + "preorder_placed", + "processing", + "in_development", + "being_assembled", + "awaiting_final_payment", +]; diff --git a/store/app/model.py b/store/app/model.py index d611d924..1d0e6a64 100644 --- a/store/app/model.py +++ b/store/app/model.py @@ -563,7 +563,6 @@ def create(cls, user_id: str, listing_id: str, is_upvote: bool) -> Self: "awaiting_final_payment", "cancelled", "refunded", - "failed", ] InventoryType = Literal["finite", "preorder"]