From f8ecef3798fda8ce7ae4cdd72bed2cfbf23e6bc3 Mon Sep 17 00:00:00 2001 From: harshit-jain52 Date: Mon, 18 Nov 2024 05:30:23 +0530 Subject: [PATCH] format: install and run prettier --- eslint.config.js | 24 +- package.json | 4 +- pnpm-lock.yaml | 10 + src/components/About.tsx | 14 +- src/components/DashboardElements.tsx | 114 +++--- src/components/Footer.tsx | 49 ++- src/components/Form.tsx | 2 +- src/components/Header.tsx | 4 +- src/components/Hero.tsx | 55 ++- src/components/MentorProjectCard.tsx | 56 +-- src/components/Navbar.tsx | 2 +- src/components/SpinnerLoader.tsx | 50 +-- src/components/TestimonialCard.tsx | 39 +- src/components/Testimonials.tsx | 29 +- src/components/Timeline.tsx | 20 +- src/components/WhyCard.tsx | 13 +- src/components/WhyKWoC.tsx | 25 +- src/data/timeline.json | 66 +-- src/main.tsx | 12 +- src/pages/FAQ.tsx | 10 +- src/pages/NotFoundPage.tsx | 5 +- src/pages/OAuth.tsx | 5 +- src/pages/ProjectForm.tsx | 4 +- src/pages/RegistrationForm.tsx | 5 +- src/pages/StudentDashboard.tsx | 580 +++++++++++++++++++-------- src/styles/About.css | 2 +- src/styles/FAQ.css | 204 +++++----- src/styles/Footer.css | 136 +++---- src/styles/Form.css | 4 +- src/styles/Header.css | 4 +- src/styles/Hero.css | 1 - src/styles/MentorDashboard.css | 257 ++++++------ src/styles/MentorProjectCard.css | 13 +- src/styles/Navbar.css | 420 +++++++++---------- src/styles/OAuth.css | 1 - src/styles/Profile.css | 153 ++++--- src/styles/Resources.css | 141 +++---- src/styles/Santa.css | 184 ++++----- src/styles/StudentDashboard.css | 121 +++--- src/styles/TestimonialCard.css | 60 ++- src/styles/Testimonials.css | 14 +- src/styles/WhyKWoC.css | 4 +- src/util/auth.tsx | 492 +++++++++++------------ src/util/backend.ts | 2 +- src/util/shuffle.ts | 20 +- src/util/types.ts | 2 +- tsconfig.app.json | 2 +- tsconfig.node.json | 2 +- vite.config.ts | 6 +- 49 files changed, 1912 insertions(+), 1530 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 092408a9..79a552ea 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,28 +1,28 @@ -import js from '@eslint/js' -import globals from 'globals' -import reactHooks from 'eslint-plugin-react-hooks' -import reactRefresh from 'eslint-plugin-react-refresh' -import tseslint from 'typescript-eslint' +import js from "@eslint/js"; +import globals from "globals"; +import reactHooks from "eslint-plugin-react-hooks"; +import reactRefresh from "eslint-plugin-react-refresh"; +import tseslint from "typescript-eslint"; export default tseslint.config( - { ignores: ['dist'] }, + { ignores: ["dist"] }, { extends: [js.configs.recommended, ...tseslint.configs.recommended], - files: ['**/*.{ts,tsx}'], + files: ["**/*.{ts,tsx}"], languageOptions: { ecmaVersion: 2020, globals: globals.browser, }, plugins: { - 'react-hooks': reactHooks, - 'react-refresh': reactRefresh, + "react-hooks": reactHooks, + "react-refresh": reactRefresh, }, rules: { ...reactHooks.configs.recommended.rules, - 'react-refresh/only-export-components': [ - 'warn', + "react-refresh/only-export-components": [ + "warn", { allowConstantExport: true }, ], }, }, -) +); diff --git a/package.json b/package.json index fc569ea2..1c6bf4d6 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "dev": "vite", "build": "tsc -b && vite build", "lint": "eslint .", - "preview": "vite preview" + "preview": "vite preview", + "format": "prettier --write ." }, "dependencies": { "fuse.js": "^7.0.0", @@ -28,6 +29,7 @@ "eslint-plugin-react-hooks": "^5.0.0", "eslint-plugin-react-refresh": "^0.4.13", "globals": "^15.11.0", + "prettier": "3.3.3", "typescript": "~5.6.2", "typescript-eslint": "^8.10.0", "vite": "^5.4.10" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a03f1c0c..a6c8a3e6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,6 +57,9 @@ importers: globals: specifier: ^15.11.0 version: 15.11.0 + prettier: + specifier: 3.3.3 + version: 3.3.3 typescript: specifier: ~5.6.2 version: 5.6.3 @@ -932,6 +935,11 @@ packages: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} + prettier@3.3.3: + resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} + engines: {node: '>=14'} + hasBin: true + punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} @@ -1937,6 +1945,8 @@ snapshots: prelude-ls@1.2.1: {} + prettier@3.3.3: {} + punycode@2.3.1: {} queue-microtask@1.2.3: {} diff --git a/src/components/About.tsx b/src/components/About.tsx index 5491c4e5..b972161a 100644 --- a/src/components/About.tsx +++ b/src/components/About.tsx @@ -6,9 +6,15 @@ export const AboutSection = () => {

About KWoC

-

Kharagpur Winter of Code is a 5-week long online program for students who are new to open source software development. The program not only helps students to get involved in open source, but also prepares them for many open source summer programs; Google Summer of Code being one of them.

+

+ Kharagpur Winter of Code is a 5-week long online program for students + who are new to open source software development. The program not only + helps students to get involved in open source, but also prepares them + for many open source summer programs; Google Summer of Code being one + of them. +

-
- ) -} + + ); +}; diff --git a/src/components/DashboardElements.tsx b/src/components/DashboardElements.tsx index f4e95acf..b5c939f2 100644 --- a/src/components/DashboardElements.tsx +++ b/src/components/DashboardElements.tsx @@ -1,74 +1,78 @@ import { Link } from "react-router-dom"; import { useAuthContext } from "../util/auth"; import "../styles/Profile.css"; -import "../styles/Resources.css"; +import "../styles/Resources.css"; export function Profile() { - const authContext = useAuthContext(); - return ( -
- -

+ const authContext = useAuthContext(); + return ( +
+ +

{authContext.userData.name}
- (@{authContext.userData.username}) + (@{authContext.userData.username}) -

-
- - Edit - - -
+

+
+ + Edit + +
- ); - } +
+ ); +} interface ResourceItem { - url: string; - avatar: string; - message: string; - noAvatarRounding?: boolean; + url: string; + avatar: string; + message: string; + noAvatarRounding?: boolean; } // Define the props for the Resources component interface ResourcesProps { - title: string; - resources: ResourceItem[]; + title: string; + resources: ResourceItem[]; } export function Resources({ title, resources }: ResourcesProps) { - return ( -
-

