hexColorRegex
This commit is contained in:
parent
0820595289
commit
37ba470868
BIN
public/Logo.png
BIN
public/Logo.png
Binary file not shown.
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 23 KiB |
BIN
public/Logo_2.png
Normal file
BIN
public/Logo_2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
@ -74,6 +74,7 @@ export const AttributeValueTabs: React.FC<AttributeValueTabsProps> = ({ parentKe
|
||||||
format='hex'
|
format='hex'
|
||||||
size='large'
|
size='large'
|
||||||
|
|
||||||
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ 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);
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@ 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);
|
||||||
|
|
|
||||||
|
|
@ -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 />
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user