Skip to content
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

Sup 21/finalfix/super admin #1475

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
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
11 changes: 11 additions & 0 deletions modules/super-admin/components/debounce.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const debounce = (cb: any, delay = 500) => {
let timeout: any;
return (...args: any[]) => {
clearTimeout(timeout);
timeout = setTimeout(() => {
cb(...args);
}, delay);
};
};

export default debounce;
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import Head from 'next/head';

const SuperAdminVendorProductHeader = () => {
return (
<Head>
<title>Vendor Products</title>
<meta
name="description"
content="Explore a world of talents, create your personalized portfolio, and sell your digital products in your very own shop. Your dreams, your creations, your success – all in one place. Start your journey today."
/>
<meta name="title" property="og:title" content="Vendor Products" />
<meta name="type" property="og:type" content="website" />

<meta
property="og:description"
content="Explore a world of talents, create your personalized portfolio, and sell your digital products in your very own shop. Your dreams, your creations, your success – all in one place. Start your journey today."
/>
<meta name="author" content="ZuriPortfolio" />
<meta property="og:site_name" content="ZuriPortfolio" />

{/* Twitter tags */}
<meta name="twitter:card" content="Vendor Products" />
<meta name="twitter:title" content="Vendor Products" />
<meta
name="twitter:description"
content="Explore a world of talents, create your personalized portfolio, and sell your digital products in your very own shop. Your dreams, your creations, your success – all in one place. Start your journey today."
/>
<meta name="twitter:site" content="@hnginternship" />
<meta name="twitter:creator" content="@hnginternship" />
</Head>
);
};

export default SuperAdminVendorProductHeader;
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import Head from 'next/head';

const SuperAdminVendorProfileHeader = () => {
return (
<Head>
<title>Vendor Profile</title>
<meta
name="description"
content="Explore a world of talents, create your personalized portfolio, and sell your digital products in your very own shop. Your dreams, your creations, your success – all in one place. Start your journey today."
/>
<meta name="title" property="og:title" content="Vendor Profile" />
<meta name="type" property="og:type" content="website" />

<meta
property="og:description"
content="Explore a world of talents, create your personalized portfolio, and sell your digital products in your very own shop. Your dreams, your creations, your success – all in one place. Start your journey today."
/>
<meta name="author" content="ZuriPortfolio" />
<meta property="og:site_name" content="ZuriPortfolio" />

{/* Twitter tags */}
<meta name="twitter:card" content="Vendor Profile" />
<meta name="twitter:title" content="Vendor Profile" />
<meta
name="twitter:description"
content="Explore a world of talents, create your personalized portfolio, and sell your digital products in your very own shop. Your dreams, your creations, your success – all in one place. Start your journey today."
/>
<meta name="twitter:site" content="@hnginternship" />
<meta name="twitter:creator" content="@hnginternship" />
</Head>
);
};

export default SuperAdminVendorProfileHeader;
5 changes: 3 additions & 2 deletions pages/super-admin/vendor-management/banned-vendors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Image from 'next/image';
import right from '/public/assets/vendor/arrow-right.svg';
import { useRouter } from 'next/router';
import SuperAdminBannedVendorsHeader from '@modules/super-admin/components/vendormanagement/BannedVendorsHeader';
import debounce from '@modules/super-admin/components/debounce';

const Index = () => {
//Variables for the pagination
Expand Down Expand Up @@ -45,9 +46,9 @@ const Index = () => {
<div className="flex items-center justify-left md:justify-between gap-4">
{/* <SearchProduct handleSearchChange={handleSearch} /> */}
<Input
onChange={(e) => {
onChange={debounce((e: any) => {
setSearchVal(e.target.value);
}}
})}
leftIcon={<SearchNormal1 />}
type="text"
intent={'default'}
Expand Down
5 changes: 3 additions & 2 deletions pages/super-admin/vendor-management/deleted-vendors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import Image from 'next/image';
import right from '/public/assets/vendor/arrow-right.svg';
import { useRouter } from 'next/router';
import SuperAdminDeletedVendorsHeader from '@modules/super-admin/components/vendormanagement/DeletedVendorsHeader';
import debounce from '@modules/super-admin/components/debounce';

const Index = () => {
//Variables for the pagination
Expand Down Expand Up @@ -47,9 +48,9 @@ const Index = () => {
<div className="flex items-center justify-left md:justify-between gap-4">
{/* <SearchProduct handleSearchChange={handleSearch} /> */}
<Input
onChange={(e) => {
onChange={debounce((e: any) => {
setSearchVal(e.target.value);
}}
})}
leftIcon={<SearchNormal1 />}
type="text"
intent={'default'}
Expand Down
8 changes: 3 additions & 5 deletions pages/super-admin/vendor-management/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import { withAdminAuth } from '../../../helpers/withAuth';
import { Input } from '@ui/Input';
import { SearchNormal1 } from 'iconsax-react';
import SuperAdminVendorManagementHeader from '@modules/super-admin/components/vendormanagement/VendorsMgtHeader';
import debounce from '@modules/super-admin/components/debounce';

const Index = () => {
const [page, setPage] = useState(1);
const [search, setSearch] = useState('');
const { data, isLoading } = useGetAllVendor(page, search);

const handleFilter = () => {};
return (
<div className="">
Expand All @@ -33,11 +33,9 @@ const Index = () => {
</div>
<div className="flex justify-between items-center gap-2">
<Input
onChange={(e) => {
// handleSearch(e.target.value);
onChange={debounce((e: any) => {
setSearch(e.target.value);
console.log(e.target.value);
}}
})}
leftIcon={<SearchNormal1 />}
type="text"
intent={'default'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import React from 'react';
import VendorDetails from '../../../../../view-components/super-admin/vendor-managment/details/VendorDetails';
import Nav from '../../../../../view-components/super-admin/navbar';
import { withAdminAuth } from '../../../../../../helpers/withAuth';
import SuperAdminVendorProductHeader from '@modules/super-admin/components/vendormanagement/VendorProductHeader';

function details(): React.ReactElement {
return (
<main>
<>
<SuperAdminVendorProductHeader />
<Nav />
<VendorDetails />
</main>
</>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import DeleteModal from '@modules/super-admin/components/product-listing/product
import { useQueryClient } from '@tanstack/react-query';
import { withAdminAuth } from '../../../../../helpers/withAuth';
import StatusPill from '@modules/super-admin/components/StatusPill';
import SuperAdminVendorProfileHeader from '@modules/super-admin/components/vendormanagement/VendorProfileHeader';

export const brokenImage =
'https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/800px-No-Image-Placeholder.svg.png';
Expand Down Expand Up @@ -121,6 +122,7 @@ function VendorDetails() {

return (
<>
<SuperAdminVendorProfileHeader />
<SuperAdminNavbar />
<div className="container">
{isLoading || !data?.data ? (
Expand Down