{title}

-
- {resources.map((resource, i) => ( - -
  • -
    - Avatar -
    -
    {resource.message}
    -
  • -
    - ))} -
    -
    - ); -} \ No newline at end of file + return ( +
    +

    {title}

    +
    + {resources.map((resource, i) => ( + +
  • +
    + Avatar +
    +
    {resource.message}
    +
  • +
    + ))} +
    +
    + ); +} diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index d7c437d2..2d1eae78 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -1,5 +1,12 @@ import "../styles/Footer.css"; -import { ROUTER_PATHS, DISCORD_INVITE, KOSS_CONTACT_EMAIL, KOSS_LINKEDIN_URL, KOSS_TWITTER_URL, KOSS_WEBSITE_URL } from "../util/constants"; +import { + ROUTER_PATHS, + DISCORD_INVITE, + KOSS_CONTACT_EMAIL, + KOSS_LINKEDIN_URL, + KOSS_TWITTER_URL, + KOSS_WEBSITE_URL, +} from "../util/constants"; const Footer = () => { return ( @@ -8,21 +15,41 @@ const Footer = () => {

    Social Groups

    -

    Discord

    -

    LinkedIn

    -

    Twitter

    +

    + Discord +

    +

    + LinkedIn +

    +

    + Twitter +

    Quick Links

    -

    Timeline

    -

    FAQs

    -

    About KWoC

    +

    + Timeline +

    +

    + FAQs +

    +

    + About KWoC +

    Other

    -

    About KOSS

    -

    Past Programs

    -

    contact@kossiitkgp.org

    +

    + About KOSS +

    +

    + + Past Programs + +

    +

    + contact@kossiitkgp.org +

    @@ -34,4 +61,4 @@ const Footer = () => { ); }; -export default Footer +export default Footer; diff --git a/src/components/Form.tsx b/src/components/Form.tsx index 108987b3..c65b512b 100644 --- a/src/components/Form.tsx +++ b/src/components/Form.tsx @@ -159,4 +159,4 @@ function FormInput(props: IFormInputProps) { ); } -export default Form; \ No newline at end of file +export default Form; diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 89f186ae..1fea6265 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -6,5 +6,5 @@ export const Header = () => {
    - ) -} + ); +}; diff --git a/src/components/Hero.tsx b/src/components/Hero.tsx index 652c8c2f..ccd4b2dc 100644 --- a/src/components/Hero.tsx +++ b/src/components/Hero.tsx @@ -1,27 +1,50 @@ -import houses from '../assets/houses-left.png'; -import hook from '../assets/igloo-scroll-hook-edit.png'; -import sign from '../assets/sign-post.png'; +import houses from "../assets/houses-left.png"; +import hook from "../assets/igloo-scroll-hook-edit.png"; +import sign from "../assets/sign-post.png"; import "../styles/Hero.css"; import "../styles/App.css"; -import { FaDiscord } from 'react-icons/fa'; -import { DISCORD_INVITE, MENTOR_MANUAL_LINK, STUDENT_MANUAL_LINK } from '../util/constants'; +import { FaDiscord } from "react-icons/fa"; +import { + DISCORD_INVITE, + MENTOR_MANUAL_LINK, + STUDENT_MANUAL_LINK, +} from "../util/constants"; export const HeroComponent = () => { return ( -
    +
    -
    - "For the love of open source" -
    +
    "For the love of open source"
    -

    Kharagpur Winter
    of Code
    2024

    +

    + Kharagpur{" "} + + Winter +
    + of Code +
    {" "} + 2024 +

    -
    @@ -29,10 +52,10 @@ export const HeroComponent = () => { houses
    - igloo + igloo
    - sign-post + sign-post
    diff --git a/src/components/MentorProjectCard.tsx b/src/components/MentorProjectCard.tsx index 3863c0aa..0ddd333a 100644 --- a/src/components/MentorProjectCard.tsx +++ b/src/components/MentorProjectCard.tsx @@ -49,35 +49,35 @@ function MentorProjectCard({ {/* Mentor and Commit Info Section */}
    -
    - - Mentor: - - @{mentor.username} - -
    +
    + + Mentor: + + @{mentor.username} + +
    -
    - - Co-Mentor: - - {secondary_mentor.username !== "" - ? `@${secondary_mentor.username}` - : "None"} - -
    +
    + + Co-Mentor: + + {secondary_mentor.username !== "" + ? `@${secondary_mentor.username}` + : "None"} + +
    {/* Commit and Pull Request Info */}
    diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 3c22482f..39631bd2 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -64,7 +64,7 @@ const Navbar = () => { prevLinks.map((link) => ({ ...link, isActive: link.link === location.pathname, - })) + })), ); }, [location.pathname]); diff --git a/src/components/SpinnerLoader.tsx b/src/components/SpinnerLoader.tsx index 050d721f..202ec1b1 100644 --- a/src/components/SpinnerLoader.tsx +++ b/src/components/SpinnerLoader.tsx @@ -1,27 +1,27 @@ function SpinnerLoader() { - return ( -
    -
    - - Loading... -
    + return ( +
    +
    + + Loading...
    - ); - } - - export default SpinnerLoader; \ No newline at end of file +
    + ); +} + +export default SpinnerLoader; diff --git a/src/components/TestimonialCard.tsx b/src/components/TestimonialCard.tsx index 15df6f47..5a9308d0 100644 --- a/src/components/TestimonialCard.tsx +++ b/src/components/TestimonialCard.tsx @@ -1,7 +1,6 @@ import "../styles/TestimonialCard.css"; import quoteimg from "../assets/quote.png"; - interface Testimonial { name: string; role: string; @@ -31,27 +30,39 @@ export default function TestimonialCard(props: TestimonialCardProps) { }} >
    - -
    - {name} -
    +
    + {name} +

    - -
    {quote}
    -






    + + + + +
    + {quote} +
    +

    +

    +

    +


    +

    {name}

    {role}

    - - -
    -

    Read Full Blog

    -
    -
    + + +
    +

    + +

    Read Full Blog

    + +

    +
    +
    ); diff --git a/src/components/Testimonials.tsx b/src/components/Testimonials.tsx index c5a79b84..f33e7687 100644 --- a/src/components/Testimonials.tsx +++ b/src/components/Testimonials.tsx @@ -6,11 +6,12 @@ import "../styles/Testimonials.css"; function Testimonials() { const [currentIndex, setCurrentIndex] = useState(0); - useEffect(() => { const interval = setInterval(() => { setCurrentIndex((prevIndex) => - prevIndex === testimonialsData.testimonials.length - 1 ? 0 : prevIndex + 1 + prevIndex === testimonialsData.testimonials.length - 1 + ? 0 + : prevIndex + 1, ); }, 5000); @@ -21,28 +22,36 @@ function Testimonials() {

    - What Past Participants Say + What Past Participants Say

    -

    +

    Stories of Growth and Success!


    - - +
    {testimonialsData.testimonials.map((testimonial, index) => ( ))}
    - -
    ); } diff --git a/src/components/Timeline.tsx b/src/components/Timeline.tsx index 56771169..51f2caad 100644 --- a/src/components/Timeline.tsx +++ b/src/components/Timeline.tsx @@ -71,8 +71,24 @@ function Timeline() { }, []); return ( -
    -

    +
    +

    Timeline

    diff --git a/src/components/WhyCard.tsx b/src/components/WhyCard.tsx index 29e0748a..723685e7 100644 --- a/src/components/WhyCard.tsx +++ b/src/components/WhyCard.tsx @@ -1,14 +1,13 @@ type Props = { - title: string, - description: string -} - + title: string; + description: string; +}; export const WhyCard = (props: Props) => { return ( -
    +

    {props.title}

    {props.description}

    - ) -} + ); +}; diff --git a/src/components/WhyKWoC.tsx b/src/components/WhyKWoC.tsx index b7f771f4..21c37a66 100644 --- a/src/components/WhyKWoC.tsx +++ b/src/components/WhyKWoC.tsx @@ -3,20 +3,27 @@ import { WhyCard } from "./WhyCard"; export const WhyKWoC = () => { return ( -
    +

    Why KWoC?

    -

    - Ignite your Open-Source Journey! -

    +

    Ignite your Open-Source Journey!

    - - - + + +
    - ) -} + ); +}; diff --git a/src/data/timeline.json b/src/data/timeline.json index f9e254c2..9fad65b0 100644 --- a/src/data/timeline.json +++ b/src/data/timeline.json @@ -1,34 +1,34 @@ [ - { - "date": "14 November 2024", - "event": "Mentor Registration Begins" - }, - { - "date": "20 November 2024", - "event": "Student Registration Begins" - }, - { - "date": "05 December 2024", - "event": "Coding Period Starts" - }, - { - "date": "15 December 2024", - "event": "All Registrations Close" - }, - { - "date": "25 December 2024", - "event": "Mid Evaluations" - }, - { - "date": "10 January 2025", - "event": "End Evaluations" - }, - { - "date": "15 January 2025", - "event": "Report Submission Deadline" - }, - { - "date": "31 January 2025", - "event": "Results Declaration" - } -] \ No newline at end of file + { + "date": "14 November 2024", + "event": "Mentor Registration Begins" + }, + { + "date": "20 November 2024", + "event": "Student Registration Begins" + }, + { + "date": "05 December 2024", + "event": "Coding Period Starts" + }, + { + "date": "15 December 2024", + "event": "All Registrations Close" + }, + { + "date": "25 December 2024", + "event": "Mid Evaluations" + }, + { + "date": "10 January 2025", + "event": "End Evaluations" + }, + { + "date": "15 January 2025", + "event": "Report Submission Deadline" + }, + { + "date": "31 January 2025", + "event": "Results Declaration" + } +] diff --git a/src/main.tsx b/src/main.tsx index d68fac9e..9f78e4b3 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,10 +1,10 @@ -import { StrictMode } from 'react' -import { createRoot } from 'react-dom/client' -import './styles/index.css' -import App from './App.tsx' +import { StrictMode } from "react"; +import { createRoot } from "react-dom/client"; +import "./styles/index.css"; +import App from "./App.tsx"; -createRoot(document.getElementById('root')!).render( +createRoot(document.getElementById("root")!).render( , -) +); diff --git a/src/pages/FAQ.tsx b/src/pages/FAQ.tsx index 5a882396..51089628 100644 --- a/src/pages/FAQ.tsx +++ b/src/pages/FAQ.tsx @@ -45,7 +45,10 @@ function FAQ() { value={query} /> {query !== "" && ( -