Skip to content

Commit

Permalink
clients/license-keys: only show licenskeys if user is logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
emilwidlund committed Nov 8, 2024
1 parent 949485b commit bb59bbb
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions clients/apps/web/src/components/Checkout/CheckoutConfirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,24 +191,29 @@ export const CheckoutConfirmation = ({
)}
{status === CheckoutStatus.SUCCEEDED && (
<>
{productHasLicenseKeys && (
<ShadowBox className="dark:bg-polar-800 flex flex-col gap-y-6 bg-white">
<h3>License Keys</h3>
<div className="flex flex-col gap-y-2">
{product.benefits
.filter((benefit) => benefit.type === 'license_keys')
.map((benefit) => (
<LicenseKey key={benefit.id} publicBenefit={benefit} />
))}
</div>
</ShadowBox>
)}
{currentUser ? (
<Link className="grow" href={disabled ? '#' : `/purchases`}>
<Button className="w-full" size="lg" disabled={disabled}>
Access your benefits
</Button>
</Link>
{currentUser ? (
<>
{productHasLicenseKeys && (
<ShadowBox className="dark:bg-polar-800 flex flex-col gap-y-6 bg-white">
<h3>License Keys</h3>
<div className="flex flex-col gap-y-2">
{product.benefits
.filter((benefit) => benefit.type === 'license_keys')
.map((benefit) => (
<LicenseKey
key={benefit.id}
publicBenefit={benefit}
/>
))}
</div>
</ShadowBox>
)}
<Link className="grow" href={disabled ? '#' : `/purchases`}>
<Button className="w-full" size="lg" disabled={disabled}>
Access your benefits
</Button>
</Link>
</>
) : (
<div className="flex flex-col gap-y-6">
<p className="dark:text-polar-500 text-gray-500">
Expand Down

0 comments on commit bb59bbb

Please sign in to comment.