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 React, { useState } from 'react'
@ -33,7 +33,7 @@ export function BetPanel(props: { contract: Contract; className?: string }) {
const result = await placeBet({
amount: betAmount,
outcome: betChoice,
contractId: contract.id
contractId: contract.id,
})
console.log('placed bet. Result:', result)
@ -125,6 +125,5 @@ export function BetPanel(props: { contract: Contract; className?: string }) {
)
}
const functions = getFunctions()
export const placeBet = httpsCallable(functions, 'placeBet')

View File

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

View File

@ -18,7 +18,8 @@ export const Hero = () => {
</span>
</h1>
<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>
<div className="mt-10 sm:mt-12">
<ConvertKitEmailForm />

View File

@ -22,7 +22,7 @@ export type Contract = {
outcomeType: 'BINARY' // | 'MULTI' | 'interval' | 'date'
// outcomes: ['YES', 'NO']
seedAmounts: { YES: number; NO: number } // seedBets: [number, number]
pot: { YES: number; NO: number }
pot: { YES: number; NO: number }
createdTime: number // Milliseconds since epoch
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">
<figure className="p-6">
{user?.avatarUrl && (
<img
src={user.avatarUrl}
className="rounded-lg shadow-lg"
/>
<img src={user.avatarUrl} className="rounded-lg shadow-lg" />
)}
</figure>
<div className="max-w-md card-body">

View File

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