Skip to content

Commit

Permalink
refactor: ran prettier format script
Browse files Browse the repository at this point in the history
  • Loading branch information
sonylomo committed Jul 18, 2024
1 parent 5561026 commit 1839800
Show file tree
Hide file tree
Showing 41 changed files with 101 additions and 100 deletions.
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,
};
};
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
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
2 changes: 1 addition & 1 deletion src/pages/blog/sections/RelatedBlogs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function RelatedBlogs({ blogId, categoryId }) {

useEffect(() => {
refetchRelatedBlogsData();
// eslint-disable-next-line react-hooks/exhaustive-deps
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [titleSlug]);

const filteredRelatedBlogs = filterRelatedBlogs(
Expand Down
2 changes: 1 addition & 1 deletion src/pages/blogs/sections/BlogStats.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function BlogStats({ blogId, likes }) {
}
clearStatusLikeBlog();
clearErrorLikeBlog();
// eslint-disable-next-line react-hooks/exhaustive-deps
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [likes, statusLikeBlog]);

return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/blogs/sections/BlogsWrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function BlogsWrapper() {

useEffect(() => {
refetchBlogsData();
// eslint-disable-next-line react-hooks/exhaustive-deps
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [page]);

const handlePageChange = ({ index }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import LocationTag from "./LocationTag";

function EventCard({ event }) {
const isVirtual = event?.mode === "Virtual";

return (
<div
className="w-full h-[530px] flex flex-col rounded-xl bg-cover bg-no-repeat overflow-hidden"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { rsvpEvent } from "../../../../../../assets/images/community";
import { sytLogoWhite } from "../../../../../../assets/images/icons";
import RSVPForm from "./RSVPForm";


function EventRSVP({ isOpen, closeModal, event }) {
const [hours, minutes] = (event?.start_time ?? "").split(":");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { FiArrowRightCircle } from "react-icons/fi";
import { LazyLoadImage } from "react-lazy-load-image-component";
import { Link } from "react-router-dom";
Expand Down
Loading

0 comments on commit 1839800

Please sign in to comment.