Skip to content

Fix: A Billion Lint Errors in dev 😭😭 #216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,829 changes: 1,006 additions & 823 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/components/Caroussel.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PropTypes from "prop-types";
import { useRef } from "react";
import { FaBriefcase , FaLinkedinIn } from "react-icons/fa";
import { FaBriefcase, FaLinkedinIn } from "react-icons/fa";
import { FaXTwitter } from "react-icons/fa6";
import { PiArrowCircleLeft, PiArrowCircleRight } from "react-icons/pi";
import { LazyLoadImage } from "react-lazy-load-image-component";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Footer.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import {
FaFacebook,
FaInstagram,
FaLinkedin,
Expand Down
2 changes: 1 addition & 1 deletion src/components/SeoMetadata.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ SeoMetadata.defaultProps = {
ogImageAlt:
"SpaceYaTech logo, social media handles, website URL, email, and more on a muted background.",
siteName: "SpaceYaTech",
};
};
2 changes: 1 addition & 1 deletion src/components/ViewMoreBtn.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ export default ViewMoreBtn;

ViewMoreBtn.propTypes = {
link: PropTypes.string.isRequired,
};
};
1 change: 0 additions & 1 deletion src/components/admin/AdminHeader.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { CiBellOn } from "react-icons/ci";
import { LazyLoadImage } from "react-lazy-load-image-component";
import { Link, useLocation } from "react-router-dom";
Expand Down
2 changes: 1 addition & 1 deletion src/components/admin/AdminReportCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ export {
totalVisitInnerCardData,
totalVisitInnerCardDataTwo,
TotalVisitsCustomCard,
totalVisitsData
totalVisitsData,
};
export default AdminReportCard;

Expand Down
2 changes: 1 addition & 1 deletion src/components/admin/GeneralInfo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,4 @@ export default GeneralInfo;
GeneralInfo.propTypes = {
theNext: PropTypes.func.isRequired,
setCollectedChapter: PropTypes.func.isRequired,
};
};
2 changes: 1 addition & 1 deletion src/components/admin/SocialMediaLinks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,4 @@ SocialMediaLinks.propTypes = {
thePrevious: PropTypes.func.isRequired,
theNext: PropTypes.func.isRequired,
setCollectedChapter: PropTypes.func.isRequired,
};
};
9 changes: 6 additions & 3 deletions src/components/admin/events/EventsTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,12 @@ function EventsTable() {
: "hover:bg-[#F7F7F7] text-[#656767] text-sm"
}
>
{/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}
<td className="hidden sm:table-cell py-4">
<td
className="hidden sm:table-cell py-4"
id={`checkbox-${row.id}`}
>
<input
aria-labelledby={`checkbox-${row.id}`}
type="checkbox"
className="cursor-pointer"
onChange={(event) => handleSelectRow(event, row.id)}
Expand All @@ -235,7 +238,7 @@ function EventsTable() {
</td>
<td className="whitespace-wrap px-2 py-4">{row.eventName}</td>
<td>{row.city}</td>
<td className="hidden sm:table-cell">{row.date}</td>
<td className="hidden sm:table-cell">{row.date}</td>
<td className="hidden sm:table-cell">{row.from}</td>
<td className="hidden sm:table-cell">{row.to}</td>
<td className="hidden sm:table-cell">{row.chapter}</td>
Expand Down
12 changes: 6 additions & 6 deletions src/components/admin/shop/dashboard/OrderPreviewColumns.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ const columns = [
id: "actions",
enableHiding: false,
cell: () => (
<div>
<button type="button" className="text-primary text-sm font-semibold">
View
</button>
</div>
),
<div>
<button type="button" className="text-primary text-sm font-semibold">
View
</button>
</div>
),
},
];

