diff --git a/common/user.ts b/common/user.ts
index 0dac5a19..78b76511 100644
--- a/common/user.ts
+++ b/common/user.ts
@@ -40,6 +40,7 @@ export type User = {
referredByContractId?: string
referredByGroupId?: string
lastPingTime?: number
+ shouldShowWelcome?: boolean
}
export const STARTING_BALANCE = ENV_CONFIG.startingBalance ?? 1000
diff --git a/firestore.rules b/firestore.rules
index 0f28ca80..05721dcf 100644
--- a/firestore.rules
+++ b/firestore.rules
@@ -22,7 +22,7 @@ service cloud.firestore {
allow read;
allow update: if resource.data.id == request.auth.uid
&& request.resource.data.diff(resource.data).affectedKeys()
- .hasOnly(['bio', 'bannerUrl', 'website', 'twitterHandle', 'discordHandle', 'followedCategories', 'lastPingTime']);
+ .hasOnly(['bio', 'bannerUrl', 'website', 'twitterHandle', 'discordHandle', 'followedCategories', 'lastPingTime','shouldShowWelcome']);
// User referral rules
allow update: if resource.data.id == request.auth.uid
&& request.resource.data.diff(resource.data).affectedKeys()
diff --git a/functions/src/create-user.ts b/functions/src/create-user.ts
index ab7c8e9a..70e81055 100644
--- a/functions/src/create-user.ts
+++ b/functions/src/create-user.ts
@@ -77,6 +77,7 @@ export const createuser = newEndpoint(opts, async (req, auth) => {
creatorVolumeCached: { daily: 0, weekly: 0, monthly: 0, allTime: 0 },
followerCountCached: 0,
followedCategories: DEFAULT_CATEGORIES,
+ shouldShowWelcome: true,
}
await firestore.collection('users').doc(auth.uid).create(user)
diff --git a/web/components/button.tsx b/web/components/button.tsx
index 8877c023..7eeca3d2 100644
--- a/web/components/button.tsx
+++ b/web/components/button.tsx
@@ -39,8 +39,10 @@ export function Button(props: {
color === 'yellow' && 'bg-yellow-400 text-white hover:bg-yellow-500',
color === 'blue' && 'bg-blue-400 text-white hover:bg-blue-500',
color === 'indigo' && 'bg-indigo-500 text-white hover:bg-indigo-600',
- color === 'gray' && 'bg-gray-100 text-gray-600 hover:bg-gray-200',
- color === 'gray-white' && 'bg-white text-gray-500 hover:bg-gray-200',
+ color === 'gray' &&
+ 'bg-greyscale-1 text-greyscale-7 hover:bg-greyscale-2',
+ color === 'gray-white' &&
+ 'text-greyscale-6 hover:bg-greyscale-2 bg-white',
className
)}
disabled={disabled}
diff --git a/web/components/buttons/pill-button.tsx b/web/components/buttons/pill-button.tsx
index 5b4962b7..8e47c94e 100644
--- a/web/components/buttons/pill-button.tsx
+++ b/web/components/buttons/pill-button.tsx
@@ -15,8 +15,8 @@ export function PillButton(props: {
className={clsx(
'cursor-pointer select-none whitespace-nowrap rounded-full',
selected
- ? ['text-white', color ?? 'bg-gray-700']
- : 'bg-gray-100 hover:bg-gray-200',
+ ? ['text-white', color ?? 'bg-greyscale-6']
+ : 'bg-greyscale-2 hover:bg-greyscale-3',
big ? 'px-8 py-2' : 'px-3 py-1.5 text-sm'
)}
onClick={onSelect}
diff --git a/web/components/onboarding/welcome.tsx b/web/components/onboarding/welcome.tsx
new file mode 100644
index 00000000..5a187a24
--- /dev/null
+++ b/web/components/onboarding/welcome.tsx
@@ -0,0 +1,173 @@
+import { ChevronLeftIcon, ChevronRightIcon } from '@heroicons/react/solid'
+import clsx from 'clsx'
+import { useState } from 'react'
+import { useUser } from 'web/hooks/use-user'
+import { updateUser } from 'web/lib/firebase/users'
+import { Col } from '../layout/col'
+import { Modal } from '../layout/modal'
+import { Row } from '../layout/row'
+import { Title } from '../title'
+
+export default function Welcome() {
+ const user = useUser()
+ const [open, setOpen] = useState(true)
+ const [page, setPage] = useState(0)
+ const TOTAL_PAGES = 4
+
+ function increasePage() {
+ if (page < TOTAL_PAGES - 1) {
+ setPage(page + 1)
+ }
+ }
+
+ function decreasePage() {
+ if (page > 0) {
+ setPage(page - 1)
+ }
+ }
+
+ async function setUserHasSeenWelcome() {
+ if (user) {
+ await updateUser(user.id, { ['shouldShowWelcome']: false })
+ }
+ }
+
+ if (!user || !user.shouldShowWelcome) {
+ return <>>
+ } else
+ return (
+
+ Manifold Markets is a place where anyone can ask a question about the + future. +
++ Your question becomes a prediction market that people can bet{' '} + mana (M$) on. +
++ Mana (M$) is + the play money you bet with. You can also turn it into a real donation + to charity, at a 100:1 ratio. +
++ When you donate M$1000 to + Givewell, Manifold sends them{' '} + $10 USD. +
+ + > + ) +} + +function Page3() { + return ( + <> + ++ As a thank you for signing up, we’ve sent you{' '} + M$1000 Mana{' '} +
+ > + ) +} diff --git a/web/components/title.tsx b/web/components/title.tsx index e58aee39..e0a0be61 100644 --- a/web/components/title.tsx +++ b/web/components/title.tsx @@ -5,7 +5,7 @@ export function Title(props: { text: string; className?: string }) { return (