Skip to content

Commit ffd9fbb

Browse files
committed
Merge branch 'prod2' of https://github.com/SuperSecureHuman/anokha-2024 into prod2
2 parents 34a10c7 + a1baeef commit ffd9fbb

File tree

9 files changed

+91
-32
lines changed

9 files changed

+91
-32
lines changed

next.config.js

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,37 @@ module.exports = withBundleAnalyzer({
2626
},
2727

2828
images: {
29-
domains: [
30-
"anokha.amrita.edu",
31-
"i.imgur.com",
32-
"imgur.com",
33-
"gravatar.com",
34-
"wwd.com",
35-
],
3629
remotePatterns: [
3730
{
3831
protocol: "https",
3932
hostname: "**gravatar.com",
4033
port: "",
4134
pathname: "/avatar/**",
4235
},
36+
{
37+
protocol: "https",
38+
hostname: "anokha.amrita.edu",
39+
port: "",
40+
pathname: "/**",
41+
},
42+
{
43+
protocol: "https",
44+
hostname: "i.imgur.com",
45+
port: "",
46+
pathname: "/**",
47+
},
48+
{
49+
protocol: "https",
50+
hostname: "imgur.com",
51+
port: "",
52+
pathname: "/**",
53+
},
54+
{
55+
protocol: "https",
56+
hostname: "**wwd.com",
57+
port: "",
58+
pathname: "/**",
59+
}
4360
],
4461
},
4562
});

package-lock.json

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/components/EventHeader.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const navLinks = [
3737
},
3838
{
3939
title: "Contact Us",
40-
path: "/",
40+
path: "/#footer",
4141
},
4242
];
4343

@@ -155,7 +155,9 @@ const Navigationbar = () => {
155155
<Button
156156
className="relative border-[#1a4d76] border-0 inline-flex items-center w-[100px] md:w-[200px] justify-center px-2 md:px-2 md:py-2 md:text-lg font-bold text-white transition-all duration-100 bg-gray-900 font-pj rounded-xl focus:outline-none focus:ring-1 focus:ring-offset-2 focus:ring-gray-900 sm:before:content-['Login'] md:before:content-['Login_\/_Sign_Up'] hover:scale-[1.02] hover:border-[#1a4d76] hover:border-2"
157157
onClick={handleForgetPassword}
158-
></Button>
158+
>
159+
<p></p> {/* To fix: The prop `children` is marked as required in `MaterialTailwind.Button`, but its value is `undefined`.*/}
160+
</Button>
159161
</div>
160162
)}
161163
</div>

