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

chore/code cleanup #79

Merged
merged 24 commits into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c6c1506
chore: remove unnecessary dependencies from root package.json
derianrddev Dec 22, 2024
39f8922
docs: update issue template
derianrddev Dec 22, 2024
7e16ca2
chore: update frontend dependencies
derianrddev Dec 23, 2024
ab75548
chore: remove unnecessary imports
derianrddev Dec 23, 2024
2b3ed91
refactor: improve styles for delivery location component and rename t…
derianrddev Dec 23, 2024
dc75390
refactor: update BreadcrumbNavigation to use shadcn/ui Breadcrumb com…
derianrddev Dec 23, 2024
fae4537
refactor: remove Bounded component
derianrddev Dec 23, 2024
db6d921
style: update styles for product cards and pagination
derianrddev Dec 23, 2024
e284f83
style: update footer styles
derianrddev Dec 23, 2024
87727a7
style: update pagination styles
derianrddev Dec 23, 2024
f28ffb3
style: update layout styles
derianrddev Dec 23, 2024
48c4c45
style: update header button styles
derianrddev Dec 23, 2024
fc0bfa8
fix: display AddProductModal in Marketplace
derianrddev Dec 23, 2024
ab3c16e
style: center title of AddProductModal
derianrddev Dec 23, 2024
569809c
style: update layout styles
derianrddev Dec 23, 2024
2f12b7a
refactor: reorganize component structure
derianrddev Dec 23, 2024
0e6b43f
refactor: reorganize imports for clarity
derianrddev Dec 23, 2024
9b24c24
refactor: use shadcn/ui button in product page
derianrddev Dec 23, 2024
4010124
chore: format code
derianrddev Dec 23, 2024
9720fc2
fix: resolve type constraint error in ProductList
derianrddev Dec 23, 2024
a2fe8e6
chore: remove unused react-icons package
derianrddev Dec 23, 2024
f0ca4c3
chore: resolve conflicts
derianrddev Dec 30, 2024
98c1ddd
chore: remove unused react-icons package
derianrddev Jan 1, 2025
db3aa98
chore: clean code
derianrddev Jan 5, 2025
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
10 changes: 4 additions & 6 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
# πŸ“˜ Issue Description
-

---

## πŸ” Steps to Reproduce
## πŸ“˜ Description
-

## βœ… Acceptance Criteria
Expand All @@ -15,3 +10,6 @@
## πŸ“œ Additional Notes
-

⚠ Do not apply until the ODHack begins.

⚠ Read our guidelines before applying.
15 changes: 0 additions & 15 deletions frontend/app/components/Bounded.tsx

This file was deleted.

92 changes: 92 additions & 0 deletions frontend/app/components/home/feature-section.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import { BarChart3, Coins, Lock, Shield, Users, Zap } from "lucide-react";

export function FeatureSection() {
const features = [
{
icon: <Shield className="h-8 w-8" />,
title: "Smart Contract Escrow",
description: (
<>
Automated protection with Stellar smart contracts. Trustless Work API
abstracts the complexities of smart contract configuration. It
leverages the blockchain to ensure transactions are secure and
transparent, providing fairness without bias in the marketplace. Read
more on
<a
href="https://www.trustlesswork.com/"
target="_blank"
className="text-blue-500 hover:underline"
>
<span></span> Trustless Work
</a>
</>
),
gradient: "from-blue-500 to-cyan-500",
},
{
icon: <Zap className="h-8 w-8" />,
title: "Lightning Settlement",
description: "3-5 second finality on Stellar network",
gradient: "from-yellow-500 to-orange-500",
},
{
icon: <Lock className="h-8 w-8" />,
title: "Non-Custodial Trading",
description: "Keep full control of your assets",
gradient: "from-purple-500 to-pink-500",
},
{
icon: <Coins className="h-8 w-8" />,
title: "Multi-Asset Support",
description: "Trade any Stellar-based token",
gradient: "from-green-500 to-emerald-500",
},
{
icon: <Users className="h-8 w-8" />,
title: "DAO Governance",
description: "Community-driven protocol decisions",
gradient: "from-red-500 to-pink-500",
},
{
icon: <BarChart3 className="h-8 w-8" />,
title: "Real-Time Analytics",
description: "Advanced trading metrics & insights",
gradient: "from-indigo-500 to-purple-500",
},
];

return (
<div className="relative bg-black/5 dark:bg-white/5 py-24">
<div className="max-w-6xl mx-auto px-4">
<h2 className="text-3xl font-bold text-center mb-4">
Built for the Future of Finance
</h2>
<p className="text-center text-muted-foreground mb-16 max-w-[600px] mx-auto">
Leveraging the power of Stellar blockchain to provide a secure,
efficient, and truly decentralized trading experience.
</p>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
{features.map((feature) => (
<div
key={feature.title}
className="group relative p-6 rounded-xl bg-card hover:bg-card/50 transition-all duration-300"
>
<div
className={`absolute inset-0 opacity-0 group-hover:opacity-10 bg-gradient-to-br ${feature.gradient} rounded-xl transition-opacity duration-300`}
/>
<div className="relative">
<div
className={`mb-4 bg-gradient-to-br ${feature.gradient} text-white p-3 rounded-lg inline-block`}
>
{feature.icon}
</div>
<h3 className="text-xl font-semibold mb-2">{feature.title}</h3>
<p className="text-muted-foreground">{feature.description}</p>
</div>
</div>
))}
</div>
</div>
</div>
);
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Button } from "@/app/components/ui/button";
import { ArrowRight } from "lucide-react";
import Link from "next/link";
import * as React from "react";
import { SafeSwapLogo } from "./SafeSwapLogo";

