Skip to content

Commit

Permalink
feat(tt): remove stripe import from invoices
Browse files Browse the repository at this point in the history
  • Loading branch information
jbranchaud committed Mar 26, 2024
1 parent 2ca68a8 commit c375363
Showing 1 changed file with 5 additions and 3 deletions.
@@ -1,7 +1,6 @@
import * as React from 'react'
import {DownloadIcon} from '@heroicons/react/outline'
import {useLocalStorage} from 'react-use'
import {Stripe} from 'stripe'
import fromUnixTime from 'date-fns/fromUnixTime'
import Layout from '@/components/app/layout'
import format from 'date-fns/format'
Expand Down Expand Up @@ -63,7 +62,10 @@ const Invoice: React.FC<

const {charge, product, bulkCoupon, quantity} = chargeDetails.result

const customer = charge.customer as Stripe.Customer
const customer = z
.object({name: z.string().nullish(), email: z.string().nullish()})
.parse(charge.customer)

const formatUsd = (amount: number) => {
return Intl.NumberFormat('en-US', {
style: 'currency',
Expand All @@ -88,7 +90,7 @@ const Invoice: React.FC<
className="print:bg-white print:text-black"
>
<main className="mx-auto max-w-screen-md">
<div className="flex flex-col items-center justify-between px-5 pb-8 pt-20 text-center print:hidden sm:pt-28 md:text-left">
<div className="flex flex-col items-center justify-between px-5 pb-8 pt-20 text-center sm:pt-28 md:text-left print:hidden">
<h1 className="pb-5 font-text text-2xl font-bold leading-tight sm:text-3xl">
Your Invoice for {process.env.NEXT_PUBLIC_SITE_TITLE}
</h1>
Expand Down

0 comments on commit c375363

Please sign in to comment.