hexColorRegex

This commit is contained in:
karimaldeen 2024-04-28 09:55:52 +03:00
parent 0820595289
commit 37ba470868
7 changed files with 9 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 23 KiB

BIN
public/Logo_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -33,7 +33,7 @@ export const AttributeValueTabs: React.FC<AttributeValueTabsProps> = ({ parentKe
type Color = GetProp<ColorPickerProps, 'value'>; type Color = GetProp<ColorPickerProps, 'value'>;
const handelchangeColor = (value: Color, hex: string)=>{ const handelchangeColor = (value: Color, hex: string)=>{
console.log(hex); console.log(hex,"hex");
setFieldValue(`Attribute.${parentKey}.AttributeValue.${tabKey}.value_en`,hex) setFieldValue(`Attribute.${parentKey}.AttributeValue.${tabKey}.value_en`,hex)
} }
@ -73,6 +73,7 @@ export const AttributeValueTabs: React.FC<AttributeValueTabsProps> = ({ parentKe
className=' ' className=' '
format='hex' format='hex'
size='large' size='large'
/> />

View File

@ -107,8 +107,8 @@ const AddcategoriesPage = () => {
if (Array.isArray(item.AttributeValue)) { if (Array.isArray(item.AttributeValue)) {
item?.AttributeValue.slice(1)?.forEach((attrItem: any, index: number) => { item?.AttributeValue.slice(1)?.forEach((attrItem: any, index: number) => {
if (attrItem && Object.keys(attrItem).length > 0) { if (attrItem && Object.keys(attrItem).length > 0) {
const hexColorRegex = /^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/; const hexColorRegex = /^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;
if (attrItem && !hexColorRegex.test(attrItem?.value_en)) { if (attrItem && !hexColorRegex.test(attrItem?.value_en)) {
toast.error(`${t('required_color')} ${index + 1}`); toast.error(`${t('required_color')} ${index + 1}`);
validationResults.push(false); validationResults.push(false);
} else { } else {

View File

@ -164,8 +164,8 @@ const EditPage = () => {
if (Array.isArray(item.AttributeValue)) { if (Array.isArray(item.AttributeValue)) {
item?.AttributeValue.slice(1)?.forEach((attrItem: any, index: number) => { item?.AttributeValue.slice(1)?.forEach((attrItem: any, index: number) => {
if (attrItem && Object.keys(attrItem).length > 0) { if (attrItem && Object.keys(attrItem).length > 0) {
const hexColorRegex = /^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/; const hexColorRegex = /^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;
if (attrItem && !hexColorRegex.test(attrItem?.value_en)) { if (attrItem && !hexColorRegex.test(attrItem?.value_en)) {
toast.error(`${t('required_color')} ${index + 1}`); toast.error(`${t('required_color')} ${index + 1}`);
validationResults.push(false); validationResults.push(false);
} else { } else {

View File

@ -13,6 +13,8 @@ function Form() {
const { id } = useParams() const { id } = useParams()
const { data, isLoading } = useGetOneOrder({ id: id }) const { data, isLoading } = useGetOneOrder({ id: id })
const order = data?.data || {}; const order = data?.data || {};
console.log(order,"order");
if (isLoading) { if (isLoading) {
return <Spin /> return <Spin />

View File

@ -42,6 +42,7 @@ overflow-x: hidden;
z-index: 9999999; z-index: 9999999;
img{ img{
margin-inline: 10px; margin-inline: 10px;
width: 60px;
} }
.HamburgerMenu{ .HamburgerMenu{
z-index: 999999999999999; z-index: 999999999999999;