Skip to content

Commit

Permalink
Merge pull request #84 from TEDx-SJEC/team_and_refactors
Browse files Browse the repository at this point in the history
Team and refactors
  • Loading branch information
gdsc-sjec-github authored Nov 28, 2024
2 parents aa8f587 + 10cc9bc commit 10e1c80
Show file tree
Hide file tree
Showing 8 changed files with 906 additions and 818 deletions.
85 changes: 30 additions & 55 deletions src/app/(legal)/privacy/page.tsx
Original file line number Diff line number Diff line change
@@ -1,68 +1,43 @@
"use client";

import BackButton from "@/components/shared/back-button";
import Container from "@/components/shared/container";
import { Text } from "@/components/shared/text";
import { legalInfo } from "@/data/legal-info";
import { cn } from "@/lib/utils";
import { useRouter } from "next/navigation";


export default function PrivacyPolicy() {
const router = useRouter();
return (
<Container className="mx-auto mt-24 md:mt-32 mb-1">
<div className="py-10 px-6 sm:px-12 md:px-20 lg:px-32 space-y-8 text-red-600 rounded-lg shadow-lg backdrop-blur-md">
<div className="flex items-center justify-start">
<button
className="text-red-600 hover:text-red-800 flex items-center space-x-2"
onClick={() => router.back()}
>
<svg
className="w-5 h-5"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M15 19l-7-7 7-7"
/>
</svg>
<span>Back</span>
</button>
</div>

return (
<Container className="mx-auto mt-24 md:mt-32 mb-1">
<div className="py-10 px-6 sm:px-12 md:px-20 lg:px-32 space-y-8 text-red-600 rounded-lg shadow-lg backdrop-blur-md">
<BackButton />

<Text
variant="h1"
className={cn("text-4xl md:text-5xl font-bold text-center")}
>
Privacy Policy
</Text>
<Text variant="h1" className={cn("text-4xl md:text-5xl font-bold text-center")}>
Privacy Policy
</Text>

<div className="space-y-6">
{legalInfo.Privacy.map((privacy, index) => (
<div
key={index}
className=" border-gray-700 pb-2 mb-2 last:border-none last:pb-0 last:mb-0"
>
<Text
variant="h3"
className={cn(
"text-2xl md:text-3xl font-semibold mb-1 text-gray-200"
)}
>
{privacy.title}
</Text>
<div className="space-y-6">
{legalInfo.Privacy.map((privacy, index) => (
<div
key={index}
className=" border-gray-700 pb-2 mb-2 last:border-none last:pb-0 last:mb-0"
>
<Text
variant="h3"
className={cn("text-2xl md:text-3xl font-semibold mb-1 text-gray-200")}
>
{privacy.title}
</Text>

<p className="text-base md:text-lg text-gray-400 leading-7 md:leading-8 text-justify">
{privacy.description}
</p>
<p className="text-base md:text-lg text-gray-400 leading-7 md:leading-8 text-justify">
{privacy.description}
</p>
</div>
))}
</div>
</div>
))}
</div>
</div>
</Container>
);
</Container>
);
}
91 changes: 35 additions & 56 deletions src/app/(legal)/refund/page.tsx
Original file line number Diff line number Diff line change
@@ -1,69 +1,48 @@
"use client";

import BackButton from "@/components/shared/back-button";
import Container from "@/components/shared/container";
import { Text } from "@/components/shared/text";
import { legalInfo } from "@/data/legal-info";
import { cn } from "@/lib/utils";
import Link from "next/link"; // To create a back link
import { useRouter } from "next/navigation";

export default function Refund() {
const router = useRouter();
return (
<Container className="mx-auto mt-24 md:mt-32 mb-1">
<div className="py-10 px-6 sm:px-12 md:px-20 lg:px-32 space-y-8 text-red-600 rounded-lg shadow-lg backdrop-blur-md">
<div className="flex items-center justify-start">
<button className="text-red-600 hover:text-red-800 flex items-center space-x-2"
onClick={() => router.back()}>
<svg
className="w-5 h-5"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M15 19l-7-7 7-7"
/>
</svg>
<span>Back</span>
</button>
</div>
return (
<Container className="mx-auto mt-24 md:mt-32 mb-1">
<div className="py-10 px-6 sm:px-12 md:px-20 lg:px-32 space-y-8 text-red-600 rounded-lg shadow-lg backdrop-blur-md">
<BackButton />

{/* Title Section */}
<div className="text-center">
<Text variant="h1" className={cn("text-4xl md:text-5xl font-bold text-center")}>
Refund Policy
</Text>
</div>
{/* Title Section */}
<div className="text-center">
<Text variant="h1" className={cn("text-4xl md:text-5xl font-bold text-center")}>
Refund Policy
</Text>
</div>

{/* Policy Sections */}
<div className="space-y-6">
{legalInfo.Refund.map((refund, index) => (
<div
key={index}
className="border-gray-700 pb-2 mb-2 last:border-none last:pb-0 last:mb-0"
>
{/* Section Title */}
<Text
variant="h3"
className={cn("text-2xl md:text-3xl font-semibold mb-1 text-gray-200")}
>
{refund.title}
</Text>
{/* Policy Sections */}
<div className="space-y-6">
{legalInfo.Refund.map((refund, index) => (
<div
key={index}
className="border-gray-700 pb-2 mb-2 last:border-none last:pb-0 last:mb-0"
>
{/* Section Title */}
<Text
variant="h3"
className={cn("text-2xl md:text-3xl font-semibold mb-1 text-gray-200")}
>
{refund.title}
</Text>

{/* Section Description */}
<p
className="text-base md:text-lg text-gray-400 leading-7 md:leading-8 text-justify"
dangerouslySetInnerHTML={{ __html: refund.description }}
></p>
{/* Section Description */}
<p
className="text-base md:text-lg text-gray-400 leading-7 md:leading-8 text-justify"
dangerouslySetInnerHTML={{ __html: refund.description }}
></p>
</div>
))}
</div>
</div>
))}
</div>
</div>
</Container>
);
</Container>
);
}
87 changes: 30 additions & 57 deletions src/app/(legal)/terms/page.tsx
Original file line number Diff line number Diff line change
@@ -1,67 +1,40 @@
"use client";

