Skip to content

Commit

Permalink
Merge branch 'main' into feature
Browse files Browse the repository at this point in the history
  • Loading branch information
rabilrbl authored Apr 24, 2024
2 parents d156846 + e64fd68 commit 3daea0b
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 22 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,3 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
secret-envs: |
AUTH_SECRET: "test_auth"
AUTH_GOOGLE_ID: "test_gid"
AUTH_GOOGLE_SECRET: "test_gsecret"
DATABASE_URL: "test_db_url"
RAZORPAY_KEY: "test_key"
RAZORPAY_SECRET: "test_secret"
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@ RUN npm ci
# Copy the rest of the app's source code to the working directory
COPY . .

ARG AUTH_SECRET
# Dummy values are set to prevent build errors
ARG AUTH_SECRET="dummy_secret"
ENV AUTH_SECRET=$AUTH_SECRET
ARG AUTH_GOOGLE_ID
ENV AUTH_GOOGLE_ID=$AUTH_GOOGLE_ID
ARG AUTH_GOOGLE_SECRET
ENV AUTH_GOOGLE_SECRET=$AUTH_GOOGLE_SECRET
ARG DATABASE_URL
ENV DATABASE_URL=$DATABASE_URL
ARG RAZORPAY_KEY
ARG RAZORPAY_KEY="dummy_key"
ENV RAZORPAY_KEY=$RAZORPAY_KEY
ARG RAZORPAY_SECRET
ARG RAZORPAY_SECRET="dummy_secret"
ENV RAZORPAY_SECRET=$RAZORPAY_SECRET
ENV AUTH_TRUST_HOST="true"
ARG AUTH_URL
Expand Down
55 changes: 53 additions & 2 deletions src/app/(content)/team/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const coreTeam = [
`${tiaraAssetsPrefix}/coreteam/convener_1.avif`,
`${tiaraAssetsPrefix}/coreteam/convener_2.avif`,
`${tiaraAssetsPrefix}/coreteam/cultural.avif`,
`${tiaraAssetsPrefix}/coreteam/design.avif`,
`${tiaraAssetsPrefix}/coreteam/discipline.avif`,
`${tiaraAssetsPrefix}/coreteam/logistics.avif`,
`${tiaraAssetsPrefix}/coreteam/media.avif`,
Expand All @@ -20,9 +19,23 @@ const coreTeam = [
`${tiaraAssetsPrefix}/coreteam/prizes_awards.avif`,
`${tiaraAssetsPrefix}/coreteam/social_media.avif`,
`${tiaraAssetsPrefix}/coreteam/sponsership.avif`,
`${tiaraAssetsPrefix}/coreteam/stage_decoration.avif`,
`${tiaraAssetsPrefix}/coreteam/technical.avif`,
`${tiaraAssetsPrefix}/coreteam/website.avif`,
`${tiaraAssetsPrefix}/coreteam/stage_decoration.avif`,
`${tiaraAssetsPrefix}/coreteam/design.avif`,
];

const webTeam = [
`${tiaraAssetsPrefix}/webteam/anish.avif`,
`${tiaraAssetsPrefix}/webteam/rabil.avif`,
`${tiaraAssetsPrefix}/webteam/jenison.avif`,
`${tiaraAssetsPrefix}/webteam/joywin.avif`,
`${tiaraAssetsPrefix}/webteam/vyshnav.avif`,
`${tiaraAssetsPrefix}/webteam/vineeth_.avif`,
`${tiaraAssetsPrefix}/webteam/melroy.avif`,
`${tiaraAssetsPrefix}/webteam/nithin.avif`,
`${tiaraAssetsPrefix}/webteam/uthpal.avif`,
`${tiaraAssetsPrefix}/webteam/vaibhav.avif`,
];

export default function CoreTeamPage() {
Expand Down Expand Up @@ -66,6 +79,44 @@ export default function CoreTeamPage() {
})}
</div>
</div>
<div className="-ml-5 flex justify-center items-center -mt-16 z-50">
<div
className={cn(
"text-4xl xs:text-5xl sm:text-6xl md:text-7xl lg:text-8xl w-fit text-center duration-500",
tiaraFont.className
)}
>
<h1 className="text-4xl xs:text-5xl sm:text-6xl md:text-7xl lg:text-8xl">
Website Team
</h1>
</div>
</div>
<div className="w-full flex justify-center ">
<div className="p-14 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-16">
{webTeam.map((card, index) => {
return (
<CardContainer
key={index}
containerClassName="relative flex items-center justify-center transition-all duration-200 ease-linear"
>
<CardBody className="relative">
<CardItem translateZ="100" className="w-full mt-4">
<Image
src={card}
className="rounded-xl "
alt="thumbnail"
width={1200}
height={800}
priority
sizes="(max-width: 640px) 100vw, (max-width: 1023px) 50vw, 33vw"
/>
</CardItem>
</CardBody>
</CardContainer>
);
})}
</div>
</div>
</div>
);
}
2 changes: 1 addition & 1 deletion src/data/categoryList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ const categoriesList = {
// description: "",
// rules: ["RR"],
// prerequisites: ["PP"],
// costs: 250,
// costs: 1,
// thumbnail: "",
// startTime: "2024-05-12 10:00",
// endTime: "2024-05-12 18:00",
Expand Down
2 changes: 0 additions & 2 deletions src/helper/zodSchema.ts

This file was deleted.

86 changes: 79 additions & 7 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,71 @@ export interface makePaymentProps {
};
}

interface RazorpaySuccesshandlerArgs {
razorpay_signature: string;
razorpay_order_id: string;
razorpay_payment_id: string;
}

export interface RazorpayOptions {
key: string;
amount: number;
currency: string;
name: string;
description?: string;
image?: string;
order_id: string;
handler?: (args: RazorpaySuccesshandlerArgs) => void;
prefill?: {
name?: string;
email?: string;
contact?: string;
method?: "card" | "netbanking" | "wallet" | "emi" | "upi";
};
notes?: {};
theme?: {
hide_topbar?: boolean;
color?: string;
backdrop_color?: string;
};
modal?: {
backdropclose?: boolean;
escape?: boolean;
handleback?: boolean;
confirm_close?: boolean;
ondismiss?: () => void;
animation?: boolean;
};
subscription_id?: string;
subscription_card_change?: boolean;
recurring?: boolean;
callback_url?: string;
redirect?: boolean;
customer_id?: string;
timeout?: number;
remember_customer?: boolean;
readonly?: {
contact?: boolean;
email?: boolean;
name?: boolean;
};
hidden?: {
contact?: boolean;
email?: boolean;
};
send_sms_hash?: boolean;
allow_rotation?: boolean;
retry?: {
enabled?: boolean;
max_count?: boolean;
};
config?: {
display: {
language: "en" | "ben" | "hi" | "mar" | "guj" | "tam" | "tel";
};
};
}

export const makePayment = async ({
productId = null,
productName,
Expand All @@ -49,11 +114,11 @@ export const makePayment = async ({
headers: {
"Content-Type": "application/json", // Assuming the API expects JSON
},
body: JSON.stringify({ amount, prefillData }),
body: JSON.stringify({ amount, prefillData }),
});
const { orderId } = await response.json();
const options = {
key: key,
const options: RazorpayOptions = {
key: key!,
name: productName,
image: `${tiaraAssetsPrefix}/t24.png`,
currency: "INR",
Expand All @@ -65,7 +130,14 @@ export const makePayment = async ({
email: prefillData.email,
contact: prefillData.contact,
},
handler: async function (response: any) {
notes: {
customerName: prefillData.name,
customerEmail: prefillData.email,
customerContact: prefillData.contact,
college: prefillData.college,
events: prefillData.events.join(", "),
},
handler: async function (response) {
const data = {
orderCreationId: orderId,
razorpayPaymentId: response.razorpay_payment_id,
Expand All @@ -74,7 +146,7 @@ export const makePayment = async ({
college: prefillData.college,
events: prefillData.events,
teams: prefillData.teams,
phone:prefillData.contact,
phone: prefillData.contact,
};

const result = await fetch("/api/razorpay/verify", {
Expand All @@ -85,13 +157,13 @@ export const makePayment = async ({
const res = await result.json();
if (res.isOk) {
toast({
title: "Payment successful",
title: "Payment successful",
description: "Your payment was successful",
});
window.location.href = "/";
} else {
toast({
title: "Payment failed",
title: "Payment failed",
description:
"Please try again. Contact support for help. " + res.error,
variant: "destructive",
Expand Down

0 comments on commit 3daea0b

Please sign in to comment.