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

Tony add qr #260

Merged
merged 3 commits into from
Dec 17, 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
6 changes: 3 additions & 3 deletions components/chatbot/ChatBot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ export default function Chatbot() {
onClick={() => setIsOpen((prevState) => !prevState)}
>
{isOpen && <XIcon className="h-8 w-8" />}
{!isOpen && aiNewModelChatbotFlag?._ldMeta.enabled !== false && (
{!isOpen && aiNewModelChatbotFlag?._ldMeta?.enabled !== false && (
<MessageCircleIcon className="h-8 w-8" />
)}
{!isOpen && aiNewModelChatbotFlag?._ldMeta.enabled === false && (
{!isOpen && aiNewModelChatbotFlag?._ldMeta?.enabled === false && (
<BatteryCharging className="h-8 w-8" />
)}
<span className="sr-only">Open Chatbot</span>
Expand Down Expand Up @@ -259,7 +259,7 @@ export default function Chatbot() {
className="flex w-full items-center space-x-2"
onSubmit={(e) => e.preventDefault()}
>
{aiNewModelChatbotFlag?._ldMeta.enabled === false ? (
{aiNewModelChatbotFlag?._ldMeta?.enabled === false ? (
<p className="text-airlinegray">
We are offline for today. Please return next time!
</p>
Expand Down
10 changes: 4 additions & 6 deletions components/ui/QRCodeImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Dialog, DialogContent, DialogTrigger } from "./dialog";

//Change QRURL to the URL where you'll be hosting this app

const QRCodeImage = () => {
const QRCodeImage = ({ textColor="text-black" }: { textColor: string }) => {
const url = new URL(window.location.href);
const QRURL = url.href;
const qrCodeRef = useRef();
Expand Down Expand Up @@ -75,17 +75,15 @@ const QRCodeImage = () => {

<>
<Dialog>
<DialogTrigger asChild>
<QrCode className="w-full h-full text-black" />
<DialogTrigger asChild className="cursor-pointer">
<QrCode className={`w-full h-full ${textColor}`} />
</DialogTrigger>
<DialogContent>
<div className="flex flex-col gap-y-4 items-center">
<h1 className="text-slate-900 text-center text-3xl sm:text-4xl 2xl:text-5xl font-semibold">
Scan me!
</h1>
<div
className="w-full h-full lg:w-[80%] 2xl:w-[100%] p-4 border-2 border-black rounded-md"
>
<div className="w-full h-full lg:w-[80%] 2xl:w-[100%] p-4 border-2 border-black rounded-md">
<QRCode
size={256}
style={{ height: "auto", maxWidth: "100%", width: "100%" }}
Expand Down
2 changes: 1 addition & 1 deletion components/ui/airwayscomponents/AirwaysHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const AirwaysHero = () => {
risk, and ship your travel dreams faster than ever before
</h2> */}

{destinationPickerNewAIModelLDFlag?._ldMeta.enabled !== false && (
{destinationPickerNewAIModelLDFlag?._ldMeta?.enabled !== false && (
<DestinationPicker>
<Button className="bg-airlinedarkblue shadow-xl rounded-3xl w-[15rem] py-6 flex gap-2 animate-pulse hover:animate-none">
<span>
Expand Down
2 changes: 1 addition & 1 deletion components/ui/airwayscomponents/bookedFlights.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ export default function BookedFlights() {
</button>
)}

{aiTravelPromptText?._ldMeta.enabled !== false && (
{aiTravelPromptText?._ldMeta?.enabled !== false && (
<Popover>
<PopoverTrigger className="relative bg-gradient-airways-red text-white font-bold py-3 px-4 w-full animate-pulse hover:animate-none rounded-xl">
AI Travel Insights
Expand Down
4 changes: 2 additions & 2 deletions pages/bank.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ export default function Bank() {
<>
<Image
src={bankHomePageBackgroundRight}
className="fixed right-0 bottom-0 m-h-screen"
className="fixed right-0 bottom-0 min-h-screen"
alt="Bank Home Page Background"
/>
<Image
src={bankHomePageBackgroundLeft}
className="fixed left-0 bottom-0 m-h-screen"
className="fixed left-0 bottom-0 min-h-screen"
alt="Bank Home Page Background"
/>
<BankHomePage />
Expand Down
72 changes: 50 additions & 22 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@ import NavBar from "@/components/ui/navbar";
import Script from "next/script";
import HomePageImage from "@/public/homepage/homepage-title.svg";
import NavWrapper from "@/components/ui/NavComponent/NavWrapper";
import NavbarRightSideWrapper from "@/components/ui/NavComponent/NavbarRightSideWrapper";
import CSNavWrapper from "@/components/ui/NavComponent/CSNavWrapper";
import NavLogo from "@/components/ui/NavComponent/NavLogo";
import { CSNav } from "@/components/ui/csnav";

import { HOMEPAGE_CARDS } from "@/utils/constants";
import { useState, useEffect } from "react";
import { CSNAV_ITEMS } from "@/utils/constants";
import arrow from '@/public/sidenav/arrow.svg'
import arrow from "@/public/sidenav/arrow.svg";
import { CSCard } from "@/components/ui/ldcscard";
import QRCodeImage from "@/components/ui/QRCodeImage";



import Head from "next/head";

const inter = Inter({ subsets: ["latin"] });

Expand Down Expand Up @@ -95,18 +96,35 @@ export default function Home() {

gtag('config', 'G-2ZW2MJ75NL');`}
</Script>
<Head>
<link
rel="preload"
href={"@/public/banking/backgrounds/bank-homepage-background-right.svg"}
as="image"
/>
<link
rel="preload"
href={"@/public/banking/backgrounds/bank-homepage-background-left.svg"}
as="image"
/>
</Head>
<AnimatePresence>
<main className="min-h-screen flex-col items-center justify-center bg-ldblack ">
<div className="w-full text-white flex h-20 shadow-2xl">
<NavWrapper>
<>
<CSNavWrapper>
<NavWrapper>
<>
<CSNavWrapper>
<CSNav />
</CSNavWrapper>
</CSNavWrapper>

<NavLogo />
</>
</NavWrapper>
<NavLogo />
</>

{/* right side navbar template */}
<NavbarRightSideWrapper>
<QRCodeImage textColor="text-white" />
</NavbarRightSideWrapper>
</NavWrapper>
</div>

<header className="relative banner mx-auto w-full sm:w-1/3 sm:h-[24rem] flex items-center bg-ldblack justify-center z-0">
Expand Down Expand Up @@ -146,10 +164,15 @@ export default function Home() {
className="transition-opacity duration-300 hover:opacity-0 rounded-3xl"
/>
<div className="absolute inset-0 mx-10 mt-10 justify-center transition-opacity duration-300 hover:opacity-0 z-10">
<span className="text-white lg:text-3xl sm:text-sm font-sohne">{card.name}</span>
<span className="text-white lg:text-3xl sm:text-sm font-sohne">
{card.name}
</span>
</div>

<div onClick={() => goToVertical(card.link)} className="absolute cursor-pointer inset-0 flex flex-col items-center justify-center opacity-0 transition-opacity duration-300 hover:opacity-100 z-30 group-hover:opacity-100">
<div
onClick={() => goToVertical(card.link)}
className="absolute cursor-pointer inset-0 flex flex-col items-center justify-center opacity-0 transition-opacity duration-300 hover:opacity-100 z-30 group-hover:opacity-100"
>
<Image
src={card.desktopHoveringImage}
alt={`${card.name} Card Hover`}
Expand All @@ -158,19 +181,23 @@ export default function Home() {
className="rounded-3xl"
/>
<div className="absolute inset-0 flex flex-col overflow-auto z-40">
<span className="text-white lg:text-3xl sm:text-sm mx-10 mt-10 font-sohne">{card.name}</span>
<span className="text-white lg:text-lg sm:text-sm mx-10 mt-4">{card.description}</span>
<span className="text-white text-2xl absolute bottom-10 right-10">&#8594;</span>
<span className="text-white lg:text-3xl sm:text-sm mx-10 mt-10 font-sohne">
{card.name}
</span>
<span className="text-white lg:text-lg sm:text-sm mx-10 mt-4">
{card.description}
</span>
<span className="text-white text-2xl absolute bottom-10 right-10">
&#8594;
</span>
</div>
</div>
</motion.div>
))}
</section>
) : (

<div className="grid gap-4 py-4 mx-10">
<div className="grid items-center gap-4">

{Object.entries(CSNAV_ITEMS).map(([key, item]) => {
if (item.type === "usecase") {
return (
Expand All @@ -182,7 +209,10 @@ export default function Home() {
transition={{ delay: 0.05, duration: 0.2 }}
className="cursor-pointer"
>
<div onClick={() => router.push(item.link)} className={`bg-gradient-to-r from-${key}-start to-${key}-end rounded-3xl`}>
<div
onClick={() => router.push(item.link)}
className={`bg-gradient-to-r from-${key}-start to-${key}-end rounded-3xl`}
>
<CSCard
className="cursor-pointer"
cardTitle={item.title}
Expand All @@ -197,13 +227,11 @@ export default function Home() {
}
return null;
})}

</div>
</div>

)}
</main>
</AnimatePresence >
</AnimatePresence>
</>
);
}
}
Loading