Replace some more uses of any with more specific types (#389)

* Give confirmation button icon a type

* Give setBids a type

* Make StripeSession type more specific

* Give MenuButton buttonContent a type
This commit is contained in:
Forrest Wolf 2022-06-02 19:40:41 -05:00 committed by GitHub
parent 0f2a311b74
commit 397d90c6b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 5 deletions

View File

@ -5,7 +5,13 @@ import Stripe from 'stripe'
import { getPrivateUser, getUser, isProd, payUser } from './utils'
import { sendThankYouEmail } from './emails'
export type StripeSession = Stripe.Event.Data.Object & { id: any, metadata: any}
export type StripeSession = Stripe.Event.Data.Object & {
id: string
metadata: {
userId: string
manticDollarQuantity: string
}
}
export type StripeTransaction = {
userId: string

View File

@ -8,7 +8,7 @@ export function ConfirmationButton(props: {
id: string
openModalBtn: {
label: string
icon?: any
icon?: JSX.Element
className?: string
}
cancelBtn?: {

View File

@ -3,7 +3,7 @@ import { Menu, Transition } from '@headlessui/react'
import clsx from 'clsx'
export function MenuButton(props: {
buttonContent: any
buttonContent: JSX.Element
menuItems: { name: string; href: string; onClick?: () => void }[]
className?: string
}) {

View File

@ -110,11 +110,13 @@ function TableRowEnd(props: { entry: Entry | null; isNew?: boolean }) {
}
}
type Bid = { yesBid: number; noBid: number }
function NewBidTable(props: {
steps: number
bids: Array<{ yesBid: number; noBid: number }>
bids: Array<Bid>
setSteps: (steps: number) => void
setBids: (bids: any[]) => void
setBids: (bids: Array<Bid>) => void
}) {
const { steps, bids, setSteps, setBids } = props
// Prepare for new bids