mirror of
https://github.com/System-End/site.git
synced 2026-04-19 19:45:07 +00:00
Changes to order form URL
This commit is contained in:
parent
11a8189c28
commit
d89df58c1e
1 changed files with 4 additions and 4 deletions
|
|
@ -38,9 +38,9 @@ export default function ShopComponent({
|
|||
setQuantities({ ...quantities, [itemID]: quantity });
|
||||
};
|
||||
|
||||
function buyLink(itemID) {
|
||||
function buyLink(itemID, itemImage) {
|
||||
const quantity = quantities[itemID] || 1; // Default quantity is 1 if not set
|
||||
return `https://forms.hackclub.com/arcade-order?user_id=${userAirtableID}&item_id=${itemID}&quantity=${quantity}`;
|
||||
return `https://forms.hackclub.com/arcade-order?user_id=${userAirtableID}&item_id=${itemID}&quantity=${quantity}&image=${encodeURIComponent(itemImage)}`;
|
||||
}
|
||||
|
||||
const canPurchaseItems = userAirtableID !== null;
|
||||
|
|
@ -87,7 +87,7 @@ export default function ShopComponent({
|
|||
quantity={item['Max Order Quantity']}
|
||||
fulfillmentDescription={item['Fulfillment Description']}
|
||||
fullName={item['Full Name']}
|
||||
link={canPurchaseItems ? buyLink(item.id) : null}
|
||||
link={canPurchaseItems ? buyLink(item.id, item['Image URL']) : null}
|
||||
key={item.id}
|
||||
id={item.id}
|
||||
onQuantityChange={(id, q) => handleQuantityChange(item.id, q)} // Pass handler to update quantity
|
||||
|
|
@ -111,7 +111,7 @@ export default function ShopComponent({
|
|||
quantity={item['Max Order Quantity']}
|
||||
fulfillmentDescription={item['Fulfillment Description']}
|
||||
fullName={item['Full Name']}
|
||||
link={canPurchaseItems ? buyLink(item.id) : null}
|
||||
link={canPurchaseItems ? buyLink(item.id, item['Image URL']) : null}
|
||||
key={item.id}
|
||||
id={item.id}
|
||||
onQuantityChange={(id, q) => handleQuantityChange(item.id, q)} // Pass handler to update quantity
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue