From 40a163393a3551b049744d5a0153e00d2f56e710 Mon Sep 17 00:00:00 2001 From: Debatreya Date: Thu, 17 Apr 2025 01:57:05 +0530 Subject: [PATCH 1/5] feat(update/director): Update in Directors Message --- app/[locale]/director-message/page.tsx | 215 ++++++++++++++++++++++++- 1 file changed, 214 insertions(+), 1 deletion(-) diff --git a/app/[locale]/director-message/page.tsx b/app/[locale]/director-message/page.tsx index 725f8201..edfa2b49 100644 --- a/app/[locale]/director-message/page.tsx +++ b/app/[locale]/director-message/page.tsx @@ -1,7 +1,68 @@ +import Image from 'next/image'; +import { FaPhone } from 'react-icons/fa6'; +import { MdEmail } from 'react-icons/md'; + import Heading from '~/components/heading'; import { getTranslations } from '~/i18n/translations'; import { getS3Url } from '~/server/s3'; +// CONSTANTS FOR DIRECTOR MESSAGE PAGE +// DIRECTOR's CARDS +const directorCard = { + image: `${getS3Url()}/assets/director.jpeg`, + alt: "Director's Image", + title: 'Director', + name: 'Professor B.V. Ramana Reddy', + position: 'Director', + institute: 'National Institute of Technology, Kurukshetra', + contact: { + phone: ['01744-233201', '01744-233204', '01744-238083'], + fax: '01744-238494', + mobile: '+91 74978 22212', + email: 'director@nitkkr.ac.in', + }, +}; + +// DIRECTOR's OFFICE +const directorOfficeCards = [ + { + image: `${getS3Url()}/assets/office.jpeg`, + alt: "Director's Office Image 1", + name: 'Arun Goel', + position: 'Professor (Head of the Department)', + email: 'drarun_goel@yahoo.co.in', + phone: ['01744-233349', '01744-233300'], + }, + { + image: `${getS3Url()}/assets/office.jpeg`, + alt: "Director's Office Image 2", + name: 'Arun Goel', + position: 'Professor (Head of the Department)', + email: 'drarun_goel@yahoo.co.in', + phone: ['01744-233349', '01744-233300'], + }, + { + image: `${getS3Url()}/assets/office.jpeg`, + alt: "Director's Office Image 3", + name: 'Arun Goel', + position: 'Professor (Head of the Department)', + email: 'drarun_goel@yahoo.co.in', + phone: ['01744-233349', '01744-233300'], + }, + { + image: `${getS3Url()}/assets/office.jpeg`, + alt: "Director's Office Image 4", + name: 'Arun Goel', + position: 'Professor (Head of the Department)', + email: 'drarun_goel@yahoo.co.in', + phone: ['01744-233349', '01744-233300'], + }, +]; +const directorOffice = { + title: "Director's Office", + cards: directorOfficeCards, +}; + export default async function DirectorCorner({ params: { locale }, }: { @@ -10,6 +71,92 @@ export default async function DirectorCorner({ const text = (await getTranslations(locale)).DirectorMessage; return ( <> + {/* For DIRECTOR CARD */} +
+ + {/* DIRECTOR CARD */} +
+ +
+
+ {/* For DIRECTOR OFFICE CARDS */} +
+ +
+ {directorOffice.cards.map((card, index) => ( + + ))} +
+
+ {/* For DIRECTOR's MESSAGE */}
-
+

