From ff2c1ee2ee2f284782f9b0a7c56049c50ee47763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B5=ED=9D=AC=20=EA=B9=80?= Date: Fri, 6 Dec 2024 00:00:56 +0900 Subject: [PATCH] =?UTF-8?q?shop=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/_admin/shops/shopList.jsx | 4 +-- src/components/forms/adminShop.jsx | 37 +++++++++++------------- src/components/forms/register.jsx | 2 +- src/components/table/rows/shop.jsx | 4 +-- 4 files changed, 22 insertions(+), 25 deletions(-) diff --git a/src/components/_admin/shops/shopList.jsx b/src/components/_admin/shops/shopList.jsx index 7af398f..e24d985 100644 --- a/src/components/_admin/shops/shopList.jsx +++ b/src/components/_admin/shops/shopList.jsx @@ -17,7 +17,7 @@ const TABLE_HEAD = [ { id: 'name', label: 'Shop', alignRight: false, sort: true }, { id: 'owner', label: 'Owner', alignRight: false, sort: true }, { id: 'products', label: 'products', alignRight: false, sort: true }, - { id: 'status', label: 'Status', alignRight: false, sort: false }, + // { id: 'status', label: 'Status', alignRight: false, sort: false }, { id: '', label: 'Actions', alignRight: true } ]; @@ -36,7 +36,7 @@ export default function AdminProducts() { onError: (err) => toast.error(err.response.data.message || 'Something went wrong!') } ); - console.log(data, 'data123'); + console.log(data); const handleClickOpen = (prop) => () => { setId(prop); setOpen(true); diff --git a/src/components/forms/adminShop.jsx b/src/components/forms/adminShop.jsx index b7e0919..05c325d 100644 --- a/src/components/forms/adminShop.jsx +++ b/src/components/forms/adminShop.jsx @@ -82,32 +82,32 @@ export default function AdminShopForm({ data: currentShop, isLoading: shopLoadin }); const ShopSettingScema = Yup.object().shape({ title: Yup.string().required('title is required'), - cover: Yup.mixed().required('Cover is required'), - logo: Yup.mixed().required('logo is required'), - slug: Yup.string().required('Slug is required'), - message: Yup.string().min(10, 'Message must be at least 10 words').max(50, 'Message must be at most 50 words'), - description: Yup.string().required('Description is required'), - metaTitle: Yup.string().required('Meta title is required'), - metaDescription: Yup.string().required('Meta description is required'), + // cover: Yup.mixed().required('Cover is required'), + // logo: Yup.mixed().required('logo is required'), + // slug: Yup.string().required('Slug is required'), + // message: Yup.string().min(10, 'Message must be at least 10 words').max(50, 'Message must be at most 50 words'), + // description: Yup.string().required('Description is required'), + // metaTitle: Yup.string().required('Meta title is required'), + // metaDescription: Yup.string().required('Meta description is required'), phone: Yup.string().required('Phone Number is required'), paymentInfo: Yup.object().shape({ - holderName: Yup.string().required('Holder Name is required'), - holderEmail: Yup.string().required('Holder email is required'), - bankName: Yup.string().required('Bank name is required'), - AccountNo: Yup.number().required('Account No is required') + // holderName: Yup.string().required('Holder Name is required') + // holderEmail: Yup.string().required('Holder email is required'), + // bankName: Yup.string().required('Bank name is required'), + // AccountNo: Yup.number().required('Account No is required') }), address: Yup.object().shape({ - country: Yup.string().required('Country is required'), - city: Yup.string().required('City is required'), - state: Yup.string().required('State is required'), + // country: Yup.string().required('Country is required'), + // city: Yup.string().required('City is required'), + // state: Yup.string().required('State is required'), streetAddress: Yup.string().required('Street Address is required') }) }); const formik = useFormik({ initialValues: { title: currentShop?.title || '', - metaTitle: currentShop?.metaTitle || '', - cover: currentShop?.cover || null, + // metaTitle: currentShop?.metaTitle || '', + // cover: currentShop?.cover || null, logo: currentShop?.logo || null, description: currentShop?.description || '', metaDescription: currentShop?.metaDescription || '', @@ -228,10 +228,7 @@ export default function AdminShopForm({ data: currentShop, isLoading: shopLoadin }; const handleTitleChange = (event) => { const title = event.target.value; - const slug = title - .toLowerCase() - .replace(/[^a-zA-Z0-9\s]+/g, '') - .replace(/\s+/g, '-'); // convert to lowercase, remove special characters, and replace spaces with hyphens + const slug = title.toLowerCase().replace(/\s+/g, '-'); // convert to lowercase, remove special characters, and replace spaces with hyphens formik.setFieldValue('slug', slug); // set the value of slug in the formik state formik.handleChange(event); // handle the change in formik }; diff --git a/src/components/forms/register.jsx b/src/components/forms/register.jsx index c5ce8da..505296e 100644 --- a/src/components/forms/register.jsx +++ b/src/components/forms/register.jsx @@ -86,7 +86,7 @@ export default function RegisterForm() { - First Name + {lang['First Name']} {isLoading ? : <>{row.products.length || 0}} - + {/* {isLoading ? ( ) : ( @@ -125,7 +125,7 @@ export default function ProductRow({ isLoading, row, handleClickOpen }) { {row?.status} )} - + */} {isLoading ? (