+ {/* متراژ */}
+
+ {product.variants.map((variant) => {
+ if (variant.meterage) {
+ const isSelected = selectedMeterage === variant.meterage._id.toString()
+ return (
+
+ )
+ }
+ return null
+ })}
+
-
- {product.variants.map((variant, index) => (
-
- {index + 1}
-
- ))}
+ {/* رنگ ها */}
+
+ {product.variants.map((variant) => {
+ if (variant.color) {
+ const isSelected = selectedColor === variant.color._id.toString()
+ return (
+
+ )
+ }
+ return null
+ })}
+
+
+ {/* سایزها */}
+
+ {product.variants.map((variant) => {
+ if (variant.size) {
+ const isSelected = selectedSize === variant.size._id.toString()
+ return (
+
+ )
+ }
+ return null
+ })}
+
diff --git a/src/config/const.ts b/src/config/const.ts
index b8dc482..97d0d5c 100644
--- a/src/config/const.ts
+++ b/src/config/const.ts
@@ -1,6 +1,6 @@
export const TOKEN_NAME = "sh_token";
export const REFRESH_TOKEN_NAME = "sh_refresh_token";
-export const BASE_URL = "https://api.shinan.ir";
-// export const BASE_URL = "https://api-sondos.run.danakcorp.com";
+// export const BASE_URL = "https://api.shinan.ir";
+export const BASE_URL = "https://api-sondos.run.danakcorp.com";
export const PRIMARY_COLOR = "#015699";
diff --git a/src/types/product.types.ts b/src/types/product.types.ts
index f3e73de..23d4bab 100644
--- a/src/types/product.types.ts
+++ b/src/types/product.types.ts
@@ -14,6 +14,17 @@ export interface ProductSize {
value: string;
}
+export interface ProductColor {
+ _id: number;
+ value: string;
+ hexColor?: string;
+}
+
+export interface ProductMeterage {
+ _id: number;
+ value: string;
+}
+
export interface ProductWarranty {
_id: number;
duration: string;
@@ -52,7 +63,9 @@ export interface ProductVariant {
shop: ProductShop;
shipmentMethod: ShipmentMethod[];
warranty: ProductWarranty;
- size: ProductSize;
+ size?: ProductSize;
+ color?: ProductColor;
+ meterage?: ProductMeterage;
}
export interface ProductBrand {