Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI improvements for sell/listing flow #574

Merged
merged 1 commit into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading