Commit Graph

32 Commits

Author SHA1 Message Date
Ben Congdon
5e768aa57c
Prevent duplicate Free Response answers (#581)
* Prevent duplicate Free Response answers

* Address review comments
2022-06-25 16:18:49 -07:00
Austin Chen
6cc2d8af58
Manalink: Send mana to anyone via link (#114)
* Set up Firestore structure for mana bounty links

* Split up manalinks into successes and failures

* Allow clients to create manalinks

* Track txnId and successful users

* Store custom amounts in the link

* List all manalinks you've created

* Support backend for claiming manalinks

* Add some more error handling

* Tweak readme

* Fix typescript breakage

* Revert "Convert common imports in functions to be absolute"

This reverts commit c03518e906.

* Scaffolding so `claimManalink` works

* Clean up imports

* Barebones endpoint to claim mana

* Fix rules to only allow link creators to query

* Design out claim giftcard

* List all claimed transactions

* Style in a more awesome card

* Fix import

* Padding tweak

* Fix useManalinkTxns hook

* /send -> /link

* Tidy up some details

* Do a bunch of random manalinks work

* Fix up LinksTable to build

* Clean up LinksTable an absurd amount

* Basic details functionality on manalinks table

* Work on manalink claim stuff

* Fix up some merge mess

* Not-signed-in flow implemented

* Better manalinks table

* Only show outstanding links in table

* Use new `ManalinkTxn` type

* /link -> /links

* Change manalinks page UI to use nice looking tabs

* Many fixes to manalinks UI

* Default to 1 use

* Tidying up

* Some copy changes based on feedback

* Add required index

Co-authored-by: Marshall Polaris <marshall@pol.rs>
2022-06-23 01:07:52 -07:00
James Grugett
24176c864d Yarn lock change 2022-06-17 23:39:44 -05:00
mantikoros
fb10e9cddc server side tracking; track M$ purchases 2022-06-15 21:29:53 -05:00
mantikoros
38c63fb3ee
Amplitude (#505)
* basic amplitude setup

* delete heap

* track referrers

* basic tracking

* delete unused import

* prettier
2022-06-14 22:00:36 -05:00
Marshall Polaris
33ddd86add
Switch to Google Secret Manager for function secrets (#418)
* Upgrade firebase-functions 3.16.0 -> 3.21.2

* Use Secret Manager instead of config

* Small refactoring on new stripe/mailgun initialization

* Teach README about new secrets workflow
2022-06-04 14:39:25 -07:00
Marshall Polaris
c640b4c830
Bring docs repo into main repo as new workspace (#369)
* Bring docs repo into main repo as new workspace

* Pin @types/react to 17.x
2022-05-31 14:30:58 -07:00
Marshall Polaris
c3a5205d8e
Use cross-env for things that set environment variables (#359) 2022-05-28 13:21:05 -07:00
Marshall Polaris
5217270073
Serious business API validation & big cleanup of createContract, placeBet (#302)
* Add the great Zod as a dependency to help us

* Tweak eslint

* Rewrite a ton of stuff in createContract and placeBet

* Clean up error reporting in API

* Make sure the UI is enforcing validated limits on lengths

* Remove unnecessary Math.abs

* Better type on `BetInfo`

* Kill `manaLimitPerUser`

* Clean up hacky parameters on bet info functions

* Validate `closeTime` as a valid timestamp in the future
2022-05-26 14:37:51 -07:00
Austin Chen
8cedf93901
Implement quick betting: directly from the market card (#291)
* Play with using 3 icons for 1-click usage

* Align bet icons with the percentages

* Hide liquidity injection star, for now

* Fix Free Response card layouts

* Use triangles instead of planes

* Set correct hover states the arrows

* Fix down triangle & padding

* Default large nums to 2 sigfigs

* Clean up hover areas

* Fix bet width, remove "chance/expected"

* Show "M$20" on hover, hide arrows when closed

* Improve click targets

* FR: "MULTI" => "MANY", single => "TOP"

* Install react-hot-toaster

* Implement quick betting on binary questions

* Handle different kinds of markets

* Extract out QuickBet into its own component

* Minor tweaks

* Visually separate out quick bet pane

* Hide quick bet for FR markets with no answers

* Fill in which bets the user has already placed

* Animate movements, fix binary direction

* Hover arrows are now always gray

* Pull out code into quick-bet.tsx

* Minor comments

* Fix import

ts-ignore is scary

* Fixes from James's feedback

* Hide text only on quickbet
2022-05-23 23:44:16 -07:00
Marshall Polaris
3987baa11b
Add Vercel routes for public write API (#280)
* Improve typing of client CORS helper

* Take node-fetch as a dependency

* Add explicit Firebase region into config

* Add new Vercel proxy API routes that talk to backend

* Call Vercel proxy routes from `api-call` module

* Tweak import to try to get Vercel happy

* Tidy up a tiny bit
2022-05-23 14:16:56 -07:00
Marshall Polaris
47f10301c8
Change lodash stuff so that it can be tree-shaken out of build (#233)
* Set common package.json sideEffects: false

* Configure SWC to modularize lodash imports

* Import specific lodash functions instead of _

* Add an eslint rule to avoid full lodash import
2022-05-22 01:36:05 -07:00
Marshall Polaris
0803a15902
Set up eslint for common, functions packages (#290)
* Move common dev dependencies to workspace top level

* Add .eslintrc.js for functions and common packages

* Add more linting to check workflow
2022-05-22 00:35:43 -07:00
Marshall Polaris
3061af3837
Kill Husky, lint-staged, and pretty-quick (#288) 2022-05-21 14:50:59 -07:00
Marshall Polaris
cd7efb03ca
Implement onRequest versions of createContract, placeBet functions (#227)
* Reimplement createContract and placeBet cloud functions

* Fix broken warmup function error handling
2022-05-16 21:43:40 -07:00
Marshall Polaris
6f1c20571b
Upgrade HeadlessUI to 1.6.1 (#234)
https://github.com/tailwindlabs/headlessui/releases
2022-05-16 07:38:16 -04:00
James Grugett
d62156b8c0 Hide scrollbar on categories 2022-05-13 14:27:47 -04:00
mantikoros
9a4e5763f5
Categories (#132)
* basic market categories

* use tags to store market category

* display category in market

* display full category

* category selector component on feed

* Move feed data fetching to new file

* Decrease batch size for updating feed to prevent out-of-memory error

* Compute and update category feeds!

* Show feeds based on category tabs

* Add react-query package!

* Use react query to cache contracts

* Remove 'other' category

* Add back personal / friends to feed categories

* Show scrollbar temporarily for categories

* Remove 5 categories, change geopolitics to world

* finance => economics

* Show categories on two lines on larger screens

Co-authored-by: James Grugett <jahooma@gmail.com>
2022-05-12 10:07:10 -05:00
Marshall Polaris
1ca634be3b Move @types/module-alias to a dev dependency
My bad, I accidentally did `yarn add` and it went to the wrong spot.
2022-05-10 21:43:57 -07:00
Marshall Polaris
9b376fb11a
Reinstate eslint warning cleanup (#174)
* Reinstate eslint upgrade and related fixes

* Another shot at improving ContractLeaderboard
2022-05-10 14:49:24 -07:00
Marshall Polaris
4565430db5 Revert "Upgrade eslint, fix eslint warnings (#149)"
It's not 100% clear, but this could have caused some production
problems on the contract page, so let's revert it for now.
2022-05-10 14:22:57 -07:00
Marshall Polaris
c82a56af09
Make absolute imports work with functions project (#168)
* Use a silly hack to make absolute imports work with Firebase tools

* Use absolute import for common module in functions code
2022-05-10 13:59:38 -07:00
Marshall Polaris
167cf20bfc
Upgrade eslint, fix eslint warnings (#149)
* Add a couple missing dependencies for hooks

* Upgrade eslint

This newer eslint and typescript-eslint fixes some spurious warnings
that were bugs and supports our version of Typescript.

* Use Next Script component the way it wants us to

* Rephrase ContractLeaderboard component to avoid useEffect woes

* Use perhaps more idiomatic type for ContractLeaderboard props

* Make Folds data fetching more correct and more clear
2022-05-10 13:58:38 -07:00
James Grugett
e8ab863557
🔍 Algolia search (#136)
* Add algolia and instantsearch packages

* Switch to hooks-web package

* Implement algolia search!

* Fix types

* Fix tags page

* Closed sort option

* Implement select for filtering on open, closed, resolved, all.

* Support search in dev environment

* Fix runtime error in landing page
2022-05-09 12:38:33 -05:00
Sinclair Chen
73fc67955d
Send M$ to Charity & txns (#81)
* Add components for CPM landing and charity pages

* Remove misc.ts to fix build

* Set up cloud function for writing txns

* More plumbing for txns

* Fix up API call

* Use Date.now() to keep timestamps simple

* Some styles for charity list page

* Hard code charities data

* Pass charity data to charity page

* Update txn type

* Listen for charity txns

* Handle txn to non-user by burning it

* Read txns for charity card and charity page.

* Set images to object contain

* Clean up txn types

* Move pic to top of card. Other misc styling.

* Update charity short & long descriptions

* Add `token` and `category` to Txn

* Fix breakages

* Show Charity link in the sidebar

* Fix typing issues

* Fix not reading from the right type

* Switch out icon

* Also show Charity icon on mobile

* Update copy

Co-authored-by: Austin Chen <akrolsmir@gmail.com>
Co-authored-by: James Grugett <jahooma@gmail.com>
2022-04-29 19:35:56 -04:00
Boa
4ec59be46f
Free daily market (#107)
* Allow users a free daily market

* Show confetti on recent created market

* remove unused import

* remove comment

* Did create market -> hook, capitalize buttons

* Check for confetti with interval

* Just check once

* Capitalize create market button on feed
2022-04-28 17:01:50 -06:00
Marshall Polaris
5df0b014c1
Bump web typescript to 4.5.3 (#98) 2022-04-25 10:47:00 -05:00
James Grugett
cfbbbc4367 Upgrade some packages 2022-03-29 23:55:47 -05:00
Austin Chen
1a1dc97ec8 Generate a sitemap with next-sitemap 2022-03-24 09:28:36 -07:00
Austin Chen
7338bdd47a
Automatically sort Tailwind classes with Prettier (#45)
* Add Prettier Tailwind plugin

* Autoformat Tailwind classes with Prettier
2022-02-11 10:40:22 -08:00
Austin Chen
516656f194 Clean up About page 2022-02-06 00:35:58 -08:00
James Grugett
2cb4321766 Add yarn.lock for root 2022-02-01 15:38:35 -06:00