src/app/events/[eventId]/page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ const Event = () => {
566566
</h2>
567567
<br />
568568
<div className={showFullText ? "" : "line-clamp-[4]"} ref={Desc}>
569-
<Markdown className="prose dark:prose-invert">
569+
<Markdown className="prose dark:prose-invert text-white">
570570
{eventData.eventMarkdownDescription}
571571
</Markdown>
572572
</div>

src/app/events/components/EventCard.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,8 @@ export default function EventCard({
111111
src={imgSrc}
112112
width={400}
113113
height={400}
114-
objectFit="contain"
115114
alt="https://i.imgur.com/iQy8GLM.jpg"
116-
className=" rounded-2xl h-full transition duration-300 hover:filter hover:brightness-0 hover:grayscale-100 hover:opacity-0"
115+
className=" rounded-2xl h-full object-fit transition duration-300 hover:filter hover:brightness-0 hover:grayscale-100 hover:opacity-0"
117116
/>
118117
{secureLocalStorage.getItem("isLoggedIn") && isRegistered == "1" ? (
119118
<div class="absolute top-2 left-2 p-1 text-xs text-green-800 font-semibold border border-white rounded-lg bg-green-100">

src/app/events/components/filterSelectButton.js renamed to src/app/events/components/filterSelectButton.jsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ export default function FilterSelectButton({
1111
options,
1212
sendSelectedOption,
1313
}) {
14-
const [currVal, setCurrVal] = useState(val());
15-
const [buttonClick, setButtonClick] = useState(0);
16-
function val() {
17-
if (typeof window === "undefined") return null;
14+
15+
const val = () => {
16+
if (typeof window === "undefined"){
17+
return null;
18+
}
1819
let value;
1920
if (type === "eventType") {
2021
value = sessionStorage.getItem("eventTypeList");
@@ -27,6 +28,14 @@ export default function FilterSelectButton({
2728
}
2829
return value ? JSON.parse(value)?.[0] : null;
2930
}
31+
32+
const [currVal, setCurrVal] = useState();
33+
const [buttonClick, setButtonClick] = useState(0);
34+
35+
useEffect(()=>{
36+
setCurrVal(val())
37+
},[])
38+
3039
useEffect(() => {
3140
if ((!currVal || currVal == null || currVal == "") && buttonClick == 0) {
3241
return;

src/app/events/page.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,19 @@ const Events = () => {
5151

5252
/* Randomize array in-place using Durstenfeld shuffle algorithm: Complexity 0(n)*/
5353
const shuffleArray = (array) => {
54+
// Find the index of the object where eventName matches "Lumiere" (case-insensitive).
55+
const lumiereIndex = array.findIndex((item) => item["eventName"].toLowerCase() === "lumiere");
56+
// If "Lumiere" is found, swap it with the first element.
57+
if (lumiereIndex !== -1) {
58+
[array[0], array[lumiereIndex]] = [array[lumiereIndex], array[0]];
59+
}
60+
// Shuffle the rest of the array starting from the second element.
5461
const l = array.length;
55-
for (let i = l - 1; i >= 0; i--) {
56-
const j = Math.floor(Math.random() * (i + 1)) % l;
62+
for (let i = l - 1; i >= 1; i--) { // Start at 1 to leave array[0] unchanged
63+
const j = Math.floor(Math.random() * (i - 1)) + 1;
5764
[array[i], array[j]] = [array[j], array[i]];
5865
}
66+
return array;
5967
}
6068

6169
useEffect(() => {
@@ -90,7 +98,7 @@ const Events = () => {
9098
}
9199
})
92100
.then((data) => {
93-
console.log("Recived Data:", data);
101+
// console.log("Recived Data:", data);
94102
shuffleArray(data.EVENTS)
95103
setEventsData(data.EVENTS);
96104
setFilteredData(data.EVENTS);
@@ -202,8 +210,8 @@ const Events = () => {
202210

203211
// This empty bracket here is important
204212

205-
console.log("Events Data:", eventsData);
206-
console.log("Filter Data:", filteredData);
213+
// console.log("Events Data:", eventsData);
214+
// console.log("Filter Data:", filteredData);
207215

208216
const [webGLColors, setWebGLColors] = useState({
209217
color1: [43 / 255, 30 / 255, 56 / 255],

src/app/lumiere/page.js

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ import {
1313
} from "../_util/constants";
1414
import secureLocalStorage from "react-secure-storage";
1515
import ToastAlert from "../_util/ToastAlerts";
16+
import { ConfirmDialog } from "primereact/confirmdialog";
17+
import { confirmDialog } from "primereact/confirmdialog";
1618

17-
const Lumere = () => {
19+
const Lumiere = () => {
1820
const [webGLColors, setWebGLColors] = useState({
1921
color1: [43 / 255, 30 / 255, 56 / 255],
2022
color2: [11 / 255, 38 / 255],
@@ -154,6 +156,27 @@ const Lumere = () => {
154156
});
155157
}, []);
156158

159+
160+
const accept = async () => {
161+
await getPayUForm();
162+
};
163+
164+
const reject = () => {
165+
// do nothing
166+
};
167+
168+
const confirmProceed = () => {
169+
confirmDialog({
170+
message: `Are you ready to make the payment? (You'll be redirected to the payment gateway to complete the registration.)`,
171+
header: "Confirmation",
172+
icon: "pi pi-exclamation-triangle",
173+
defaultFocus: "accept",
174+
style: { width: "35rem", margin: "5px" },
175+
accept,
176+
reject,
177+
});
178+
};
179+
157180
const handleRegister = async (e) => {
158181
e.preventDefault();
159182
if (
@@ -164,9 +187,7 @@ const Lumere = () => {
164187
window.location.href = "/login";
165188
return;
166189
}
167-
confirm(
168-
"Are you ready to make the payment? (You'll be redirected to the payment gateway to complete the registration.)"
169-
) && (await getPayUForm());
190+
confirmProceed();
170191
};
171192

172193
return (
@@ -259,7 +280,7 @@ const Lumere = () => {
259280
"Registrations Closed"
260281
)}
261282
</button>
262-
283+
<ConfirmDialog />
263284
<div className=" inset-0 flex justify-center items-center">
264285
<div
265286
onClick={handleScrollMore}
@@ -343,4 +364,4 @@ const Lumere = () => {
343364
);
344365
};
345366

346-
export default Lumere;
367+
export default Lumiere;

src/app/page.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ export default function Home() {
7272

7373
<AnokhaMarquee />
7474

75-
<Footer current_page="home" />
75+
<section id ="footer">
76+
<Footer current_page="home" />
77+
</section>
7678
</main>
7779
);
7880
}

0 commit comments

Comments
 (0)