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

View File

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

View File

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

View File

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

View File

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