- Better forecasting through play-money prediction
- markets for you and your community
+ Better forecasting through play-money prediction markets for
+ you and your community
diff --git a/web/components/resolution-panel.tsx b/web/components/resolution-panel.tsx
index 526701e8..59b339d6 100644
--- a/web/components/resolution-panel.tsx
+++ b/web/components/resolution-panel.tsx
@@ -31,10 +31,10 @@ export function ResolutionPanel(props: {
outcome === 'YES'
? 'btn-primary'
: outcome === 'NO'
- ? 'bg-red-400 hover:bg-red-500'
- : outcome === 'CANCEL'
- ? 'bg-yellow-400 hover:bg-yellow-500'
- : 'btn-disabled'
+ ? 'bg-red-400 hover:bg-red-500'
+ : outcome === 'CANCEL'
+ ? 'bg-yellow-400 hover:bg-yellow-500'
+ : 'btn-disabled'
return (
Math.random().toString(16).substr(2, 14)
\ No newline at end of file
+export const randomString = () => Math.random().toString(16).substr(2, 14)
diff --git a/web/lib/util/slugify.ts b/web/lib/util/slugify.ts
index f3437959..82172c3a 100644
--- a/web/lib/util/slugify.ts
+++ b/web/lib/util/slugify.ts
@@ -1,11 +1,10 @@
-
export const slugify = (text: any, separator = '-'): string => {
- return text
- .toString()
- .normalize('NFD') // split an accented letter in the base letter and the acent
- .replace(/[\u0300-\u036f]/g, '') // remove all previously split accents
- .toLowerCase()
- .trim()
- .replace(/[^a-z0-9 ]/g, '') // remove all chars not letters, numbers and spaces (to be replaced)
- .replace(/\s+/g, separator)
-}
\ No newline at end of file
+ return text
+ .toString()
+ .normalize('NFD') // split an accented letter in the base letter and the acent
+ .replace(/[\u0300-\u036f]/g, '') // remove all previously split accents
+ .toLowerCase()
+ .trim()
+ .replace(/[^a-z0-9 ]/g, '') // remove all chars not letters, numbers and spaces (to be replaced)
+ .replace(/\s+/g, separator)
+}
diff --git a/web/pages/account.tsx b/web/pages/account.tsx
index 9e15effc..f946fcec 100644
--- a/web/pages/account.tsx
+++ b/web/pages/account.tsx
@@ -11,7 +11,12 @@ function UserCard(props: { user: User }) {
{user?.avatarUrl && (
-
+
)}
diff --git a/web/pages/contract/index.tsx b/web/pages/contract/index.tsx
index afcab942..fa79a551 100644
--- a/web/pages/contract/index.tsx
+++ b/web/pages/contract/index.tsx
@@ -8,7 +8,6 @@ import { Title } from '../../components/title'
import { useUser } from '../../hooks/use-user'
import { createContract } from '../../lib/service/create-contract'
-
// Allow user to create a new contract
export default function NewContract() {
const creator = useUser()
@@ -24,7 +23,12 @@ export default function NewContract() {
setIsSubmitting(true)
- const contract = await createContract(question, description, initialProb, creator)
+ const contract = await createContract(
+ question,
+ description,
+ initialProb,
+ creator
+ )
await router.push(`contract/${contract.id}`)
}
@@ -51,7 +55,7 @@ export default function NewContract() {
placeholder="e.g. Will the FDA approve Paxlovid before Jun 2nd, 2022?"
className="input"
value={question}
- onChange={e => setQuestion(e.target.value || '')}
+ onChange={(e) => setQuestion(e.target.value || '')}
/>
@@ -66,7 +70,7 @@ export default function NewContract() {
className="textarea h-24 textarea-bordered"
placeholder={descriptionPlaceholder}
value={description}
- onChange={e => setDescription(e.target.value || '')}
+ onChange={(e) => setDescription(e.target.value || '')}
>
@@ -74,7 +78,9 @@ export default function NewContract() {