diff --git a/public/auth-callback.html b/public/auth-callback.html index a0db2e4..8ecf5b8 100644 --- a/public/auth-callback.html +++ b/public/auth-callback.html @@ -1,131 +1,130 @@ - + - - - - - Delta Inductions | LOGIN REDIRECT - - - - - - - -
-
- - - -

Redirecting back to the main site...

-
-
- - - - \ No newline at end of file + + + + + Pragyan '24 | Login Redirect + + + + + + + +
+
+ + + +

Redirecting back to the main site...

+
+
+ + + + diff --git a/src/app/about/page.tsx b/src/app/about/page.tsx index 8c6aa3f..e0d1175 100644 --- a/src/app/about/page.tsx +++ b/src/app/about/page.tsx @@ -11,9 +11,10 @@ const About = () => { const [isScrolled, setIsScrolled] = useState(false); const [scrollAllowed, setScrollAllowed] = useState(true); const contentCard = useRef(null); + const contentCardDesktop = useRef(null); const router = useRouter(); const simulateScroll = (event: WheelEvent) => { - if (!isScrolled && !contentCard.current?.contains(event.target as Node)) { + if (!isScrolled && !contentCardDesktop.current?.contains(event.target as Node)) { event.stopPropagation(); if (event.deltaY > 0) { setTimeout(() => { @@ -96,7 +97,7 @@ const About = () => {
ABOUT US
- + diff --git a/src/assets/images/LoginButton.png b/src/assets/images/LoginButton.png deleted file mode 100644 index 0414366..0000000 Binary files a/src/assets/images/LoginButton.png and /dev/null differ diff --git a/src/components/AboutCard/AboutCard.tsx b/src/components/AboutCard/AboutCard.tsx index ddc3f23..f87ff01 100644 --- a/src/components/AboutCard/AboutCard.tsx +++ b/src/components/AboutCard/AboutCard.tsx @@ -1,14 +1,16 @@ import React from 'react'; import AboutContent from './AboutContent.json'; -const AboutCard = () => { - const content = AboutContent.content + AboutContent.content2; +const AboutCard: React.FC = ({ cardRef }) => { + const content = AboutContent.content; return ( -
-

{content}

+
+

+ {content} +

); }; diff --git a/src/components/AboutCard/AboutCardMob.tsx b/src/components/AboutCard/AboutCardMob.tsx index 1e1e11c..09c85bd 100644 --- a/src/components/AboutCard/AboutCardMob.tsx +++ b/src/components/AboutCard/AboutCardMob.tsx @@ -4,7 +4,6 @@ import AboutContent from './AboutContent.json'; const AboutCardMob: React.FC = ({ cardRef }) => { const content: string = AboutContent.content; - const content2: string = AboutContent.content2; return (
= ({ cardRef }) => {
- {content} + {content2} + {content}
); diff --git a/src/components/AboutCard/AboutContent.json b/src/components/AboutCard/AboutContent.json index 0a37953..e0f51dd 100644 --- a/src/components/AboutCard/AboutContent.json +++ b/src/components/AboutCard/AboutContent.json @@ -1,4 +1,3 @@ { - "content": "Pragyan, the international techno-managerial organisation of NIT Trichy , which came into being in 2005, achieves just that by providing aplatform for a multitude of students to showcase their technicalingenuity and prowess. Pragyan has come a long way since its inception,propelling the fields of science and technology toward greater heights.", - "content2": " It basks in the limelight with the London Olympics and Manchester United as one of the three organisations to have ever achieved the ISO 20121:2012 Certification for Sustainable Event Management. Pragyan also holds the coveted honour of being the only student-run organisation amongst the three. In addition, Pragyan has the ISO 9001:2015 Certification for Quality Management Systems. Moreover, it has been registered as a case study in The Case Centre, London" + "content": "In the previous year, Pragyan grew from the hybrid fest of 2022 to a completely offline fest. The theme of Pragyan '23 was Cyberscape and was a surreal experience at that. The edition had many sessions with renowned speakers, scholars, and eminent personalities on our Pragyan Guest Lectures and Q&A sessions. With events, podcasts, and articles spreading awareness and information, Pragyan is sustaining its zeal. With \"Chronocle\" as its theme, the twentieth edition of Pragyan will be conducted on the NITT campus in all its grandeur. With this edition, we aim to introspect time - what has been, what is, and what will be. The past, the present, and the future is carried by each of us. Pragyan '24 will bring these three together, so that to make the best of all the parallels and celebrate technology." } diff --git a/src/components/AuthLayout/AuthLayout.tsx b/src/components/AuthLayout/AuthLayout.tsx index 71b7f2b..c43a57d 100644 --- a/src/components/AuthLayout/AuthLayout.tsx +++ b/src/components/AuthLayout/AuthLayout.tsx @@ -6,7 +6,7 @@ import Link from 'next/link'; import { Login } from './login'; import { SignUp } from './signup'; import Arrow from '../../assets/images/arrow_back_auth.svg'; -import PragyanLogo from '../../assets/images/main-logo-22-white.svg'; +import PragyanLogo from '../../assets/images/main-logo.png'; import styles from './AuthLayout.module.css'; // import { userContext } from "../../contexts/UserContext"; @@ -16,7 +16,7 @@ const AuthLayout: React.FC = ({ formType }) => {
- + Arrow Left Home diff --git a/src/components/AuthLayout/login.tsx b/src/components/AuthLayout/login.tsx index 629cb59..f0ed358 100644 --- a/src/components/AuthLayout/login.tsx +++ b/src/components/AuthLayout/login.tsx @@ -82,12 +82,10 @@ export const Login: React.FC = ({ setForm }) => { const handleLogin = useCallback(() => { try { setAuthStatus(AuthStatusEnum.WAITING); - //backend url - console.log(loginForm); - const authApi = new UserApi(authConfig); authApi .authUserLogin({ + // @ts-ignore-next-line user_email: loginForm.userEmail, user_password: loginForm.userPassword, }) diff --git a/src/components/AuthLayout/signup.tsx b/src/components/AuthLayout/signup.tsx index 782f748..572d8e3 100644 --- a/src/components/AuthLayout/signup.tsx +++ b/src/components/AuthLayout/signup.tsx @@ -74,6 +74,7 @@ export const SignUp: React.FC = ({ setForm }) => { console.log('submitting'); userApi .authUserRegister({ + // @ts-ignore-next-line user_name: registerForm.userName, user_othercollege: registerForm.userCollege, user_referral_code: registerForm.userReferralCode, diff --git a/src/components/BackButton/back.tsx b/src/components/BackButton/back.tsx index fd8c714..bd3c9e9 100644 --- a/src/components/BackButton/back.tsx +++ b/src/components/BackButton/back.tsx @@ -20,7 +20,7 @@ const ImageChanger = (props: ImageChangerProps) => { alt="Back to cluster" className={`${styles.Back} xl:w-52 lg:w-44 md:w-32 sm:w-24 w-16 absolute left-28 top-32 max-md:hidden`} onClick={() => { - router.back(); + router.push('/clusters'); }} onMouseEnter={() => setIsHovered(true)} onMouseLeave={() => setIsHovered(false)} diff --git a/src/components/Carousel/slideData.tsx b/src/components/Carousel/slideData.tsx index 747f2af..71206cd 100644 --- a/src/components/Carousel/slideData.tsx +++ b/src/components/Carousel/slideData.tsx @@ -1,5 +1,5 @@ -/* eslint-disable */ - +/* eslint-disable camelcase */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ 'use client'; import Image from 'next/image'; import React, { useEffect, useState } from 'react'; @@ -12,17 +12,17 @@ import { EventApi } from '../../../fest-web-client/client/src'; import { apiConfig } from '@/utils/ApiConfig'; //@ts-ignore -const SlideData = ({ details }: { details: any }) => { +const SlideData: React.FC = ({ details }) => { const [index, setIndex] = useState(1); const [isActive, setIsActive] = useState(1); const [data, setData] = useState(details.content[0]); - console.log(details); const handleRegister = () => { try { //backend url const authApi = new EventApi(apiConfig); authApi .eventRegister({ + // @ts-ignore-next-line event_id: details.id, team_members: ['TODO'], tema_name: 'todo', @@ -55,7 +55,7 @@ const SlideData = ({ details }: { details: any }) => { setIsActive(4); break; } - }, [index]); + }, [index, details.content]); return (
diff --git a/src/components/Carousel/types.d.ts b/src/components/Carousel/types.d.ts new file mode 100644 index 0000000..1604a3a --- /dev/null +++ b/src/components/Carousel/types.d.ts @@ -0,0 +1,19 @@ +type SlideImage = { + height: number; + width: number; + url: string; +}; + +interface SlidePropDetails { + id: number; + content: string[]; + name: string; + image: SlideImage; + date: string; + location: string; + price: string; +} + +interface SlideDataProps { + details: SlidePropDetails; +} diff --git a/src/components/Footer/Footer.tsx b/src/components/Footer/Footer.tsx index eb102ad..9625c92 100644 --- a/src/components/Footer/Footer.tsx +++ b/src/components/Footer/Footer.tsx @@ -8,7 +8,7 @@ const Footer = () => { if (pathname === '/') { return null; } - const footerText = `Made with <3 by Delta and Graphique`; + const footerText = `Made with <3 by DELTA FORCE and Graphique`; return (
diff --git a/src/components/LoginButton/LoginButton.tsx b/src/components/LoginButton/LoginButton.tsx deleted file mode 100644 index 2f13992..0000000 --- a/src/components/LoginButton/LoginButton.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import Image from 'next/image'; - -import loginbtn from '../../assets/images/LoginButton.png'; - -const LoginButton = () => { - return ( - Login - ); -}; - -export default LoginButton; diff --git a/src/components/MobileAuthButton/AuthButton.module.css b/src/components/MobileAuthButton/AuthButton.module.css new file mode 100644 index 0000000..ce09135 --- /dev/null +++ b/src/components/MobileAuthButton/AuthButton.module.css @@ -0,0 +1,19 @@ +.button { + background: url('../../assets/images/button-bg.svg'); + background-size: 100% 100%; + padding: 2rem; +} + +@media screen and (max-width: 500px) { + .button { + padding: 1rem; + font-size: 0.8rem; + } +} + +@media screen and (max-width: 400px) { + .button { + padding: 0.7rem; + font-size: 0.7rem; + } +} diff --git a/src/components/MobileAuthButton/LoginButton.tsx b/src/components/MobileAuthButton/LoginButton.tsx new file mode 100644 index 0000000..c390086 --- /dev/null +++ b/src/components/MobileAuthButton/LoginButton.tsx @@ -0,0 +1,11 @@ +import styles from './AuthButton.module.css'; + +const LoginButton: React.FC = ({ onClick, text }) => { + return ( +
+ {text} +
+ ); +}; + +export default LoginButton; diff --git a/src/components/MobileAuthButton/types.d.ts b/src/components/MobileAuthButton/types.d.ts new file mode 100644 index 0000000..c84ee1c --- /dev/null +++ b/src/components/MobileAuthButton/types.d.ts @@ -0,0 +1,4 @@ +interface MobileAuthButtonProps { + onClick?: () => void; + text: string; +} diff --git a/src/components/NavBar/NavBar.tsx b/src/components/NavBar/NavBar.tsx index e8918db..40ce3bf 100644 --- a/src/components/NavBar/NavBar.tsx +++ b/src/components/NavBar/NavBar.tsx @@ -1,15 +1,64 @@ 'use client'; -import { useState } from 'react'; +import { useEffect, useState } from 'react'; import Image from 'next/image'; import pragyanlogo from '../../assets/images/main-logo.png'; import pragyanlogomobile from '../../assets/images/main-logo-mobile.png'; import hamburgerIcon from '../../assets/images/hamburgerMenu.svg'; -import LoginButton from '../LoginButton/LoginButton'; +import LoginButtonMobile from '../MobileAuthButton/LoginButton'; import Link from 'next/link'; import Menu from '@/components/Menu/Menu'; +import styles from './navbar.module.css'; const NavBar = () => { + const LoginButton = () => { + return ( + + LOGIN + + ); + }; + + const LogoutButton = () => { + return ( +
{ + localStorage.removeItem('token'); + window.location.reload(); + }} + > + LOGOUT +
+ ); + }; + const [isOpened, setIsOpened] = useState(false); + const [authButton, setAuthButton] = useState(); + const [mobileAuthButton, setMobileAuthButton] = useState( + , + ); + + useEffect(() => { + if (typeof window !== 'undefined') { + const token = localStorage.getItem('token'); + if (token) { + setAuthButton(); + setMobileAuthButton( + { + localStorage.removeItem('token'); + window.location.reload(); + }} + />, + ); + } else { + setAuthButton(); + setMobileAuthButton(); + } + } + }, []); + return (
@@ -30,19 +79,18 @@ const NavBar = () => {
- - HOME + + EVENTS - - CONTACT US + + ABOUT - + {/* FAQs - - - LOGIN - - + */} + + {authButton} + {mobileAuthButton} Hamburger Icon { @@ -29,7 +29,6 @@ export const apiConfig = new Configuration({ if (statusCode === 401 || statusCode === 403) { localStorage.removeItem('token'); window.location.href = `${HOME_URL}/login`; - window.history.forward(); window.location.reload(); } if (statusCode >= 400) { diff --git a/yarn.lock b/yarn.lock index 32e1cd7..3b67fea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -878,11 +878,6 @@ cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -css-mediaquery@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/css-mediaquery/-/css-mediaquery-0.1.2.tgz#6a2c37344928618631c54bd33cedd301da18bea0" - integrity sha512-COtn4EROW5dBGlE/4PiKnh6rZpAPxDeFLaEEwt4i10jpDMFt2EhQGS79QmmrO+iKCHv0PU/HrOWEhijFd1x99Q== - cssesc@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz" @@ -1766,11 +1761,6 @@ husky@^8.0.3: resolved "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz" integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg== -hyphenate-style-name@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/hyphenate-style-name/-/hyphenate-style-name-1.0.4.tgz#691879af8e220aea5750e8827db4ef62a54e361d" - integrity sha512-ygGZLjmXfPHj+ZWh6LwbC37l43MhfztxetbFCoYTM2VjkIUpeHgSNn7QIyVFj7YQ1Wl9Cbw5sholVJPzWvC2MQ== - ignore@^5.2.0, ignore@^5.2.4: version "5.2.4" resolved "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz" @@ -2231,13 +2221,6 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" -matchmediaquery@^0.3.0: - version "0.3.1" - resolved "https://registry.yarnpkg.com/matchmediaquery/-/matchmediaquery-0.3.1.tgz#8247edc47e499ebb7c58f62a9ff9ccf5b815c6d7" - integrity sha512-Hlk20WQHRIm9EE9luN1kjRjYXAQToHOIAHPJn9buxBwuhfTHoKUcX+lXBbxc85DVQfXYbEQ4HcwQdd128E3qHQ== - dependencies: - css-mediaquery "^0.1.2" - mdast-util-from-markdown@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.0.tgz#52f14815ec291ed061f2922fd14d6689c810cb88" @@ -2947,7 +2930,7 @@ prettier@3.0.3: resolved "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz" integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg== -prop-types@^15.6.1, prop-types@^15.8.1: +prop-types@^15.8.1: version "15.8.1" resolved "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz" integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== @@ -3012,16 +2995,6 @@ react-markdown@^9.0.1: unist-util-visit "^5.0.0" vfile "^6.0.0" -react-responsive@^9.0.2: - version "9.0.2" - resolved "https://registry.yarnpkg.com/react-responsive/-/react-responsive-9.0.2.tgz#34531ca77a61e7a8775714016d21241df7e4205c" - integrity sha512-+4CCab7z8G8glgJoRjAwocsgsv6VA2w7JPxFWHRc7kvz8mec1/K5LutNC2MG28Mn8mu6+bu04XZxHv5gyfT7xQ== - dependencies: - hyphenate-style-name "^1.0.0" - matchmediaquery "^0.3.0" - prop-types "^15.6.1" - shallow-equal "^1.2.1" - react@^18: version "18.2.0" resolved "https://registry.npmjs.org/react/-/react-18.2.0.tgz" @@ -3204,11 +3177,6 @@ set-function-name@^2.0.0, set-function-name@^2.0.1: functions-have-names "^1.2.3" has-property-descriptors "^1.0.0" -shallow-equal@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/shallow-equal/-/shallow-equal-1.2.1.tgz#4c16abfa56043aa20d050324efa68940b0da79da" - integrity sha512-S4vJDjHHMBaiZuT9NPb616CSmLf618jawtv3sufLl6ivK8WocjAo58cXwbRV1cgqxH0Qbv+iUt6m05eqEa2IRA== - shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz"