Skip to content

Commit

Permalink
v2 new updater
Browse files Browse the repository at this point in the history
  • Loading branch information
git-create-devben committed Jul 31, 2024
1 parent 771bb9a commit 935fd0a
Show file tree
Hide file tree
Showing 31 changed files with 3,933 additions and 1,830 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts
firebaseAdmin.json
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
{
"cSpell.words": [
"admindb",
"autosize",
"Bookingaction",
"chatpage",
"Deafultchatpage",
"firstvisitpopup",
"geocode",
"googlemaps",
"Horizonal",
"Jsons",
"Loca",
Expand Down
4 changes: 2 additions & 2 deletions app/api/gemini/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export async function POST(req: NextRequest) {

if (!userMessage || !latitude || !longitude) {
return new Response(
JSON.stringify({ error: "Missing required fields: userMessage, latitude, or longitude" }),
JSON.stringify({ error: "----- Missing required fields: userMessage, latitude, or longitude -----" }),
{ status: 400 }
);
}
Expand Down Expand Up @@ -46,7 +46,7 @@ export async function POST(req: NextRequest) {
await writeChunk({ type: 'text', data: chunkText });
}
} catch (error) {
console.error("Server Error:", error);
console.error(" ---- Server Error:", error);
await writeChunk({ type: 'error', data: "An error occurred while processing your request." });
} finally {
writer.close();
Expand Down
12 changes: 12 additions & 0 deletions app/chat/booking/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { BookingForm } from "@/components/bookingForm";
import React from "react";

const Booking = () => {
return (
<div>
<BookingForm />
</div>
);
};

export default Booking;
38 changes: 38 additions & 0 deletions app/chat/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { Nav } from "@/components/nav";
import Sidebar from "@/components/sidebar";
import type { Metadata } from "next";
import { MantineProvider } from "@mantine/core";
import { Suspense } from "react";
import { SkeletonCard } from "@/components/loading";

export const metadata: Metadata = {
title: "Chat with Loca",
description: "Instantly connect with Local Expert",
};

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body suppressHydrationWarning>
<Suspense fallback={<SkeletonCard />}>
<MantineProvider>
<div className="flex h-[100vh]">
<div className="hidden lg:block ">
<Sidebar />
</div>

<div className="flex-1 bg-black overflow-hidden">
<Nav />
<div className="mt-8">{children}</div>
</div>
</div>
</MantineProvider>
</Suspense>
</body>
</html>
);
}
52 changes: 2 additions & 50 deletions app/chat/page.tsx
Original file line number Diff line number Diff line change
@@ -1,60 +1,12 @@
"use client";
import Main from "@/components/main";
import Sidebar from "@/components/sidebar";
import { onAuthStateChanged } from "firebase/auth";
import { useEffect, useState } from "react";
import { auth } from "@/lib/firebase";
import local from "@/public/png/logo-black.png";
import Image from "next/image";
import FirstVisitPopup from "@/components/firstvisitpopup";
import { SignOut } from "@/lib/signIn";
import { LogOut } from "lucide-react";
export default function Chat() {
const [user, setUser] = useState(auth.currentUser);
const image = user?.photoURL || local;

useEffect(() => {
const unsubscribe = onAuthStateChanged(auth, (currentUser) => {
setUser(currentUser);
});

return () => unsubscribe();
});
return (
<main className=" flex bg-black">
<main className=" bg-black">
<FirstVisitPopup />
<div className=" hidden lg:block">
<Sidebar />
</div>
<div className=" bg-[#1212] flex-1 min-h-[100vh] pb-[15vh] relative ">
<div className=" bg-[#1212] min-h-[100vh] pb-[15vh] relative ">
<div className="flex flex-col max-h-[830px] overflow-y-scroll scroll-m-1">
<div className="sticky top-0 w-full shadow-md">
<nav className="flex justify-between p-4 ">
<span
className="text-[#caccce] font-medium text-3xl cursor-pointer"
onClick={() => (window.location.href = "/")}
>
Loca
</span>
<div className="flex gap-6 items-center">
<div
className="flex gap-1 cursor-pointer text-[#ccc] lg:hidden xl:flex"
onClick={SignOut}
>
<LogOut />
<span className="animate-fadeIn xs:hidden">LogOut</span>
</div>
<Image
src={image}
alt="user"
className="rounded-full"
width={50}
height={50}
/>
</div>
</nav>
</div>

<div className="self-center max-w-[900px] m-auto h-screen px-4">
<Main />
</div>
Expand Down
77 changes: 77 additions & 0 deletions app/faq/data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
export const faqs = [
{
emoji: "❓",
question: "What is Loca?",
answer: "Loca is a Localized Service Finder that helps you discover and book local services based on your needs. It uses natural language processing to provide relevant information quickly.",
},
{
emoji: "🔍",
question: "How do I search for a service?",
answer: "Simply type your query in the search bar, and Loca will provide you with a list of available local services matching your criteria.",
},
{
emoji: "📞",
question: "Can I contact the service providers directly?",
answer: "Yes, you can! Loca provides the contact number for each service provider, allowing you to call them directly for more information or to book a service.",
},
{
emoji: "🖥️",
question: "Can I visit the service provider's website?",
answer: "Yes, Loca includes links to the service providers' websites, where available, so you can learn more about their offerings and services.",
},
{
emoji: "📅",
question: "Can I book a service through Loca?",
answer: "Absolutely! Loca allows you to book services directly through the platform, making it easy and convenient to arrange appointments.",
},
{
emoji: "🔄",
question: "How frequently is the service information updated?",
answer: "Loca updates service information regularly to ensure accuracy and relevance, providing you with the latest details available.",
},
{
emoji: "🌐",
question: "Is Loca available in multiple languages?",
answer: "Currently, Loca primarily supports English, but we are working on adding more language options to serve a wider audience.",
},
{
emoji: "🛠️",
question: "What types of services can I find on Loca?",
answer: "Loca offers a wide range of services, including healthcare, beauty, home maintenance, and more. Whatever you need, Loca can help you find it.",
},
{
emoji: "💸",
question: "Are there any costs associated with using Loca?",
answer: "Loca is free to use for finding and booking services. However, the cost of the services themselves depends on the provider.",
},
{
emoji: "📧",
question: "How can I provide feedback or suggest improvements?",
answer: "We welcome your feedback! You can contact us through our support page or email us directly with your suggestions and comments.",
},
{
emoji: "👥",
question: "Can businesses register their services on Loca?",
answer: "Yes, businesses can register to offer their services on Loca. Please visit our 'For Business' section to learn more and get started.",
},
{
emoji: "📈",
question: "How does Loca prioritize the services shown?",
answer: "Loca uses a combination of user ratings, relevance, and proximity to prioritize services, ensuring you get the best options available.",
},
{
emoji: "🔐",
question: "Is my data safe with Loca?",
answer: "We take your privacy seriously. Loca uses advanced security measures to protect your data and ensure it is used only for service-related purposes.",
},
{
emoji: "🚀",
question: "How quickly can I expect to find and book a service?",
answer: "Loca is designed for speed and convenience. You can typically find and book a service within minutes, depending on availability and your specific needs.",
},
{
emoji: "🏆",
question: "What makes Loca different from other service finders?",
answer: "Loca stands out with its localized approach, natural language processing, and easy-to-use interface, making it simple to find and book the best local services.",
},
];
37 changes: 23 additions & 14 deletions app/faq/page.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
"use client"
import React, { useState } from 'react'

"use client";
import Navbar from "@/components/navbar";
import React, { useState } from "react";
import { Accordion } from "@mantine/core";
import { faqs } from "./data";
const FAQ = () => {
const [open, setOpen] = useState(false)
const [open, setOpen] = useState(false);
const items = faqs.map((item) => (
<Accordion.Item key={item.question} value={item.question} style={{backgroundColor: "#222327", color: "#e3e3e3", borderBottomStyle: "none", marginTop: "6px"}}>
<Accordion.Control icon={item.emoji} style={{backgroundColor: "#222327", color: "#e3e3e3",padding: "5px" }}>{item.question}</Accordion.Control>
<Accordion.Panel>{item.answer}</Accordion.Panel>
</Accordion.Item>
));
return (
<main>
<div className=''>
<h1>LOCA AI FAQ</h1>
<div>
<h2>What&amp;s LOCA?</h2>

<main className="min-h-screen h-screen overflow-hidden flex flex-col">
<div className="text-white flex-1 overflow-scroll p-2 lg:p-5 bg-[#131314]">
<Navbar />
<div className=" w-full max-w-6xl mx-auto h-screen max-h-96 mt-10 px-3">
<h1 className="text-center text-3xl text-[#e3e3e3]">What is Loca AI?</h1>
<Accordion defaultValue="Apples" transitionDuration={1000}>{items}</Accordion>
</div>
</div>
</div>
</main>
)
}
);
};

export default FAQ;

export default FAQ
5 changes: 3 additions & 2 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ export default function RootLayout({
}>) {
return (
<html lang="en">
<body className={inter.className}>
{children} <Toaster position="top-right"/></body>
<body className={inter.className} suppressHydrationWarning>
{children} <Toaster position="top-right" />
</body>
</html>
);
}
10 changes: 5 additions & 5 deletions components/CardCarousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export const CardCarousel = () => {
const image = user?.photoURL || local;
const robotText = `Hi ${user?.displayName}, Yes! I found a great one nearby. Check it out and book now.`;
return (
<div className="flex gap-12 items-center">
<div className="relative bg-[#34343677] w-full max-w-[30rem] h-[21rem]">
<div className="flex gap-12 items-center justify-center">
<div className="relative bg-[#34343677] w-full max-w-[35rem] h-[21rem]">
<div className=" p-4 rounded-lg">
<div className="flex gap-2">
<Image
Expand All @@ -37,7 +37,7 @@ export const CardCarousel = () => {

<div className="space-y-4">
{!showResponse && text && (
<div className="mt-32 ml-20">
<div className="mt-32 mx-auto">
<h1 className="animate-pulse bg-clip-text text-transparent bg-gradient-to-r from-blue-700 to-red-600 text-6xl">
Loca AI
</h1>
Expand All @@ -46,7 +46,7 @@ export const CardCarousel = () => {
{showResponse && (
<div className="text-[#caccce]">
<Typewriter
onInit={(t) => {
onInit={(t:any) => {
t.typeString(robotText)
.callFunction(() => {
setShowCard(true);
Expand Down Expand Up @@ -98,7 +98,7 @@ export const CardCarousel = () => {

<div className="space-y-4">
{!showResponse && text && (
<div className="mt-32 ml-20">
<div className="mt-32 mx-auto">
<h1 className="animate-pulse bg-clip-text text-transparent bg-gradient-to-r from-blue-700 to-red-600 text-6xl">
Loca AI
</h1>
Expand Down
5 changes: 4 additions & 1 deletion components/LocalServiceCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ export const LocalServiceCard: React.FC<LocalServiceCardProps> = ({
rating,
user_ratings_total,
place_id,
phone_number,
website,
email,
}) => {
return (
<div className=" border-[2px] border-[#caccce] border-dotted p-4 space-y-2 mb-4 w-full lg:max-w-[410px] text-left">
Expand All @@ -25,7 +28,7 @@ export const LocalServiceCard: React.FC<LocalServiceCardProps> = ({
</Link>
Book Now
</Button> */}
<Booking mapLink={`https://www.google.com/maps/place/?q=place_id:${place_id}`} locationName={address} providerName={name}/>
<Booking mapLink={`https://www.google.com/maps/place/?q=place_id:${place_id}`} locationName={address} providerName={name} providerPhone={phone_number} providerEmail={email} providerWebsite={website}/>
</div>
);
};
Loading

0 comments on commit 935fd0a

Please sign in to comment.