From 731019efea741bcaec70ceac310e1e5ffa150ea3 Mon Sep 17 00:00:00 2001 From: Ayush Pandit Date: Fri, 6 Oct 2023 10:20:25 +0530 Subject: [PATCH] feat: ..prettierrc.json added --- .prettierrc.json | 8 + components/BackToTop.jsx | 12 +- components/Error/NotFound.jsx | 66 ++++--- components/Fields.jsx | 46 ++--- components/Footer.jsx | 81 ++++---- components/Landing.jsx | 23 +-- components/Navbar.jsx | 86 ++++---- components/ThemeSwitcher.jsx | 10 +- hooks/useWindowDimensions.js | 48 +++-- layout/CenterLayout.jsx | 6 +- layout/Layout.jsx | 8 +- pages/404.js | 2 +- pages/_app.js | 20 +- pages/_document.js | 4 +- pages/about/index.jsx | 43 ++-- pages/api/hello.js | 2 +- pages/events/index.js | 22 +-- pages/gallery/index.js | 50 +++-- pages/index.js | 11 +- pages/page404/Error.js | 12 +- pages/projects/Card.js | 6 +- pages/projects/index.js | 16 +- pages/resource/index.js | 100 +++++++--- pages/subscribe/index.js | 100 +++++----- pages/team/index.js | 363 +++++++++++++++++----------------- 25 files changed, 572 insertions(+), 573 deletions(-) create mode 100644 .prettierrc.json diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..122d9d2 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,8 @@ +{ + "printWidth": 120, + "semi": true, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "all", + "bracketSpacing": true +} diff --git a/components/BackToTop.jsx b/components/BackToTop.jsx index 854fb42..9e36634 100644 --- a/components/BackToTop.jsx +++ b/components/BackToTop.jsx @@ -1,12 +1,12 @@ -import { useEffect, useState } from "react"; -import { BsFillArrowUpCircleFill } from "react-icons/bs"; -import { motion } from "framer-motion"; +import { useEffect, useState } from 'react'; +import { BsFillArrowUpCircleFill } from 'react-icons/bs'; +import { motion } from 'framer-motion'; const BackToTop = () => { const [showButton, setShowButton] = useState(false); useEffect(() => { - window.addEventListener("scroll", () => { + window.addEventListener('scroll', () => { if (window.scrollY > 100) { setShowButton(true); } else { @@ -18,7 +18,7 @@ const BackToTop = () => { const scrollToTop = () => { window.scrollTo({ top: 0, - behavior: "smooth", + behavior: 'smooth', }); }; @@ -31,7 +31,7 @@ const BackToTop = () => { whileHover={{ scale: 1.1 }} whileTap={{ scale: 0.9 }} > - + )} diff --git a/components/Error/NotFound.jsx b/components/Error/NotFound.jsx index 55f5778..6524e19 100644 --- a/components/Error/NotFound.jsx +++ b/components/Error/NotFound.jsx @@ -2,39 +2,49 @@ import React from 'react'; // import astronaut from '/astronaut.svg'; // import saturn from '/saturn.svg'; -import {useRouter} from 'next/router' +import { useRouter } from 'next/router'; import Image from 'next/image'; const NotFound = () => { + const navigate = useRouter(); - const navigate = useRouter() - - const handleRedirection = () => { - navigate.push('/') - } - return ( -
-
-
-
-

404

-

- LOST IN - -   SPACE - - - -   GDSC? Hmm, looks like that page doesn't exist. -

- Astronaut - Planet -
-
- - + const handleRedirection = () => { + navigate.push('/'); + }; + return ( +
+
+
+
+

404

+

+ LOST IN + +   SPACE + + +   GDSC? Hmm, looks like that page doesn't exist. +

+ Astronaut + Planet
- ); +
+ + +
+ ); }; export default NotFound; diff --git a/components/Fields.jsx b/components/Fields.jsx index 29344d0..a0f33b5 100644 --- a/components/Fields.jsx +++ b/components/Fields.jsx @@ -1,24 +1,19 @@ -import React from "react"; -import Image from "next/image"; +import React from 'react'; +import Image from 'next/image'; function Fields() { return (
-

- What We Do -

+

What We Do

{/* Web Development */}
-

- Development -

+

Development

- Development is the process of creating and maintaining software and - computer programs. Dev encompasses everything from coding, to - maintenance to debugging. The open source community is one of the - most popular "developer" communities + Development is the process of creating and maintaining software and computer programs. Dev encompasses + everything from coding, to maintenance to debugging. The open source community is one of the most popular + "developer" communities

@@ -32,15 +27,12 @@ function Fields() {
-

- DSA And CP -

+

DSA And CP

- DSA (Data Structures and Algorithms) is the study of organizing and - manipulating data efficiently to perform complex computations - Competitive programming is a sport of coding where individuals or - teams solve algorithmic problems in a timed competition using DSA - skills, and quick thinking to solve problems within constraints. + DSA (Data Structures and Algorithms) is the study of organizing and manipulating data efficiently to perform + complex computations Competitive programming is a sport of coding where individuals or teams solve + algorithmic problems in a timed competition using DSA skills, and quick thinking to solve problems within + constraints.

@@ -48,16 +40,12 @@ function Fields() { {/* Machine Learning */}
-

- Machine Learning -

+

Machine Learning

- Machine learning is a sub domain of artificial intelligence that - lets computers learn from data and make predictions or decisions for - newer datasets. It involves using algorithms to analyze corelations, - patterns and relationships within datasets. This technology finds - applications in diverse fields, from autonomous driving to - bioinformatics. + Machine learning is a sub domain of artificial intelligence that lets computers learn from data and make + predictions or decisions for newer datasets. It involves using algorithms to analyze corelations, patterns + and relationships within datasets. This technology finds applications in diverse fields, from autonomous + driving to bioinformatics.

diff --git a/components/Footer.jsx b/components/Footer.jsx index 5e396fb..c727713 100644 --- a/components/Footer.jsx +++ b/components/Footer.jsx @@ -1,80 +1,73 @@ -import React from "react"; -import Link from "next/link"; -import { - FaFacebook, - FaTwitter, - FaYoutube, - FaInstagram, - FaLinkedin, - FaGithub, -} from "react-icons/fa"; +import React from 'react'; +import Link from 'next/link'; +import { FaFacebook, FaTwitter, FaYoutube, FaInstagram, FaLinkedin, FaGithub } from 'react-icons/fa'; function Footer() { const socials = [ { - name: "Facebook", - link: "https://www.facebook.com/googlefordevs", + name: 'Facebook', + link: 'https://www.facebook.com/googlefordevs', icon: , - hoverColor: "hover:text-blue-600", - darkhoverColor: "dark:hover:text-blue-600", + hoverColor: 'hover:text-blue-600', + darkhoverColor: 'dark:hover:text-blue-600', }, { - name: "Twitter", - link: "https://twitter.com/googledevs", + name: 'Twitter', + link: 'https://twitter.com/googledevs', icon: , - hoverColor: "hover:text-blue-400", - darkhoverColor: "dark:hover:text-blue-400", + hoverColor: 'hover:text-blue-400', + darkhoverColor: 'dark:hover:text-blue-400', }, { - name: "Youtube", - link: "https://www.youtube.com/googledevelopers", + name: 'Youtube', + link: 'https://www.youtube.com/googledevelopers', icon: , - hoverColor: "hover:text-red-600", - darkhoverColor: "dark:hover:text-red-600", + hoverColor: 'hover:text-red-600', + darkhoverColor: 'dark:hover:text-red-600', }, { - name: "Instagram", - link: "https://www.instagram.com/gdsc_ju/", + name: 'Instagram', + link: 'https://www.instagram.com/gdsc_ju/', icon: , - hoverColor: "hover:text-purple-600", - darkhoverColor: "dark:hover:text-purple-600", + hoverColor: 'hover:text-purple-600', + darkhoverColor: 'dark:hover:text-purple-600', }, { - name: "LinkedIn", - link: "https://www.linkedin.com/company/gdsc-jadavpur-university/", + name: 'LinkedIn', + link: 'https://www.linkedin.com/company/gdsc-jadavpur-university/', icon: , - hoverColor: "hover:text-blue-800", - darkhoverColor: "dark:hover:text-blue-800", + hoverColor: 'hover:text-blue-800', + darkhoverColor: 'dark:hover:text-blue-800', }, { - name: "Github", - link: "https://github.com/GDSC-Jadavpur-University/", + name: 'Github', + link: 'https://github.com/GDSC-Jadavpur-University/', icon: , - hoverColor: "hover:text-black", - darkhoverColor: "dark:hover:text-white", + hoverColor: 'hover:text-black', + darkhoverColor: 'dark:hover:text-white', }, ]; const footerData = [ { - name: "About", - link: "/about", + name: 'About', + link: '/about', }, { - name: "Events", - link: "/events", + name: 'Events', + link: '/events', }, { - name: "Gallery", - link: "/gallery", + name: 'Gallery', + link: '/gallery', }, { - name: "Projects", - link: "/projects", + name: 'Projects', + link: '/projects', }, { - name: "Team", - link: "/team", + name: 'Team', + link: '/team', }, ]; diff --git a/components/Landing.jsx b/components/Landing.jsx index 99272b5..493e2a8 100644 --- a/components/Landing.jsx +++ b/components/Landing.jsx @@ -1,5 +1,5 @@ -import React from "react"; -import { Player } from "@lottiefiles/react-lottie-player"; +import React from 'react'; +import { Player } from '@lottiefiles/react-lottie-player'; function Landing() { return ( @@ -17,25 +17,18 @@ function Landing() {
- - Google Developer Student Club - + Google Developer Student Club

- Google Developer Student Clubs are university based community groups - for students interested in Google developer technologies. Students - from all undergraduate or graduate programs with an interest in - growing as a developer are welcome. By joining a GDSC, students grow - their knowledge in a peer-to-peer learning environment and build - solutions for local businesses and their community. + Google Developer Student Clubs are university based community groups for students interested in Google + developer technologies. Students from all undergraduate or graduate programs with an interest in growing as + a developer are welcome. By joining a GDSC, students grow their knowledge in a peer-to-peer learning + environment and build solutions for local businesses and their community.

- + diff --git a/components/Navbar.jsx b/components/Navbar.jsx index e2f76be..94a099c 100644 --- a/components/Navbar.jsx +++ b/components/Navbar.jsx @@ -1,8 +1,8 @@ -import Image from "next/image"; -import Link from "next/link"; -import { useState } from "react"; -import { FaBars, FaTimes } from "react-icons/fa"; -import { ThemeSwitcher } from "./ThemeSwitcher"; +import Image from 'next/image'; +import Link from 'next/link'; +import { useState } from 'react'; +import { FaBars, FaTimes } from 'react-icons/fa'; +import { ThemeSwitcher } from './ThemeSwitcher'; const Navbar = () => { const [isMenuOpen, setMenuOpen] = useState(false); @@ -17,45 +17,45 @@ const Navbar = () => { const NavData = [ { - name: "About", - link: "/about", - color: "text-green-600", - hoverColor: "text-green-900", + name: 'About', + link: '/about', + color: 'text-green-600', + hoverColor: 'text-green-900', }, { - name: "Events", - link: "/events", - color: "text-red-400", - hoverColor: "text-red-900", + name: 'Events', + link: '/events', + color: 'text-red-400', + hoverColor: 'text-red-900', }, { - name: "Gallery", - link: "/gallery", - color: "text-blue-400", - hoverColor: "text-blue-900", + name: 'Gallery', + link: '/gallery', + color: 'text-blue-400', + hoverColor: 'text-blue-900', }, { - name: "Projects", - link: "/projects", - color: "text-yellow-400", - hoverColor: "text-yellow-900", + name: 'Projects', + link: '/projects', + color: 'text-yellow-400', + hoverColor: 'text-yellow-900', }, { - name: "Team", - link: "/team", - color: "text-green-600", + name: 'Team', + link: '/team', + color: 'text-green-600', }, { - name: "Subscribe", - link: "/subscribe", - color: "text-red-400", - hoverColor: "text-red-900", + name: 'Subscribe', + link: '/subscribe', + color: 'text-red-400', + hoverColor: 'text-red-900', }, { - name: "Resource", - link: "/resource", - color: "text-blue-400", - hoverColor: "text-blue-900", + name: 'Resource', + link: '/resource', + color: 'text-blue-400', + hoverColor: 'text-blue-900', }, ]; @@ -89,11 +89,7 @@ const Navbar = () => {
diff --git a/components/ThemeSwitcher.jsx b/components/ThemeSwitcher.jsx index 8c5aea1..60ede05 100644 --- a/components/ThemeSwitcher.jsx +++ b/components/ThemeSwitcher.jsx @@ -1,6 +1,6 @@ -import { useTheme } from "next-themes"; -import { SunIcon, MoonIcon } from "@heroicons/react/24/solid"; -import { useState, useEffect } from "react"; +import { useTheme } from 'next-themes'; +import { SunIcon, MoonIcon } from '@heroicons/react/24/solid'; +import { useState, useEffect } from 'react'; export const ThemeSwitcher = () => { const { theme, setTheme } = useTheme(); @@ -15,9 +15,9 @@ export const ThemeSwitcher = () => { aria-label="Toggle Dark Mode" type="button" className="flex items-center justify-center rounded-lg p-2 transition-colors hover:bg-zinc-300 dark:hover:bg-zinc-700" - onClick={() => setTheme(theme === "dark" ? "light" : "dark")} + onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')} > - {theme === "dark" ? ( + {theme === 'dark' ? ( ) : ( diff --git a/hooks/useWindowDimensions.js b/hooks/useWindowDimensions.js index 48add55..54c9daf 100644 --- a/hooks/useWindowDimensions.js +++ b/hooks/useWindowDimensions.js @@ -1,32 +1,30 @@ -import { useState,useEffect } from "react" +import { useState, useEffect } from 'react'; const useWindowDimensions = () => { - const hasWindow = typeof window !== "undefined" + const hasWindow = typeof window !== 'undefined'; - function getWindowDimensions() { - const width = hasWindow ? window.innerWidth : null - const height = hasWindow ? window.innerHeight : null - return { - width, - height, - } - } - - const [windowDimensions, setWindowDimensions] = useState( - getWindowDimensions() - ) + function getWindowDimensions() { + const width = hasWindow ? window.innerWidth : null; + const height = hasWindow ? window.innerHeight : null; + return { + width, + height, + }; + } - useEffect(() => { - if (hasWindow) { - function handleResize() { - setWindowDimensions(getWindowDimensions()) - } + const [windowDimensions, setWindowDimensions] = useState(getWindowDimensions()); - window.addEventListener("resize", handleResize) - return () => window.removeEventListener("resize", handleResize) + useEffect(() => { + if (hasWindow) { + function handleResize() { + setWindowDimensions(getWindowDimensions()); } - }, [hasWindow]) - return windowDimensions - } + window.addEventListener('resize', handleResize); + return () => window.removeEventListener('resize', handleResize); + } + }, [hasWindow]); + + return windowDimensions; +}; - export default useWindowDimensions \ No newline at end of file +export default useWindowDimensions; diff --git a/layout/CenterLayout.jsx b/layout/CenterLayout.jsx index 65a93da..53551e3 100644 --- a/layout/CenterLayout.jsx +++ b/layout/CenterLayout.jsx @@ -1,11 +1,9 @@ -import React from "react"; +import React from 'react'; function CenterLayout({ children }) { return ( <> -
- {children} -
+
{children}
); } diff --git a/layout/Layout.jsx b/layout/Layout.jsx index 2995c5d..92b4e3c 100644 --- a/layout/Layout.jsx +++ b/layout/Layout.jsx @@ -1,7 +1,7 @@ -import Footer from "@/components/Footer"; -import Navbar from "@/components/Navbar"; -import React from "react"; -import BackToTop from "@/components/BackToTop"; +import Footer from '@/components/Footer'; +import Navbar from '@/components/Navbar'; +import React from 'react'; +import BackToTop from '@/components/BackToTop'; function Layout({ children }) { return ( diff --git a/pages/404.js b/pages/404.js index 84f7f62..a61e456 100644 --- a/pages/404.js +++ b/pages/404.js @@ -1,7 +1,7 @@ import NotFound from '@/components/Error/NotFound'; const _404 = () => { - return + return ; }; export default _404; diff --git a/pages/_app.js b/pages/_app.js index f71eb68..7652276 100644 --- a/pages/_app.js +++ b/pages/_app.js @@ -1,18 +1,18 @@ -"use client"; -import { NextUIProvider } from "@nextui-org/react"; -import { ThemeProvider as NextThemesProvider } from "next-themes"; -import Layout from "@/layout/Layout"; -import "@/styles/globals.css"; -import { Quicksand } from "next/font/google"; -import { useEffect, useState } from "react"; +'use client'; +import { NextUIProvider } from '@nextui-org/react'; +import { ThemeProvider as NextThemesProvider } from 'next-themes'; +import Layout from '@/layout/Layout'; +import '@/styles/globals.css'; +import { Quicksand } from 'next/font/google'; +import { useEffect, useState } from 'react'; -const quicksand = Quicksand({ subsets: ["latin"] }); +const quicksand = Quicksand({ subsets: ['latin'] }); export default function App({ Component, pageProps }) { //use local storage to store theme - const [theme, setTheme] = useState("light"); + const [theme, setTheme] = useState('light'); useEffect(() => { - const localTheme = localStorage.getItem("theme"); + const localTheme = localStorage.getItem('theme'); if (localTheme) { setTheme(localTheme); } diff --git a/pages/_document.js b/pages/_document.js index 54e8bf3..e1e9cbb 100644 --- a/pages/_document.js +++ b/pages/_document.js @@ -1,4 +1,4 @@ -import { Html, Head, Main, NextScript } from 'next/document' +import { Html, Head, Main, NextScript } from 'next/document'; export default function Document() { return ( @@ -9,5 +9,5 @@ export default function Document() { - ) + ); } diff --git a/pages/about/index.jsx b/pages/about/index.jsx index d447980..9150afd 100644 --- a/pages/about/index.jsx +++ b/pages/about/index.jsx @@ -1,13 +1,13 @@ -import { useState } from "react"; +import { useState } from 'react'; function About() { const MapData = [ { - name: "Jadavpur University", - src: "https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d58978.26034265126!2d88.29519464863284!3d22.498882200000004!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3a0271237f28abe9%3A0xd047bab0c8bfb11c!2sJadavpur%20University!5e0!3m2!1sen!2sin!4v1696339207561!5m2!1sen!2sin", + name: 'Jadavpur University', + src: 'https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d58978.26034265126!2d88.29519464863284!3d22.498882200000004!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3a0271237f28abe9%3A0xd047bab0c8bfb11c!2sJadavpur%20University!5e0!3m2!1sen!2sin!4v1696339207561!5m2!1sen!2sin', }, { - name: "Jadavpur University , Salt Lake Campus", - src: "https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3684.4897894597025!2d88.40846367836448!3d22.56077758056876!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3a02743203255595%3A0x9c37b30c00660fab!2sJadavpur%20University%2C%20Salt%20Lake%20Campus!5e0!3m2!1sen!2sin!4v1696339381635!5m2!1sen!2sin", + name: 'Jadavpur University , Salt Lake Campus', + src: 'https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3684.4897894597025!2d88.40846367836448!3d22.56077758056876!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3a02743203255595%3A0x9c37b30c00660fab!2sJadavpur%20University%2C%20Salt%20Lake%20Campus!5e0!3m2!1sen!2sin!4v1696339381635!5m2!1sen!2sin', }, ]; const [iframeLoaded, setIframeLoaded] = useState(false); @@ -20,35 +20,26 @@ function About() {

About

- The Google Developer Student Club of Jadavpur University, JU. The - Google Developer Student Club program is a program for university - students, designed to help them build their technical skills and - knowledge and ultimately apply these skills practically to build - solutions and solve real world problems for local businesses and - communities. It is open to any student, ranging from novice developers - who are just starting, to advanced developers who want to further - improve their skills. It is a space for students to learn and - collaborate in a peer-to-peer learning environment. The GDSC will host - events regarding the fields of web development, app development, - competitive programming, machine learning, DSA and more. The aim of - the club is to help students to bridge the gap between theory and - practice, along with this - the students can build their professional - and personal networks and get access to google developer resources. + The Google Developer Student Club of Jadavpur University, JU. The Google Developer Student Club program is a + program for university students, designed to help them build their technical skills and knowledge and + ultimately apply these skills practically to build solutions and solve real world problems for local + businesses and communities. It is open to any student, ranging from novice developers who are just starting, + to advanced developers who want to further improve their skills. It is a space for students to learn and + collaborate in a peer-to-peer learning environment. The GDSC will host events regarding the fields of web + development, app development, competitive programming, machine learning, DSA and more. The aim of the club is + to help students to bridge the gap between theory and practice, along with this - the students can build their + professional and personal networks and get access to google developer resources.

{MapData.map((data) => (
-

- {data.name} -

+

{data.name}

- {!iframeLoaded && ( -
- )} + {!iframeLoaded &&
}