Skip to content

Commit

Permalink
Merge branch 'main' into joel/cb-16-stripe-provider-and-product-to-ad…
Browse files Browse the repository at this point in the history
…apter
  • Loading branch information
joelhooks authored Sep 2, 2024
2 parents 39bd12d + 4368be5 commit e8366d9
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 29 deletions.
5 changes: 5 additions & 0 deletions .changeset/modern-hairs-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@coursebuilder/commerce-next": patch
---

respect teamQuantityLimit in input
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,14 @@ export const EventDetails: React.FC<{
<h3 className="font-heading pb-4 text-2xl font-bold">Event Details</h3>
<div className="flex flex-col gap-2.5 text-base font-normal">
<div className="flex flex-col">
<span className="inline-flex items-center gap-1 font-light opacity-90">
<CalendarIcon className="h-5 w-5 flex-shrink-0 opacity-50" /> Date
<span className="inline-flex items-center gap-1 font-semibold opacity-90">
<CalendarIcon className="h-5 w-5 flex-shrink-0" /> Date
</span>{' '}
{eventDate}
</div>
<div className="flex flex-col">
<span className="inline-flex items-center gap-1 font-light opacity-90">
<ClockIcon className="relative h-5 w-5 flex-shrink-0 opacity-50" />{' '}
Time
<span className="inline-flex items-center gap-1 font-semibold opacity-90">
<ClockIcon className="relative h-5 w-5 flex-shrink-0" /> Time
</span>
<div>
{eventTime} (Pacific time){' '}
Expand All @@ -67,8 +66,8 @@ export const EventDetails: React.FC<{
</div>
</div>
<div className="flex flex-col">
<span className="inline-flex items-center gap-1 font-light opacity-90">
<MapPinIcon className="h-5 w-5 opacity-50" /> Location
<span className="inline-flex items-center gap-1 font-semibold opacity-90">
<MapPinIcon className="h-5 w-5 flex-shrink-0" /> Location
</span>{' '}
Zoom (online remote)
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export const EventPricingWidget: React.FC<{
<Pricing.Price />
<Pricing.TeamToggle />
<Pricing.TeamQuantityInput />
<Pricing.BuyButton className="border-2 text-white" />
<Pricing.SaleCountdown />
<Pricing.BuyButton className="border-2 text-lg font-semibold uppercase text-white" />
<Pricing.SaleCountdown className="py-5" />
<Pricing.GuaranteeBadge />
<Pricing.LiveRefundPolicy />
<Pricing.PPPToggle />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ export const EventSidebar = ({ children }: { children: React.ReactNode }) => {
const [sidebarHeight, setSidebarHeight] = React.useState(0)
React.useEffect(() => {
if (sidebarRef.current) {
setSidebarHeight(sidebarRef.current.clientHeight)
setSidebarHeight(sidebarRef.current.clientHeight + 90)
}
}, [sidebarRef.current])

// get window height
const [windowHeight, setWindowHeight] = React.useState(0)
React.useEffect(() => {
const handleResize = () => {
setWindowHeight(window.innerHeight)
setWindowHeight(window.innerHeight - 90)
}
handleResize()
window.addEventListener('resize', handleResize)
Expand All @@ -36,7 +36,7 @@ export const EventSidebar = ({ children }: { children: React.ReactNode }) => {
<div
ref={sidebarRef}
className={cn('', {
'md:sticky md:top-0': windowHeight > sidebarHeight,
'md:sticky md:top-14': windowHeight > sidebarHeight,
})}
>
{children}
Expand Down
30 changes: 15 additions & 15 deletions apps/astro-party/src/components/app/use-nav-links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,27 @@ import { api } from '@/trpc/react'
import type { NavLinkItem } from '../navigation/nav-link-item'

export function useNavLinks() {
// const { data: availableEvents, status } = api.events.get.useQuery()
const { data: availableEvents, status } = api.events.get.useQuery()

return [
{
href: '/posts',
label: 'Posts',
},
{
href: '/events',
label: (
<>
Events
{availableEvents && availableEvents.length > 0 && (
<div
className="bg-brand-red mb-1 ml-1 h-1 w-1 rounded-full"
aria-label={`${availableEvents.length} scheduled`}
/>
)}
</>
),
},
// {
// href: '/articles',
// label: 'Articles',
Expand All @@ -19,19 +33,5 @@ export function useNavLinks() {
// href: '/tips',
// label: 'Tips',
// },
// {
// href: '/events',
// label: (
// <>
// Events
// {availableEvents && availableEvents.length > 0 && (
// <div
// className="mb-1 ml-1 h-1 w-1 rounded-full bg-rose-400"
// aria-label={`${availableEvents.length} scheduled`}
// />
// )}
// </>
// ),
// },
] as NavLinkItem[]
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const postPurchaseWorkflow = inngest.createFunction(
throw new Error(`email resource not found`)
}

await step.sleep(`sleep for 5 minutes`, '5s')
await step.sleep(`sleep for 5 minutes`, '15m')

const welcomeEmailBody: string = await step.run(
`parse email body`,
Expand Down
6 changes: 5 additions & 1 deletion packages/commerce-next/src/pricing/pricing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,11 @@ const TeamQuantityInput = ({
}}
inputMode="numeric"
pattern="[0-9]*"
value={quantity}
value={
teamQuantityLimit !== 0 && teamQuantityLimit < quantity
? teamQuantityLimit
: quantity
}
id={`${quantity}-${product.name}`}
required={true}
/>
Expand Down

0 comments on commit e8366d9

Please sign in to comment.