feat: a few shipping products in box
This commit is contained in:
@@ -3,18 +3,14 @@ import { CardSchema } from "../../../client";
|
||||
const DATETIME_TYPES = ["datetime", "date"];
|
||||
|
||||
const getAttributesFromCard = (card: CardSchema) => {
|
||||
console.log("getAttributesFromCard");
|
||||
|
||||
return card.attributes.reduce(
|
||||
(values, cardAttribute) => {
|
||||
let value: boolean | number | string | null | Date = cardAttribute.value;
|
||||
console.log(cardAttribute.attribute.type.type);
|
||||
|
||||
if (DATETIME_TYPES.includes(cardAttribute.attribute.type.type) && value !== null) {
|
||||
value = new Date(value as string);
|
||||
}
|
||||
|
||||
console.log("cardAttrValue", value);
|
||||
console.log("value type", typeof value);
|
||||
return {
|
||||
...values,
|
||||
[cardAttribute.attribute.name]: value,
|
||||
|
||||
@@ -13,7 +13,7 @@ const InlineButton = ({ children, onClick, ...props }: Props) => {
|
||||
onClick={onClick}
|
||||
{...props}
|
||||
>
|
||||
<Group gap="sm">
|
||||
<Group gap="sm" wrap={"nowrap"}>
|
||||
{children}
|
||||
</Group>
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user