diff --git a/app/actions/favorite-actions.ts b/app/actions/favorite-actions.ts index 6c08b61..8bc7196 100644 --- a/app/actions/favorite-actions.ts +++ b/app/actions/favorite-actions.ts @@ -1,7 +1,10 @@ "use server" import { revalidatePath } from "next/cache" -import { createFavorite, unfavoriteHome } from "../repo/favorite-repo" +import { + createFavorite, + unfavoriteHome +} from "../repo/favorite-repo" export async function addToFavorite(formData: FormData) { const pathname = String(formData.get("pathname")) diff --git a/app/actions/home-actions.ts b/app/actions/home-actions.ts index 8d61348..ab79802 100644 --- a/app/actions/home-actions.ts +++ b/app/actions/home-actions.ts @@ -1,7 +1,13 @@ "use server" import { redirect } from "next/navigation" -import { createHome, findHomeByUserId, updateHomeCategory, updateHomeDescription, updateHomeLocation } from "../repo/home-repo" +import { + createHome, + findHomeByUserId, + updateHomeCategory, + updateHomeDescription, + updateHomeLocation +} from "../repo/home-repo" export async function createAirbnbHome({ userId }: { userId: string }) { const data = await findHomeByUserId(userId) diff --git a/app/actions/reservation-actions.ts b/app/actions/reservation-actions.ts index 4cf98d7..0d459c1 100644 --- a/app/actions/reservation-actions.ts +++ b/app/actions/reservation-actions.ts @@ -4,12 +4,6 @@ import { redirect } from "next/navigation" import { createReservation } from "../repo/reservation-repo" export async function setReservation(formData: FormData) { - const userId = String(formData.get("userId")) - const homeId = String(formData.get("homeId")) - const startDate = String(formData.get("startDate")) - const endDate = String(formData.get("endDate")) - const data = await createReservation(formData) - redirect("/") } \ No newline at end of file diff --git a/app/api/auth/creation/route.ts b/app/api/auth/creation/route.ts index 1831e0c..7d3790b 100644 --- a/app/api/auth/creation/route.ts +++ b/app/api/auth/creation/route.ts @@ -1,4 +1,7 @@ -import { createUser, getUserById } from "@/app/repo/user-repo"; +import { + createUser, + getUserById +} from "@/app/repo/user-repo"; import { getKindeServerSession } from "@kinde-oss/kinde-auth-nextjs/server"; import { NextResponse } from "next/server"; diff --git a/app/components/Creation/Counter.tsx b/app/components/Creation/Counter.tsx index f7e0172..fbbd75b 100644 --- a/app/components/Creation/Counter.tsx +++ b/app/components/Creation/Counter.tsx @@ -1,7 +1,10 @@ "use client" import { Button } from "@/components/ui/button"; -import { Minus, Plus } from "lucide-react"; +import { + Minus, + Plus +} from "lucide-react"; import { useState } from "react"; export function Counter({ name }: { name: string }) { diff --git a/app/components/Creation/Map.tsx b/app/components/Creation/Map.tsx index 7554d8c..651cc9e 100644 --- a/app/components/Creation/Map.tsx +++ b/app/components/Creation/Map.tsx @@ -1,13 +1,17 @@ "use client" -import { MapContainer, Marker, TileLayer } from 'react-leaflet' +import { + MapContainer, + Marker, + TileLayer +} from 'react-leaflet' import "leaflet/dist/leaflet.css" import { useCountries } from '../../lib/hooks' import { icon } from 'leaflet' const ICON = icon({ iconUrl: "https://cdn-icons-png.freepik.com/256/399/399396.png?semt=ais_hybrid", - iconSize: [20, 20] + iconSize: [20, 20] }) export default function Map({ locationValue }: { locationValue: string }) { @@ -24,7 +28,7 @@ export default function Map({ locationValue }: { locationValue: string }) { attribution='© OpenStreetMap contributors' url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" /> - + ) } \ No newline at end of file diff --git a/app/components/Creation/MapFilterItems.tsx b/app/components/Creation/MapFilterItems.tsx index 1aa3ff7..b147c05 100644 --- a/app/components/Creation/MapFilterItems.tsx +++ b/app/components/Creation/MapFilterItems.tsx @@ -3,7 +3,10 @@ import Link from "next/link"; import { categoryItems } from "../../lib/categories"; import Image from "next/image"; -import { usePathname, useSearchParams } from "next/navigation"; +import { + usePathname, + useSearchParams +} from "next/navigation"; import { useCallback } from "react"; import { cn } from "@/lib/utils"; import { ICategory } from "../../types"; diff --git a/app/components/Home/HomeCard.tsx b/app/components/Home/HomeCard.tsx index 521c5f0..61925c4 100644 --- a/app/components/Home/HomeCard.tsx +++ b/app/components/Home/HomeCard.tsx @@ -2,8 +2,14 @@ import Image from "next/image"; import { IHome } from "../../types"; import Link from "next/link"; import { useCountries } from "../../lib/hooks"; -import { FavoriteButton, UnfavoriteButton } from "../Creation/SubmitButtons"; -import { addToFavorite, unfavorite } from "../../actions/favorite-actions"; +import { + FavoriteButton, + UnfavoriteButton +} from "../Creation/SubmitButtons"; +import { + addToFavorite, + unfavorite +} from "../../actions/favorite-actions"; interface IProps extends IHome { userId: string | undefined, diff --git a/app/components/Home/SelectCalendar.tsx b/app/components/Home/SelectCalendar.tsx index 6141ccc..396dac6 100644 --- a/app/components/Home/SelectCalendar.tsx +++ b/app/components/Home/SelectCalendar.tsx @@ -5,7 +5,6 @@ import 'react-date-range/dist/theme/default.css'; import { DateRange } from 'react-date-range'; import { useState } from 'react'; import { eachDayOfInterval } from 'date-fns'; -import { start } from 'repl'; export function SelectCalendar({ reservation diff --git a/app/components/Navs/FirstStep.tsx b/app/components/Navs/FirstStep.tsx deleted file mode 100644 index 768bfa9..0000000 --- a/app/components/Navs/FirstStep.tsx +++ /dev/null @@ -1,33 +0,0 @@ -export function FirstStep() { - return ( - <> - - Select a country - Please choose a country - - - - - ) -} \ No newline at end of file diff --git a/app/components/Navs/SearchModal.tsx b/app/components/Navs/SearchModal.tsx index ab1b932..85e4b38 100644 --- a/app/components/Navs/SearchModal.tsx +++ b/app/components/Navs/SearchModal.tsx @@ -1,8 +1,24 @@ "use client" import { useCountries } from "@/app/lib/hooks"; -import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog"; -import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrigger, SelectValue } from "@/components/ui/select"; +import { + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, + DialogTrigger +} from "@/components/ui/dialog"; +import { + Select, + SelectContent, + SelectGroup, + SelectItem, + SelectLabel, + SelectTrigger, + SelectValue +} from "@/components/ui/select"; import { Search } from "lucide-react"; import { useState } from "react"; import { HomeMap } from "../Home/HomeMap"; diff --git a/app/components/Navs/UserNav.tsx b/app/components/Navs/UserNav.tsx index bb2b6a0..14c2569 100644 --- a/app/components/Navs/UserNav.tsx +++ b/app/components/Navs/UserNav.tsx @@ -1,6 +1,16 @@ -import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "@/components/ui/dropdown-menu"; -import { LoginLink, LogoutLink, RegisterLink } from "@kinde-oss/kinde-auth-nextjs/components"; +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuSeparator, + DropdownMenuTrigger +} from "@/components/ui/dropdown-menu"; +import { + LoginLink, + LogoutLink, + RegisterLink +} from "@kinde-oss/kinde-auth-nextjs/components"; import { getKindeServerSession } from "@kinde-oss/kinde-auth-nextjs/server"; import { MenuIcon } from "lucide-react"; import Link from "next/link"; diff --git a/app/create/[id]/description/page.tsx b/app/create/[id]/description/page.tsx index 9e5f784..49abb84 100644 --- a/app/create/[id]/description/page.tsx +++ b/app/create/[id]/description/page.tsx @@ -1,10 +1,8 @@ import { setDescription } from "@/app/actions/home-actions"; import { BottomBar } from "@/app/components/Creation/BottomBar"; -import { Counter } from "@/app/components/Creation/Counter"; import { DescriptionItem } from "@/app/components/Creation/DescriptionItem"; import { descriptionItems } from "@/app/lib/description-items"; -import { updateHomeDescription } from "@/app/repo/home-repo"; -import { Card, CardHeader } from "@/components/ui/card"; +import { Card } from "@/components/ui/card"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Textarea } from "@/components/ui/textarea"; diff --git a/app/create/[id]/location/page.tsx b/app/create/[id]/location/page.tsx index 4559c09..7a6b85a 100644 --- a/app/create/[id]/location/page.tsx +++ b/app/create/[id]/location/page.tsx @@ -3,7 +3,15 @@ import { setLocation } from "@/app/actions/home-actions"; import { BottomBar } from "@/app/components/Creation/BottomBar"; import { useCountries } from "@/app/lib/hooks"; -import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrigger, SelectValue } from "@/components/ui/select"; +import { + Select, + SelectContent, + SelectGroup, + SelectItem, + SelectLabel, + SelectTrigger, + SelectValue +} from "@/components/ui/select"; import { Skeleton } from "@/components/ui/skeleton"; import dynamic from "next/dynamic"; import { useState } from "react"; diff --git a/app/favorites/loading.tsx b/app/favorites/loading.tsx index 78d8852..9c3bdc4 100644 --- a/app/favorites/loading.tsx +++ b/app/favorites/loading.tsx @@ -1,5 +1,3 @@ -import { Skeleton } from "@/components/ui/skeleton"; -import { SkeletonLoading } from "../components/Loading/SkeletonLoading"; import SkeletonItem from "../components/Loading/SkeletonItem"; export default function FavoritesLoading() { diff --git a/app/favorites/page.tsx b/app/favorites/page.tsx index 68ca49e..49359ab 100644 --- a/app/favorites/page.tsx +++ b/app/favorites/page.tsx @@ -2,7 +2,6 @@ import { getKindeServerSession } from "@kinde-oss/kinde-auth-nextjs/server" import { getFavorites } from "../repo/favorite-repo" import { redirect } from "next/navigation" import HomeCard from "../components/Home/HomeCard" -import { it } from "node:test" export default async function Favorites() { const { getUser } = getKindeServerSession() diff --git a/app/home/[id]/loading.tsx b/app/home/[id]/loading.tsx index 00b385e..50418d2 100644 --- a/app/home/[id]/loading.tsx +++ b/app/home/[id]/loading.tsx @@ -11,7 +11,7 @@ export default function HomeLoading() {
- +
diff --git a/app/lib/categories.ts b/app/lib/categories.ts index 61b03d4..12b52e2 100644 --- a/app/lib/categories.ts +++ b/app/lib/categories.ts @@ -1,108 +1,108 @@ import { ICategory } from "../types"; export const categoryItems: ICategory[] = [ - { - id: 0, - name: "beach", - description: "This Property is close to the Beach.", - title: "Beach", - imageUrl: - "https://a0.muscache.com/pictures/10ce1091-c854-40f3-a2fb-defc2995bcaf.jpg", - }, - { - id: 1, - name: "trending", - description: "This is a Property which is trending.", - title: "Trending", - imageUrl: - "https://a0.muscache.com/pictures/3726d94b-534a-42b8-bca0-a0304d912260.jpg", - }, - { - id: 2, - name: "beachfront", - description: "This is a Property is close to the beachfront", - title: "Beachfront", - imageUrl: - "https://a0.muscache.com/pictures/bcd1adc0-5cee-4d7a-85ec-f6730b0f8d0c.jpg", - }, - { - id: 3, - name: "erathhome", - description: "This Property is considerd a Earth Home", - title: "Earth Home", - imageUrl: - "https://a0.muscache.com/pictures/d7445031-62c4-46d0-91c3-4f29f9790f7a.jpg", - }, - { - id: 4, - name: "luxe", - description: "This Property is considerd Luxorious", - title: "Luxe", - imageUrl: - "https://a0.muscache.com/pictures/c8e2ed05-c666-47b6-99fc-4cb6edcde6b4.jpg", - }, - { - id: 5, - name: "amazingView", - description: "This property has an amazing View", - title: "Amazing View", - imageUrl: - "https://a0.muscache.com/pictures/3b1eb541-46d9-4bef-abc4-c37d77e3c21b.jpg", - }, - { - id: 6, - name: "design", - description: "This property puts a big focus on design ", - title: "Design", - imageUrl: - "https://a0.muscache.com/pictures/50861fca-582c-4bcc-89d3-857fb7ca6528.jpg", - }, - { - id: 7, - name: "pool", - description: "This property has an amazing Pool", - title: "Pool", - imageUrl: - "https://a0.muscache.com/pictures/3fb523a0-b622-4368-8142-b5e03df7549b.jpg", - }, - { - id: 8, - name: "tiny", - description: "This property is considered a tiny home", - title: "Tiny Home", - imageUrl: - "https://a0.muscache.com/pictures/3271df99-f071-4ecf-9128-eb2d2b1f50f0.jpg", - }, - { - id: 9, - name: "historic", - description: "This Property is considered historic", - title: "Historic Home", - imageUrl: - "https://a0.muscache.com/pictures/33dd714a-7b4a-4654-aaf0-f58ea887a688.jpg", - }, - { - id: 10, - name: "countryside", - description: "This Property is located on the countryside", - title: "Countryside", - imageUrl: - "https://a0.muscache.com/pictures/6ad4bd95-f086-437d-97e3-14d12155ddfe.jpg", - }, - { - id: 11, - name: "omg", - description: "This Property has a wow factor", - title: "WOW!", - imageUrl: - "https://a0.muscache.com/pictures/c5a4f6fc-c92c-4ae8-87dd-57f1ff1b89a6.jpg", - }, - { - id: 12, - name: "surfing", - description: "This Property is located near to a surfing spot", - title: "Surfing", - imageUrl: - "https://a0.muscache.com/pictures/957f8022-dfd7-426c-99fd-77ed792f6d7a.jpg", - }, - ]; \ No newline at end of file + { + id: 0, + name: "beach", + description: "This Property is close to the Beach.", + title: "Beach", + imageUrl: + "https://a0.muscache.com/pictures/10ce1091-c854-40f3-a2fb-defc2995bcaf.jpg", + }, + { + id: 1, + name: "trending", + description: "This is a Property which is trending.", + title: "Trending", + imageUrl: + "https://a0.muscache.com/pictures/3726d94b-534a-42b8-bca0-a0304d912260.jpg", + }, + { + id: 2, + name: "beachfront", + description: "This is a Property is close to the beachfront", + title: "Beachfront", + imageUrl: + "https://a0.muscache.com/pictures/bcd1adc0-5cee-4d7a-85ec-f6730b0f8d0c.jpg", + }, + { + id: 3, + name: "erathhome", + description: "This Property is considerd a Earth Home", + title: "Earth Home", + imageUrl: + "https://a0.muscache.com/pictures/d7445031-62c4-46d0-91c3-4f29f9790f7a.jpg", + }, + { + id: 4, + name: "luxe", + description: "This Property is considerd Luxorious", + title: "Luxe", + imageUrl: + "https://a0.muscache.com/pictures/c8e2ed05-c666-47b6-99fc-4cb6edcde6b4.jpg", + }, + { + id: 5, + name: "amazingView", + description: "This property has an amazing View", + title: "Amazing View", + imageUrl: + "https://a0.muscache.com/pictures/3b1eb541-46d9-4bef-abc4-c37d77e3c21b.jpg", + }, + { + id: 6, + name: "design", + description: "This property puts a big focus on design ", + title: "Design", + imageUrl: + "https://a0.muscache.com/pictures/50861fca-582c-4bcc-89d3-857fb7ca6528.jpg", + }, + { + id: 7, + name: "pool", + description: "This property has an amazing Pool", + title: "Pool", + imageUrl: + "https://a0.muscache.com/pictures/3fb523a0-b622-4368-8142-b5e03df7549b.jpg", + }, + { + id: 8, + name: "tiny", + description: "This property is considered a tiny home", + title: "Tiny Home", + imageUrl: + "https://a0.muscache.com/pictures/3271df99-f071-4ecf-9128-eb2d2b1f50f0.jpg", + }, + { + id: 9, + name: "historic", + description: "This Property is considered historic", + title: "Historic Home", + imageUrl: + "https://a0.muscache.com/pictures/33dd714a-7b4a-4654-aaf0-f58ea887a688.jpg", + }, + { + id: 10, + name: "countryside", + description: "This Property is located on the countryside", + title: "Countryside", + imageUrl: + "https://a0.muscache.com/pictures/6ad4bd95-f086-437d-97e3-14d12155ddfe.jpg", + }, + { + id: 11, + name: "omg", + description: "This Property has a wow factor", + title: "WOW!", + imageUrl: + "https://a0.muscache.com/pictures/c5a4f6fc-c92c-4ae8-87dd-57f1ff1b89a6.jpg", + }, + { + id: 12, + name: "surfing", + description: "This Property is located near to a surfing spot", + title: "Surfing", + imageUrl: + "https://a0.muscache.com/pictures/957f8022-dfd7-426c-99fd-77ed792f6d7a.jpg", + }, +]; \ No newline at end of file diff --git a/app/repo/favorite-repo.ts b/app/repo/favorite-repo.ts index 3c0630a..07d7ede 100644 --- a/app/repo/favorite-repo.ts +++ b/app/repo/favorite-repo.ts @@ -25,7 +25,7 @@ export async function unfavoriteHome(formData: FormData) { }) } -export async function getFavorites(userId: string){ +export async function getFavorites(userId: string) { return prisma.favorite.findMany({ where: { userId: userId diff --git a/app/utils.ts b/app/utils.ts index bc71eff..c59c435 100644 --- a/app/utils.ts +++ b/app/utils.ts @@ -1,8 +1,8 @@ export function getFileNameWithoutExtension(filename: string) { - var lastIndex = filename.lastIndexOf("."); - if (lastIndex === -1) { - return filename; - } else { - return filename.substring(0, lastIndex); - } - } \ No newline at end of file + var lastIndex = filename.lastIndexOf("."); + if (lastIndex === -1) { + return filename; + } else { + return filename.substring(0, lastIndex); + } +} \ No newline at end of file diff --git a/components/ui/button.tsx b/components/ui/button.tsx index 0ba4277..b99c50f 100644 --- a/components/ui/button.tsx +++ b/components/ui/button.tsx @@ -35,7 +35,7 @@ const buttonVariants = cva( export interface ButtonProps extends React.ButtonHTMLAttributes, - VariantProps { + VariantProps { asChild?: boolean }