import BackButton from "@/components/shared/back-button";
import Container from "@/components/shared/container";
import { Text } from "@/components/shared/text";
import { Button } from "@/components/ui/button";
import { legalInfo } from "@/data/legal-info";
import { cn } from "@/lib/utils";
import Link from "next/link";
import { useRouter } from "next/navigation";


export default function TermsAndConditions() {
const router = useRouter();
return (
<Container className="mx-auto mt-24 md:mt-32 mb-1">
<div className="py-10 px-6 sm:px-12 md:px-20 lg:px-32 space-y-8 text-red-600 rounded-lg shadow-lg backdrop-blur-md">
<div className="flex items-center justify-start">
<button
className="text-red-600 hover:text-red-800 flex items-center space-x-2"
onClick={() => router.back()}
>
<svg
className="w-5 h-5"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M15 19l-7-7 7-7"
/>
</svg>
<span>Back</span>
</button>
</div>
<Text
variant="h1"
className={cn("text-4xl md:text-5xl font-bold text-center")}
>
Terms and Conditions
</Text>
<div className="space-y-6">
{legalInfo.Terms.map((terms, index) => (
<div
key={index}
className="border-gray-700 pb-2 mb-2 last:border-none last:pb-0 last:mb-0"
>
<Text
variant="h3"
className={cn(
"text-2xl md:text-3xl font-semibold mb-1 text-gray-200"
)}
>
{terms.title}
</Text>
<p className="text-base md:text-lg text-gray-400 leading-7 md:leading-8 text-justify">
{terms.description}
</p>

return (
<Container className="mx-auto mt-24 md:mt-32 mb-1">
<div className="py-10 px-6 sm:px-12 md:px-20 lg:px-32 space-y-8 text-red-600 rounded-lg shadow-lg backdrop-blur-md">
<BackButton />
<Text variant="h1" className={cn("text-4xl md:text-5xl font-bold text-center")}>
Terms and Conditions
</Text>
<div className="space-y-6">
{legalInfo.Terms.map((terms, index) => (
<div
key={index}
className="border-gray-700 pb-2 mb-2 last:border-none last:pb-0 last:mb-0"
>
<Text
variant="h3"
className={cn("text-2xl md:text-3xl font-semibold mb-1 text-gray-200")}
>
{terms.title}
</Text>
<p className="text-base md:text-lg text-gray-400 leading-7 md:leading-8 text-justify">
{terms.description}
</p>
</div>
))}
</div>
</div>
))}
</div>
</div>
</Container>
);
</Container>
);
}
82 changes: 47 additions & 35 deletions src/app/auth/signin/signin-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,52 @@ import { useState, useEffect } from "react";
import { tailChase } from "ldrs";

export default function SignIn() {
const router = useRouter();
const { status } = useSession();
const searchParams = useSearchParams();
const [loading, setLoading] = useState(false);
const callbackUrl = searchParams.get("callbackUrl") || "/";

useEffect(() => {
if (typeof window !== "undefined") {
tailChase.register();
}
if (status === "unauthenticated") {
setLoading(true);
signIn("google").catch((error) => {
console.error("Sign in failed:", error);
setLoading(false);
});
} else if (status === "authenticated") {
router.push(callbackUrl);
}
}, [status, router, callbackUrl]);

return (
<div className="flex flex-col items-center justify-center min-h-screen py-2">
{loading ? (
<div className="flex flex-col items-center">
<l-tail-chase
size={"88"}
speed={"1.75"}
color={"#FF0000"}
></l-tail-chase>
const router = useRouter();
const { status } = useSession();
const searchParams = useSearchParams();
const [loading, setLoading] = useState(false);
const callbackUrl = searchParams.get("callbackUrl") || "/";

useEffect(() => {
if (typeof window !== "undefined") {
tailChase.register();
}
const userAgent = window.navigator.userAgent;
const url = window.location.href;

// Check for LinkedIn and Instagram app on iPhone/iPad and redirect
if (
userAgent.includes("Mobile") &&
(userAgent.includes("iPhone") || userAgent.includes("iPad")) &&
(userAgent.includes("LinkedInApp") || userAgent.includes("Instagram"))
) {
window.location.href = "x-safari-" + url;
return;
}

console.log("user-Agent " + userAgent);
console.log("url = " + url);

if (status === "unauthenticated") {
setLoading(true);
signIn("google").catch((error) => {
console.error("Sign in failed:", error);
setLoading(false);
});
} else if (status === "authenticated") {
router.push(callbackUrl);
}
}, [status, router, callbackUrl]);

return (
<div className="flex flex-col items-center justify-center min-h-screen py-2">
{loading ? (
<div className="flex flex-col items-center">
<l-tail-chase size={"88"} speed={"1.75"} color={"#FF0000"}></l-tail-chase>
</div>
) : (
<p>Redirecting...</p>
)}
</div>
) : (
<p>Redirecting...</p>
)}
</div>
);
);
}
Loading

0 comments on commit 10e1c80

Please sign in to comment.