Skip to content

Commit

Permalink
reacting to custom input better
Browse files Browse the repository at this point in the history
  • Loading branch information
Daveed committed Feb 21, 2025
1 parent 8093a8c commit ec941cf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
9 changes: 6 additions & 3 deletions src/components/checkout/CheckoutModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ const CheckoutModal: FC<Props> = ({ prices, product }: Props) => {
<h3 className="text-2xl font-medium text-gray-900 dark:text-white">
Available Options
<br />
<small className="text-sm text-gray-500">Pick an option xor chose your own via tip input</small>
<small className="text-sm text-gray-500">Pick an option to see more details</small>
<br />
</h3>
</div>

Expand Down Expand Up @@ -152,7 +153,7 @@ const CheckoutModal: FC<Props> = ({ prices, product }: Props) => {
</div>

<div className="m-4">
<label htmlFor="custom-price"><strong>Custom Price</strong></label>
<label htmlFor="custom-price"><strong>Tip || Custom Price</strong></label>
<input
type="number"
id="custom-price"
Expand Down Expand Up @@ -180,7 +181,9 @@ const CheckoutModal: FC<Props> = ({ prices, product }: Props) => {
</button>
</div>
<div className="m-4">
<p className="text-md">{selectedPrice?.Description || ' '}</p>
<p className="text-md">
{total > 0 ? selectedPrice?.Description || 'Continue using custom price' : 'Please select a price and quantity to continue'}
</p>
</div>
</form>
</div>
Expand Down
4 changes: 0 additions & 4 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ const {
POSTHOG_ID,
} = import.meta.env;

console.info('Loading Astro environment variables:',
{ BASE_URL, PUBLIC_STRIPE_PUBLISHABLE_KEY, STRAPI_URL, STORE_SLUG, COLOR_PRIMARY, COLOR_ACCENT, POSTHOG_ID }
);

/**
* @type {{[string]: string}} Global Configuration attributes for the markket instance
*/
Expand Down
3 changes: 1 addition & 2 deletions src/pages/products/[slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ const selectedImage =
---

<script>
import { ProductSlideshow, ProductForm } from "../../scripts/ui.product";
import { ProductSlideshow } from "../../scripts/ui.product";
document.addEventListener("astro:page-load", () => {
ProductForm();
ProductSlideshow();
});
</script>
Expand Down

0 comments on commit ec941cf

Please sign in to comment.