Skip to content

Commit

Permalink
UI improvemnts for sell/listing flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Winston-Hsiao committed Nov 10, 2024
1 parent 20043e6 commit ef81e92
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 25 deletions.
52 changes: 29 additions & 23 deletions frontend/src/components/modals/CreateListingModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from "@/components/ui/dialog";
import { useAuthentication } from "@/hooks/useAuth";
import ROUTES from "@/lib/types/routes";
import { Share2, ShoppingBag } from "lucide-react";
import { DollarSign, Share2, ShoppingBag } from "lucide-react";

interface Props {
isOpen: boolean;
Expand All @@ -31,7 +31,7 @@ export const CreateListingModal = ({ isOpen, onOpenChange }: Props) => {
<DialogHeader>
<DialogTitle>What would you like to do?</DialogTitle>
</DialogHeader>
<div className="grid grid-cols-2 gap-4 p-4">
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4 p-4">
<div
onClick={() =>
handleOptionClick(
Expand All @@ -47,27 +47,33 @@ export const CreateListingModal = ({ isOpen, onOpenChange }: Props) => {
</p>
</div>

<div
onClick={() =>
canSell &&
handleOptionClick(
`${ROUTES.BOTS.path}/${ROUTES.BOTS.$.SELL.relativePath}`,
)
}
className={`flex flex-col items-center justify-center p-6 rounded-lg border ${
canSell
? "border-gray-7 hover:border-gray-1 hover:bg-gray-11 cursor-pointer"
: "border-gray-4 opacity-50 cursor-not-allowed"
} transition-all`}
>
<ShoppingBag className="w-12 h-12 mb-4" />
<h3 className="text-lg font-semibold">Sell a Robot</h3>
<p className="text-sm text-gray-7 text-center mt-2">
{canSell
? "List your Robot for sale"
: "Complete Seller onboarding to sell"}
</p>
</div>
{!canSell ? (
<div
onClick={() => handleOptionClick(ROUTES.SELL.ONBOARDING.path)}
className="flex flex-col items-center justify-center p-6 rounded-lg border border-gray-7 hover:border-gray-1 hover:bg-gray-11 cursor-pointer transition-all"
>
<DollarSign className="w-12 h-12 mb-4" />
<h3 className="text-lg font-semibold">Sell Robots</h3>
<p className="text-sm text-gray-7 text-center mt-2">
Complete onboarding to start selling robots
</p>
</div>
) : (
<div
onClick={() =>
handleOptionClick(
`${ROUTES.BOTS.path}/${ROUTES.BOTS.$.SELL.relativePath}`,
)
}
className="flex flex-col items-center justify-center p-6 rounded-lg border border-gray-7 hover:border-gray-1 hover:bg-gray-11 cursor-pointer transition-all"
>
<ShoppingBag className="w-12 h-12 mb-4" />
<h3 className="text-lg font-semibold">Sell a Robot</h3>
<p className="text-sm text-gray-7 text-center mt-2">
List your Robot for sale
</p>
</div>
)}
</div>
</DialogContent>
</Dialog>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/pages/Browse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ const Browse = () => {
</DropdownMenu>
<Button
onClick={() => setShowCreateModal(true)}
variant="default"
variant="outline"
size="lg"
className="w-full md:w-auto"
>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/pages/Orders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const OrdersPage: React.FC = () => {
<div className="p-6 min-h-screen rounded-xl">
<div className="mb-6">
<h1 className="text-3xl font-bold">Your Orders</h1>
<p className="text-gray-11">
<p className="text-gray-8">
You can view the status of your past and current orders here.
</p>
</div>
Expand Down

0 comments on commit ef81e92

Please sign in to comment.