Skip to content

Commit

Permalink
Merge develop to main (#37)
Browse files Browse the repository at this point in the history
* feat: final (#34)

* fix: fixx

* feat: final

* fix: update profile bug (#36)

---------

Co-authored-by: SansanSaga <154500077+SansanSaga@users.noreply.github.com>
Co-authored-by: Laila Yunita <161436964+lailayunita@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 14, 2024
1 parent 256566b commit d2bb53c
Show file tree
Hide file tree
Showing 34 changed files with 588 additions and 367 deletions.
16 changes: 13 additions & 3 deletions apps/api/src/services/user/update-user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,27 @@ export const updateProfileService = async (
body: Partial<User>,
file?: Express.Multer.File,
) => {
delete body.profilePicture;

try {
const user = await prisma.user.findFirst({
where: { id: userId, isDeleted: false, role: 'CUSTOMER' },
where: { id: userId, isDeleted: false },
});

if (!user) {
throw new Error('User not found');
}

if (body.phoneNumber) {
const existingPhoneNumber = await prisma.user.findFirst({
where: {
phoneNumber: body.phoneNumber,
},
});

if (existingPhoneNumber) {
throw new Error('This phone number is already in use.');
}
}

if (file) {
const { secure_url } = await cloudinaryUpload(file);
body.profilePicture = secure_url;
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function RootLayout({
}) {
return (
<html lang="en">
<body className={quicksand.className}>
<body className={inter.className}>
<NextAuthProvider>
<ReactQueryProvider>
<Header />
Expand Down
File renamed without changes.
File renamed without changes.
18 changes: 5 additions & 13 deletions apps/web/src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ export const Footer = () => {
className="object-contain"
/>
</Link>
<p>Bersih, Cepat, dan Terpercaya untuk Setiap Cucian Anda</p>
<p>Clean, Fast, and Reliable for Every Wash</p>
<div className="flex items-center gap-2 text-xl text-neutral-600">
<FaTwitter />
<FaInstagram />
</div>
</div>
<div className="flex flex-col gap-4">
<p className="font-semibold text-black">Company</p>
<p>Tentang Kami</p>
<p>Kontak Kami</p>
<p>Syarat dan Ketentuan</p>
<p>Kebijakan Privasi</p>
<p>About Us</p>
<p>Contact Us</p>
<p>Terms and Conditions</p>
<p>Privacy Policy</p>
</div>
<div className="flex flex-col gap-4">
<p className="font-semibold text-black">Layanan</p>
Expand All @@ -53,14 +53,6 @@ export const Footer = () => {
<p>Ironing and Pressing</p>
<p>Pick Up and Delivery</p>
</div>
<div className="flex flex-col gap-4">
<p className="font-semibold text-black">Lokasi Outlet</p>
<p>Jakarta Timur</p>
<p>Jakarta Barat</p>
<p>Jakarta Selatan</p>
<p>Jakarta Utara</p>
<p>Jakarta Pusat</p>
</div>
<div className="flex flex-col gap-4">
<p className="font-semibold text-black">More</p>
<p>Kemitraan</p>
Expand Down
102 changes: 102 additions & 0 deletions apps/web/src/components/Grid.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
"use client";
import React, { useState, useRef, useEffect } from "react";
import { LayoutGrid } from "../components/ui/layout-grid";

export function LayoutGridDemo() {
return (
<div className="h-[650px] w-full md:h-[500px]">
<LayoutGrid cards={cards} />
</div>
);
}

const SkeletonOne = () => {
return (
<div>
<p className="text-xl font-bold text-white md:text-4xl">
Pick Up and Delivery
</p>
<p className="text-base font-normal text-white"></p>
<p className="my-4 max-w-lg text-base font-normal text-neutral-200">
Enjoy the convenience of our pick-up and delivery service, ensuring your
laundry is taken care of from the comfort of your home. We handle
everything, from collecting to delivering fresh, clean clothes.
</p>
</div>
);
};

const SkeletonTwo = () => {
return (
<div>
<p className="text-xl font-bold text-white md:text-4xl">Washing</p>
<p className="text-base font-normal text-white"></p>
<p className="my-4 text-base font-normal text-neutral-200">
Our washing service uses advanced machines and high-quality detergents
to give your clothes a deep, refreshing clean, while maintaining fabric
quality and color vibrancy.
</p>
</div>
);
};

const SkeletonThree = () => {
return (
<div>
<p className="text-xl font-bold text-white md:text-4xl">Ironing</p>
<p className="text-base font-normal text-white"></p>
<p className="my-4 max-w-lg text-base font-normal text-neutral-200">
Experience professional ironing that ensures your clothes are
wrinkle-free and neatly pressed, ready to wear for any occasion.
</p>
</div>
);
};

const SkeletonFour = () => {
return (
<div>
<p className="text-xl font-bold text-white md:text-4xl">Packing</p>
<p className="text-base font-normal text-white"></p>
<p className="my-4 max-w-lg text-base font-normal text-neutral-200">
Our packing service ensures your freshly cleaned clothes are folded and
packaged with care, keeping them clean, organized, and ready for your
next adventure.
</p>
</div>
);
};

const cards = [
{
id: 1,
content: <SkeletonOne />,
className:
"md:col-span-3 col-span-1 shadow rounded-md hover:cursor-pointer",
thumbnail:
"https://static.toiimg.com/thumb/msid-108846460,width-1280,height-720,resizemode-4/108846460.jpg",
},
{
id: 2,
content: <SkeletonTwo />,
className:
"md:col-span-2 col-span-1 hover:cursor-pointer shadow rounded-md",
thumbnail:
"https://kellysdrycleaners.com/wp-content/uploads/How-to-Iron-Shirts-and-Pants-Correctly.jpg",
},
{
id: 3,
content: <SkeletonThree />,
className:
"md:col-span-2 col-span-1 hover:cursor-pointer shadow rounded-md",
thumbnail:
"https://images.unsplash.com/photo-1567113463300-102a7eb3cb26?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
},
{
id: 4,
content: <SkeletonFour />,
className:
"md:col-span-3 col-span-1 hover:cursor-pointer shadow rounded-md",
thumbnail: "/image.png",
},
];
50 changes: 27 additions & 23 deletions apps/web/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,26 +73,28 @@ export const Header = () => {
return (
<div className="sticky top-0 z-10 bg-white shadow transition-shadow duration-300 ease-in-out">
<div className="mx-auto flex max-w-7xl items-center justify-between px-4 py-2">
<Link href="/" className="relative hidden h-14 w-32 md:inline-block">
<Image
src="/logo2.svg"
alt="FreshNest Laundry Logo"
fill
className="object-contain"
/>
</Link>
<div className="hidden items-center gap-8 text-sm font-medium text-neutral-600 md:flex">
<Link href="/outlet-kami">Outlet Kami</Link>
<Link href="/layanan-kami">Layanan & Harga</Link>
<Link href="/request">Buat Pesanan</Link>
<div className="flex items-center gap-14">
<Link href="/" className="relative hidden h-14 w-32 md:inline-block">
<Image
src="/logo2.svg"
alt="FreshNest Laundry Logo"
fill
className="object-contain"
/>
</Link>
<div className="hidden items-center gap-8 text-sm text-neutral-600 md:flex">
<Link href="/outlets">Our Outlets</Link>
<Link href="/services">Services and Pricing</Link>
<Link href="/request">Place Order</Link>
</div>
</div>

{session?.user.id ? (
<div className="hidden md:flex">
<DropdownMenu>
<DropdownMenuTrigger className="focus:outline-none">
<div className="flex items-center gap-3">
<div className="text-sm font-medium">{session.user.name}</div>
<div className="text-sm">{session.user.name}</div>
<Avatar>
<AvatarImage
src={session.user.profilePicture}
Expand All @@ -119,19 +121,19 @@ export const Header = () => {
<Link href={`/profile`}>
<DropdownMenuItem className="flex items-center gap-2">
<LuUser2 />
<p>Profile Saya</p>
<p>My Profile</p>
</DropdownMenuItem>
</Link>
<Link href={`/address`}>
<DropdownMenuItem className="flex items-center gap-2">
<LuHome />
<p>Alamat Saya</p>
<p>Saved Addresses</p>
</DropdownMenuItem>
</Link>
<Link href={`/orders`}>
<DropdownMenuItem className="flex items-center gap-2">
<LuHistory />
<p>Pesanan Saya</p>
<p>My Orders</p>
</DropdownMenuItem>
</Link>
<Link href={`/pickup-orders`}>
Expand All @@ -149,13 +151,13 @@ export const Header = () => {
<Link href={`/request`}>
<DropdownMenuItem className="flex items-center gap-2">
<LuShoppingCart />
<p>Buat Pesanan</p>
<p>Place Order</p>
</DropdownMenuItem>
</Link>
<Link href={`/notifications`}>
<DropdownMenuItem className="flex items-center gap-2">
<LuAlertCircle />
<p>Notifikasi</p>
<p>Notification</p>
</DropdownMenuItem>
</Link>
<DropdownMenuSeparator />
Expand Down Expand Up @@ -244,17 +246,19 @@ export const Header = () => {
</Link>

<hr />
<Link href="/address">Alamat Saya</Link>
<Link href="/orders">Pesanan Saya</Link>
<Link href="/address">Saved Addresses</Link>
<Link href="/orders">My Orders</Link>
<Link href="/pickup-orders">Pickup Orders</Link>
<Link href="/delivery-orders">Delivery Orders</Link>

<hr />
</div>
)}

<div className="flex flex-col gap-4 text-neutral-600">
<Link href="/outlet-kami"> Outlet Kami</Link>
<Link href="/layanan-kami">Layanan & Harga</Link>
<Link href="/request">Buat Pesanan</Link>
<Link href="/outlets"> Our Outlets</Link>
<Link href="/services">Services and Pricing</Link>
<Link href="/request">Place Order</Link>
</div>

<hr />
Expand Down
Loading

0 comments on commit d2bb53c

Please sign in to comment.