Expand Down
2 changes: 1 addition & 1 deletion src/components/shop/CartDrawer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,4 @@ export default CartDrawer;
CartDrawer.propTypes = {
open: PropTypes.bool.isRequired,
setOpen: PropTypes.func.isRequired,
};
};
11 changes: 8 additions & 3 deletions src/components/ui/table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ const TableCaption = React.forwardRef(({ className, ...props }, ref) => (
TableCaption.displayName = "TableCaption";

export {
Table, TableBody, TableCaption, TableCell, TableFooter,
TableHead, TableHeader, TableRow
Table,
TableBody,
TableCaption,
TableCell,
TableFooter,
TableHead,
TableHeader,
TableRow,
};

8 changes: 7 additions & 1 deletion src/context/AuthContext.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import PropTypes from "prop-types";
import { createContext, useCallback, useEffect, useMemo, useState } from "react";
import {
createContext,
useCallback,
useEffect,
useMemo,
useState,
} from "react";

export const AuthContext = createContext({
auth: {
Expand Down
9 changes: 6 additions & 3 deletions src/hooks/Queries/blogs/useAllBlogsData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const fetchBlogCategories = async () => {
}
};

const useBlogCategories = () => useQuery({
const useBlogCategories = () =>
useQuery({
queryKey: ["blogcategories"],
queryFn: () => fetchBlogCategories(),
refetchOnWindowFocus: false,
Expand All @@ -37,7 +38,8 @@ const fetchBlogsData = async (page) => {
}
};

const useBlogsData = (page) => useQuery({
const useBlogsData = (page) =>
useQuery({
queryKey: ["blogsdata"],
queryFn: () => fetchBlogsData(page),
refetchOnWindowFocus: false,
Expand All @@ -58,7 +60,8 @@ const fetchSearchBlog = async (keyword) => {
}
};

const useSearchBlog = (keyword) => useQuery({
const useSearchBlog = (keyword) =>
useQuery({
queryKey: ["searchBlog"],
queryFn: () => fetchSearchBlog(keyword),
refetchOnWindowFocus: false,
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/Queries/chapter/useIndividualChapter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ const fetchChapterData = async (id) => {
}
};

const useIndividualChapterData = (id) => useQuery({
const useIndividualChapterData = (id) =>
useQuery({
queryKey: ["oneChapter"],
queryFn: () => fetchChapterData(id),
refetchOnWindowFocus: false,
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/Queries/community/useChaptersData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const fetchChaptersData = async () => {
}
};

const useChaptersData = () => useQuery({
const useChaptersData = () =>
useQuery({
queryKey: ["allChapters"],
queryFn: () => fetchChaptersData(),
refetchOnWindowFocus: false,
Expand Down
11 changes: 7 additions & 4 deletions src/hooks/Queries/eventsSection/useEventCategories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ const fetchEventsCategories = async () => {
}
};

const useEventsCategories = () => useQuery({
const useEventsCategories = () =>
useQuery({
queryKey: ["eventsCategories"],
queryFn: () => fetchEventsCategories(),
refetchOnWindowFocus: false,
Expand Down Expand Up @@ -71,7 +72,7 @@ const fetchEvents = async (filterArray) => {
if (filterArray !== null) {
filterString += "?";
Object.keys(filterArray).forEach((key) => {
filterString += `${key }=${ filterArray[key] }&`;
filterString += `${key}=${filterArray[key]}&`;
});

url += filterString;
Expand All @@ -86,7 +87,8 @@ const fetchEvents = async (filterArray) => {
}
};

const useAllEvents = (filters) => useQuery({
const useAllEvents = (filters) =>
useQuery({
queryKey: ["allEvents"],
queryFn: () => fetchEvents(filters),
refetchOnWindowFocus: false,
Expand All @@ -105,7 +107,8 @@ const fetchCities = async () => {
}
};

const useAllCities = () => useQuery({
const useAllCities = () =>
useQuery({
queryKey: ["topCities"],
queryFn: () => fetchCities(),
refetchOnWindowFocus: false,
Expand Down
6 changes: 3 additions & 3 deletions src/hooks/Queries/eventsSection/useTopEvents.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ const fetchEventData = async (filterArray) => {
if (filterArray) {
Object.keys(filterArray).forEach((key) => {
// eslint-disable-next-line no-unused-expressions
filterArray[key] !== null &&
(url += `&${ key }=${ filterArray[key]}`);
filterArray[key] !== null && (url += `&${key}=${filterArray[key]}`);
});
}
const response = await axios.get(url);
Expand All @@ -26,7 +25,8 @@ const fetchEventData = async (filterArray) => {
}
};

const useTopEvents = (filters) => useQuery({
const useTopEvents = (filters) =>
useQuery({
queryKey: ["topEvents"],
queryFn: () => fetchEventData(filters),
refetchOnWindowFocus: true,
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/Queries/resources/useResourcesData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ const fetchResourcesData = async () => {
}
};

const useResourcesData = () => useQuery({
const useResourcesData = () =>
useQuery({
queryKey: ["resourcetypes"],
queryFn: () => fetchResourcesData(),
refetchOnWindowFocus: false,
Expand Down
3 changes: 1 addition & 2 deletions src/hooks/Queries/shop/useCartProducts.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const fetchProductsInCart = async () => {

return response.data;
} catch (error) {
toast.error("Error fetching products in cart")
toast.error("Error fetching products in cart");

// if (error.response.status === 401) {
// localStorage.removeItem("auth");
Expand All @@ -27,7 +27,6 @@ const fetchProductsInCart = async () => {
};

const useProductsInCart = () =>

useQuery({
queryKey: ["productsInCart"],
queryFn: () => fetchProductsInCart(),
Expand Down
1 change: 0 additions & 1 deletion src/hooks/Queries/shop/useSwagList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ const useSingleSwag = (id) =>
});

export { useSingleSwag, useSwagList };

2 changes: 1 addition & 1 deletion src/hooks/Queries/singleEvent/useSingleEvent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ const useOneEvent = (id) =>
staleTime: 5 * 60 * 60, // A recall will be made after 30 seconds
});

export default useOneEvent ;
export default useOneEvent;
2 changes: 0 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import { lazy } from "react";

const AboutUs = lazy(() => import("./pages/aboutUs/AboutUs"));
Expand Down
1 change: 0 additions & 1 deletion src/pages/aboutUs/sections/HeroSection.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { LazyLoadImage } from "react-lazy-load-image-component";
import { SYTHero } from "../../../assets/images/aboutPage";

Expand Down
1 change: 0 additions & 1 deletion src/pages/aboutUs/sections/MissionVisionSection.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { LittleMore } from "../../../assets/images/aboutPage";

function MissionVisionSection() {
Expand Down
11 changes: 5 additions & 6 deletions src/pages/admin/shop/dashboard/AdminMain.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import React from "react";
import AdminReportCard, {
HighDemandCard,
TotalVisitsCustomCard,
ChartComponent,
BigChartComponent,
ChartComponent,
HighDemandCard,
InvenOrderCard,
InvenOrderCardTwo,
totalSalesData,
totalOrdersData,
totalVisitsData,
totalSalesData,
totalVisitInnerCardData,
totalVisitInnerCardDataTwo,
TotalVisitsCustomCard,
totalVisitsData,
} from "../../../../components/admin/AdminReportCard";

function AdminMain() {
Expand Down
66 changes: 33 additions & 33 deletions src/pages/admin/shop/sales/ShopSales.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,43 @@ import ShopSalesTrends from "./ShopSalesTrends";
function ShopSales() {
return (
<div className="container my-10">
<section>
<h1 className="text-2xl font-light mb-8">Sales Report</h1>
<div className="border rounded-xl p-4">
<p className="md:text-xl text-sm font-semibold mb-4">
Trends In Sales
</p>
<div className="grid sm:grid-cols-1 md:grid-cols-3 lg:grid-cols-4 space-x-6">
<ChartComponent title="All Sales" number={4000} />
<ChartComponent title="Sales This Week" number={500} />
<ChartComponent title="Sales This Month" number={750} />
<ChartComponent title="Sales This Year" number={1000} />
</div>

<ShopSalesTrends className="mt-16" />
<section>
<h1 className="text-2xl font-light mb-8">Sales Report</h1>
<div className="border rounded-xl p-4">
<p className="md:text-xl text-sm font-semibold mb-4">
Trends In Sales
</p>
<div className="grid sm:grid-cols-1 md:grid-cols-3 lg:grid-cols-4 space-x-6">
<ChartComponent title="All Sales" number={4000} />
<ChartComponent title="Sales This Week" number={500} />
<ChartComponent title="Sales This Month" number={750} />
<ChartComponent title="Sales This Year" number={1000} />
</div>
</section>

<section className=" my-10">
<div className="border rounded-xl">
<div className="flex justify-between items-center w-full py-4 px-3 border-b">
<h3 className="font-semibold">Shop</h3>
<Link
to="/admin/shop/sales"
className="text-primary text-sm font-semibold"
>
View All
</Link>
</div>
<ShopSalesTrends className="mt-16" />
</div>
</section>

<SalesPreviewTable
columns={columns}
data={data}
className="text-gray-500"
/>
<section className=" my-10">
<div className="border rounded-xl">
<div className="flex justify-between items-center w-full py-4 px-3 border-b">
<h3 className="font-semibold">Shop</h3>
<Link
to="/admin/shop/sales"
className="text-primary text-sm font-semibold"
>
View All
</Link>
</div>
</section>
</div>

<SalesPreviewTable
columns={columns}
data={data}
className="text-gray-500"
/>
</div>
</section>
</div>
);
}

Expand Down
Loading
Loading