Run prettier

This commit is contained in:
Austin Chen 2021-12-10 16:40:23 -08:00
parent 21e8ea6f07
commit fb9a690707
6 changed files with 27 additions and 42 deletions

View File

@ -1,4 +1,4 @@
import { getFunctions, httpsCallable } from "firebase/functions" import { getFunctions, httpsCallable } from 'firebase/functions'
import clsx from 'clsx' import clsx from 'clsx'
import React, { useState } from 'react' import React, { useState } from 'react'
@ -33,7 +33,7 @@ export function BetPanel(props: { contract: Contract; className?: string }) {
const result = await placeBet({ const result = await placeBet({
amount: betAmount, amount: betAmount,
outcome: betChoice, outcome: betChoice,
contractId: contract.id contractId: contract.id,
}) })
console.log('placed bet. Result:', result) console.log('placed bet. Result:', result)
@ -125,6 +125,5 @@ export function BetPanel(props: { contract: Contract; className?: string }) {
) )
} }
const functions = getFunctions() const functions = getFunctions()
export const placeBet = httpsCallable(functions, 'placeBet') export const placeBet = httpsCallable(functions, 'placeBet')

View File

@ -24,8 +24,6 @@ function SignInLink(props: { darkBackground?: boolean }) {
? 'text-white hover:text-gray-300' ? 'text-white hover:text-gray-300'
: 'hover:text-gray-500' : 'hover:text-gray-500'
const [showLogin, setShowLogin] = useState(false) const [showLogin, setShowLogin] = useState(false)
useEffect(() => { useEffect(() => {
setShowLogin(location.search.includes('demo')) setShowLogin(location.search.includes('demo'))
@ -33,33 +31,26 @@ function SignInLink(props: { darkBackground?: boolean }) {
return ( return (
<> <>
{user {user ? (
? ( <>
<> <Link href="/contract">
<Link href="/contract"> <a className={clsx('text-base', themeClasses)}>Create a market</a>
<a className={clsx('text-base', themeClasses)}> </Link>
Create a market
</a>
</Link>
<Link href="/account"> <Link href="/account">
<a className={clsx('text-base', themeClasses)}> <a className={clsx('text-base', themeClasses)}>{user.name}</a>
{user.name} </Link>
</a> </>
</Link> ) : showLogin ? (
</> <button
) className={clsx('text-base', themeClasses)}
onClick={() => firebaseLogin()}
: showLogin >
? <button Sign In
className={clsx('text-base', themeClasses)} </button>
onClick={() => firebaseLogin()} ) : (
> <></>
Sign In )}
</button>
: <></>
}
</> </>
) )
} }
@ -79,10 +70,7 @@ export function Header(props: { darkBackground?: boolean }) {
<Link href="/"> <Link href="/">
<a className="flex flex-row items-center align-items-center h-6 sm:h-10"> <a className="flex flex-row items-center align-items-center h-6 sm:h-10">
<div className="inline-block mr-3"> <div className="inline-block mr-3">
<img <img className="h-6 sm:h-10" src="/logo-icon.svg" />
className="h-6 sm:h-10"
src="/logo-icon.svg"
/>
</div> </div>
<span <span
className={clsx( className={clsx(

View File

@ -18,7 +18,8 @@ export const Hero = () => {
</span> </span>
</h1> </h1>
<p className="mt-3 text-base text-gray-300 sm:mt-5 sm:text-xl lg:text-lg xl:text-xl"> <p className="mt-3 text-base text-gray-300 sm:mt-5 sm:text-xl lg:text-lg xl:text-xl">
Forecast the future with play-money prediction markets for you and your community Forecast the future with play-money prediction markets for
you and your community
</p> </p>
<div className="mt-10 sm:mt-12"> <div className="mt-10 sm:mt-12">
<ConvertKitEmailForm /> <ConvertKitEmailForm />

View File

@ -22,7 +22,7 @@ export type Contract = {
outcomeType: 'BINARY' // | 'MULTI' | 'interval' | 'date' outcomeType: 'BINARY' // | 'MULTI' | 'interval' | 'date'
// outcomes: ['YES', 'NO'] // outcomes: ['YES', 'NO']
seedAmounts: { YES: number; NO: number } // seedBets: [number, number] seedAmounts: { YES: number; NO: number } // seedBets: [number, number]
pot: { YES: number; NO: number } pot: { YES: number; NO: number }
createdTime: number // Milliseconds since epoch createdTime: number // Milliseconds since epoch
lastUpdatedTime: number // If the question or description was changed lastUpdatedTime: number // If the question or description was changed

View File

@ -24,10 +24,7 @@ export default function Account() {
<div className="card glass lg:card-side text-neutral-content bg-green-600 hover:bg-green-600 transition-all max-w-sm mx-auto my-12"> <div className="card glass lg:card-side text-neutral-content bg-green-600 hover:bg-green-600 transition-all max-w-sm mx-auto my-12">
<figure className="p-6"> <figure className="p-6">
{user?.avatarUrl && ( {user?.avatarUrl && (
<img <img src={user.avatarUrl} className="rounded-lg shadow-lg" />
src={user.avatarUrl}
className="rounded-lg shadow-lg"
/>
)} )}
</figure> </figure>
<div className="max-w-md card-body"> <div className="max-w-md card-body">

View File

@ -22,7 +22,7 @@ module.exports = {
themes: [ themes: [
{ {
mantic: { mantic: {
'primary': '#11b981', primary: '#11b981',
'primary-focus': '#069668', 'primary-focus': '#069668',
// Foreground content color to use on primary color // Foreground content color to use on primary color
'primary-content': '#ffffff', 'primary-content': '#ffffff',