import { SafeSwapLogo } from "@/app/components/shared/safe-swap-logo";
import { Button } from "@/app/components/ui/button";

export function HeroSection() {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import * as React from "react";

export function StatsSection() {
return (
<div className="relative py-20 overflow-hidden">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import React from "react";
import { Button } from "./button";
import { Input } from "./input";
import { Label } from "./label";

import { Button } from "@/app/components/ui/button";
import { Input } from "@/app/components/ui/input";
import { Label } from "@/app/components/ui/label";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "./select";
import { Textarea } from "./textarea";
} from "@/app/components/ui/select";
import { Textarea } from "@/app/components/ui/textarea";

interface AddProductModalProps {
isOpen: boolean;
Expand All @@ -24,8 +25,8 @@ const AddProductModal: React.FC<AddProductModalProps> = ({

return (
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/50">
<div className="bg-white rounded-lg shadow-lg w-[90%] max-w-xl p-6">
<h2 className="text-2xl font-bold mb-4">Add New Product</h2>
<div className="bg-white rounded-lg shadow-lg w-[90%] max-w-xl p-6 dark:bg-neutral-950">
<h2 className="text-2xl text-center font-bold mb-4">Add New Product</h2>
<form className="space-y-4">
{/* Product Name */}
<div>
Expand Down Expand Up @@ -91,12 +92,7 @@ const AddProductModal: React.FC<AddProductModalProps> = ({
<Button variant="secondary" onClick={onClose}>
Close
</Button>
<Button
variant="default"
className="bg-black text-white hover:bg-black/80"
>
Save
</Button>
<Button>Save</Button>
</div>
</div>
</div>
Expand Down
24 changes: 24 additions & 0 deletions frontend/app/components/marketplace/breadcrumb-navigation.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import {
Breadcrumb,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbList,
BreadcrumbPage,
BreadcrumbSeparator,
} from "@/app/components/ui/breadcrumb";

export default function BreadcrumbNavigation() {
return (
<Breadcrumb>
<BreadcrumbList className="text-base">
<BreadcrumbItem>
<BreadcrumbLink href="/">Home</BreadcrumbLink>
</BreadcrumbItem>
<BreadcrumbSeparator />
<BreadcrumbItem>
<BreadcrumbPage>Marketplace</BreadcrumbPage>
</BreadcrumbItem>
</BreadcrumbList>
</Breadcrumb>
);
}
69 changes: 69 additions & 0 deletions frontend/app/components/marketplace/filters.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
"use client";

import { Checkbox, Slider } from "@radix-ui/themes";
import { useState } from "react";

import { SidebarContent, SidebarHeader } from "@/app/components/ui/sidebar";

const Filters = () => {
const [priceRange, setPriceRange] = useState<[number, number]>([0, 1500]);
const [selectedCategories, setSelectedCategories] = useState<string[]>([]);

const handleCategoryChange = (category: string) => {
setSelectedCategories((prev) =>
prev.includes(category)
? prev.filter((c) => c !== category)
: [...prev, category],
);
};

return (
<>
<SidebarHeader className="p-6 border-b">
<h2 className="text-xl font-semibold">Filters</h2>
</SidebarHeader>
<SidebarContent className="p-6">
<div className="space-y-8">
<div>
<h3 className="mb-2 text-lg font-medium">Price range</h3>
<Slider
min={0}
max={1500}
step={10}
value={priceRange}
onValueChange={(value) =>
setPriceRange(value as [number, number])
}
className="mb-3"
/>
<div className="flex justify-between text-lg">
<span>${priceRange[0]}</span>
<span>${priceRange[1]}</span>
</div>
</div>
<div>
<h3 className="mb-2 text-lg font-medium">Categories</h3>
<div className="space-y-3">
{["Electronics", "Furniture", "Appliances", "Sports"].map(
(category) => (
<div key={category} className="flex items-center">
<Checkbox
id={category}
checked={selectedCategories.includes(category)}
onCheckedChange={() => handleCategoryChange(category)}
/>
<label htmlFor={category} className="ml-3 text-lg">
{category}
</label>
</div>
),
)}
</div>
</div>
</div>
</SidebarContent>
</>
);
};

export default Filters;
1 change: 0 additions & 1 deletion frontend/app/components/marketplace/index.ts

This file was deleted.

13 changes: 5 additions & 8 deletions frontend/app/components/marketplace/products-pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,20 @@ import {
PaginationLink,
PaginationNext,
PaginationPrevious,
} from "../ui/pagination";
} from "@/app/components/ui/pagination";
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectTrigger,
SelectValue,
} from "../ui/select";
} from "@/app/components/ui/select";

export const ProductsPagination = () => {
return (
<section
className="w-full pb-10 mt-2 flex flex-col justify-center items-start gap-5
md:flex-row md:items-center md:gap-0 md:max-w-2xl lg:max-w-3xl xl:max-w-4xl 2xl:max-w-5xl"
>
<div className="w-full gap-2 flex justify-center items-center md:w-[50%] md:justify-start">
<section className="w-full pt-5 mt-2 flex flex-col gap-5 md:flex-row md:gap-0">
<div className="w-full gap-2 flex items-center justify-center md:justify-start md:w-[50%]">
<label className="opacity-80">Show result:</label>
<Select>
<SelectTrigger className="w-[70px]">
Expand All @@ -41,7 +38,7 @@ export const ProductsPagination = () => {
</div>

<div className="w-full md:w-[50%]">
<Pagination>
<Pagination className="justify-center md:justify-end">
<PaginationContent>
<PaginationItem>
<PaginationPrevious href="#" />
Expand Down
Loading