{text.message.slice(0, 7).map((message, index) => ( @@ -62,3 +209,69 @@ export default async function DirectorCorner({ ); } + +interface ContactDetail { + label: string; + icon?: React.ReactNode | string; +} + +interface CardProps { + imageAlt: string; + imageSrc: string; + name: string; + designation: string; + isDepartmentHead?: boolean; + departmentHeadText?: string; + contactDetails: ContactDetail[]; +} + +const Card: React.FC = ({ + imageAlt, + imageSrc, + name, + designation, + isDepartmentHead = false, + departmentHeadText = '', + contactDetails, +}) => { + return ( +

+
+
+ {imageAlt} +
+
+

{name}

+

+ {designation} + {isDepartmentHead && ` (${departmentHeadText})`} +

+
+
    + {contactDetails.map((detail, index) => ( +
  • + + {detail.icon} + + :{detail.label} +
  • + ))} +
+
+
+
+
+ ); +}; From 9b489c926f49a477dd584b3a98863b5cd8889c25 Mon Sep 17 00:00:00 2001 From: Debatreya Date: Thu, 24 Apr 2025 14:23:32 +0530 Subject: [PATCH 2/5] fix(overlap): Directors image overlap --- app/[locale]/director-message/page.tsx | 11 +++++------ package-lock.json | 15 +++++++++++++++ package.json | 1 + 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/app/[locale]/director-message/page.tsx b/app/[locale]/director-message/page.tsx index edfa2b49..0e695eae 100644 --- a/app/[locale]/director-message/page.tsx +++ b/app/[locale]/director-message/page.tsx @@ -132,7 +132,7 @@ export default async function DirectorCorner({ heading="h3" glyphDirection="rtl" /> -
+
{directorOffice.cards.map((card, index) => ( = ({ contactDetails, }) => { return ( -
+
{imageAlt}= 14" } }, + "node_modules/yarn": { + "version": "1.22.22", + "resolved": "https://registry.npmjs.org/yarn/-/yarn-1.22.22.tgz", + "integrity": "sha512-prL3kGtyG7o9Z9Sv8IPfBNrWTDmXB4Qbes8A9rEzt6wkJV8mUvoirjU0Mp3GGAU06Y0XQyA3/2/RQFVuK7MTfg==", + "hasInstallScript": true, + "license": "BSD-2-Clause", + "bin": { + "yarn": "bin/yarn.js", + "yarnpkg": "bin/yarn.js" + }, + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/package.json b/package.json index 56d7eaa1..eafaf30d 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "tailwind-merge": "^2.2.1", "typesense": "^1.8.2", "usehooks-ts": "^3.0.1", + "yarn": "^1.22.22", "zod": "^3.23.8" }, "devDependencies": { From 45eb414846360750997f020aead4cfd866aaaf4b Mon Sep 17 00:00:00 2001 From: Debatreya Date: Wed, 28 May 2025 23:16:14 +0530 Subject: [PATCH 3/5] feat(director): Updated backgroung img --- app/[locale]/director-message/page.tsx | 242 +++++++++++++------------ 1 file changed, 124 insertions(+), 118 deletions(-) diff --git a/app/[locale]/director-message/page.tsx b/app/[locale]/director-message/page.tsx index 0e695eae..ad16fd76 100644 --- a/app/[locale]/director-message/page.tsx +++ b/app/[locale]/director-message/page.tsx @@ -72,140 +72,145 @@ export default async function DirectorCorner({ return ( <> {/* For DIRECTOR CARD */} -
- - {/* DIRECTOR CARD */} -
- + -
-
- {/* For DIRECTOR OFFICE CARDS */} -
- -
- {directorOffice.cards.map((card, index) => ( + {/* DIRECTOR CARD */} +
- ))} -
-
- {/* For DIRECTOR's MESSAGE */} -
+
+
+ {/* For DIRECTOR OFFICE CARDS */} +
- -
-

- {text.message.slice(0, 7).map((message, index) => ( - - {message} - - ))} -

-
-
-

- {text.message.slice(7, 9).map((message, index) => ( - - {message} - - ))} -

-
-
-

- {text.message.slice(9, 11).map((message, index) => ( - - {message} - +

+ +
+ {directorOffice.cards.map((card, index) => ( + ))} -

-
-
-

- {text.message[11]} -

-
-
-

- {text.message[12]} -

-
-
+ + + + {/* For DIRECTOR's MESSAGE */} +
+
+ +
+

+ {text.message.slice(0, 7).map((message, index) => ( + + {message} + + ))} +

+
+
+

+ {text.message.slice(7, 9).map((message, index) => ( + + {message} + + ))} +

+
+
+

+ {text.message.slice(9, 11).map((message, index) => ( + + {message} + + ))} +

+
+
+

+ {text.message[11]} +

+
+
+

+ {text.message[12]} +

+
+
+
); } @@ -240,10 +245,11 @@ const Card: React.FC = ({
{imageAlt} Date: Thu, 29 May 2025 00:21:16 +0530 Subject: [PATCH 4/5] fix(package): Removed yarn 'npm uninstall yarn' --- package-lock.json | 15 --------------- package.json | 1 - 2 files changed, 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index ad4fdc08..193c7795 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,7 +41,6 @@ "tailwind-merge": "^2.2.1", "typesense": "^1.8.2", "usehooks-ts": "^3.0.1", - "yarn": "^1.22.22", "zod": "^3.23.8" }, "devDependencies": { @@ -9531,20 +9530,6 @@ "node": ">= 14" } }, - "node_modules/yarn": { - "version": "1.22.22", - "resolved": "https://registry.npmjs.org/yarn/-/yarn-1.22.22.tgz", - "integrity": "sha512-prL3kGtyG7o9Z9Sv8IPfBNrWTDmXB4Qbes8A9rEzt6wkJV8mUvoirjU0Mp3GGAU06Y0XQyA3/2/RQFVuK7MTfg==", - "hasInstallScript": true, - "license": "BSD-2-Clause", - "bin": { - "yarn": "bin/yarn.js", - "yarnpkg": "bin/yarn.js" - }, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/package.json b/package.json index eafaf30d..56d7eaa1 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,6 @@ "tailwind-merge": "^2.2.1", "typesense": "^1.8.2", "usehooks-ts": "^3.0.1", - "yarn": "^1.22.22", "zod": "^3.23.8" }, "devDependencies": { From 13dc168c6a7cc9558e0929b2a95563284fb7dc06 Mon Sep 17 00:00:00 2001 From: Debatreya Date: Sat, 31 May 2025 02:11:50 +0530 Subject: [PATCH 5/5] feat(director): Tried to resolve the requested reviews --- app/[locale]/director-message/page.tsx | 116 +++++++++---------------- 1 file changed, 41 insertions(+), 75 deletions(-) diff --git a/app/[locale]/director-message/page.tsx b/app/[locale]/director-message/page.tsx index ad16fd76..054c15b3 100644 --- a/app/[locale]/director-message/page.tsx +++ b/app/[locale]/director-message/page.tsx @@ -1,13 +1,9 @@ import Image from 'next/image'; -import { FaPhone } from 'react-icons/fa6'; -import { MdEmail } from 'react-icons/md'; import Heading from '~/components/heading'; import { getTranslations } from '~/i18n/translations'; import { getS3Url } from '~/server/s3'; -// CONSTANTS FOR DIRECTOR MESSAGE PAGE -// DIRECTOR's CARDS const directorCard = { image: `${getS3Url()}/assets/director.jpeg`, alt: "Director's Image", @@ -23,7 +19,7 @@ const directorCard = { }, }; -// DIRECTOR's OFFICE +// Placeholder data for office cards. Replace with real data as needed. const directorOfficeCards = [ { image: `${getS3Url()}/assets/office.jpeg`, @@ -75,7 +71,7 @@ export default async function DirectorCorner({
@@ -84,7 +80,6 @@ export default async function DirectorCorner({ heading="h2" glyphDirection="dual" /> - {/* DIRECTOR CARD */}
@@ -144,9 +131,7 @@ export default async function DirectorCorner({ designation={card.position} contactDetails={[ { - label: Array.isArray(card.phone) - ? card.phone.join(' ') - : card.phone, + label: card.phone.join(' '), icon: 'Phone No.', }, { @@ -173,41 +158,24 @@ export default async function DirectorCorner({ glyphDirection="dual" />
-

- {text.message.slice(0, 7).map((message, index) => ( - - {message} +

+ {(text.message as unknown as string[]).map((message, index) => ( + = 9 && index <= 10 + ? 'mb-3 block' + : 'mb-5 block' + } + > + {message.toString()} ))} -

-
-
-

- {text.message.slice(7, 9).map((message, index) => ( - - {message} - - ))} -

-
-
-

- {text.message.slice(9, 11).map((message, index) => ( - - {message} - - ))} -

-
-
-

- {text.message[11]} -

-
-
-

- {text.message[12]} -

+
@@ -215,22 +183,7 @@ export default async function DirectorCorner({ ); } -interface ContactDetail { - label: string; - icon?: React.ReactNode | string; -} - -interface CardProps { - imageAlt: string; - imageSrc: string; - name: string; - designation: string; - isDepartmentHead?: boolean; - departmentHeadText?: string; - contactDetails: ContactDetail[]; -} - -const Card: React.FC = ({ +const Card = ({ imageAlt, imageSrc, name, @@ -238,6 +191,14 @@ const Card: React.FC = ({ isDepartmentHead = false, departmentHeadText = '', contactDetails, +}: { + imageAlt: string; + imageSrc: string; + name: string; + designation: string; + isDepartmentHead?: boolean; + departmentHeadText?: string; + contactDetails: { label: string; icon?: React.ReactNode | string }[]; }) => { return (
@@ -250,15 +211,20 @@ const Card: React.FC = ({ ? 'size-32 md:size-40 lg:size-44 xl:size-48 2xl:size-52' : 'size-32 lg:size-36 xl:size-40 2xl:size-44' }`} - height={0} src={imageSrc} - width={0} + width={160} + height={160} + // You can adjust width/height as needed for your design />

{name}

{designation} {isDepartmentHead && ` (${departmentHeadText})`}