Commit Graph

2021 Commits

Author SHA1 Message Date
James Grugett
f294189e20 Refactor notifications to use Pagination component 2022-07-10 18:50:59 -05:00
James Grugett
162e73912e Paginate bets list 2022-07-10 18:41:33 -05:00
James Grugett
5c6a143614 Change portfolio graph option labels 2022-07-10 18:26:06 -05:00
James Grugett
78ceac0659 Don't load user bets twice 👀 2022-07-10 18:22:21 -05:00
Marshall Polaris
4700ceb14c
Refactor some backend-related stuff (#639)
* web/lib/firebase/api-call -> common/api, web/lib/firebase/api

* Reuse `APIError` type in server code

* Reuse `getFunctionUrl` in server code
2022-07-10 15:03:15 -07:00
Marshall Polaris
6462d4a2ed
Migrate createUser function to v2 (#633) 2022-07-10 14:02:32 -07:00
James Grugett
83c5f9b323 Fix unused var 2022-07-10 14:55:10 -05:00
James Grugett
f2df32e710 PseudoNumeric markets store resolveValue in resolved notification and render it 2022-07-10 14:52:31 -05:00
James Grugett
80ae551ca9
🧾 Limit orders! (#495)
* Simple limit order UI

* Update bet schema

* Restrict bet panel / bet row to only CPMMBinaryContracts (all binary DPM are resolved)

* Limit orders partway implemented

* Update follow leaderboard copy

* Change cpmm code to take some state instead of whole contract

* Write more of matching algorithm

* Fill in more of placebet

* Use client side contract search for emulator

* More correct matching

* Merge branch 'main' into limit-orders

* Some cleanup

* Listen for unfilled bets in bet panel. Calculate how the probability moves based on open limit orders.

* Simpler switching between bet & limit bet.

* Render your open bets (unfilled limit orders)

* Cancel bet endpoint.

* Fix build error

* Rename open bets to limit bets. Tweak payout calculation

* Limit probability selector to 1-99

* Deduct user balance only on each fill. Store orderAmount of bet. Timestamp of fills.

* Use floating equal to check if have shares

* Add limit order switcher to mobile bet dialog

* Support limit orders on numeric markets

* Allow CORS exception for Vercel deployments

* Remove console.logs

* Update user balance by new bet amount

* Tweak vercel cors

* Try another regexp for vercel cors

* Test another vercel regex

* Slight notifications refactor

* Fix docs edit link (#624)

* Fix docs edit link

* Update github links

* Small groups UX changes

* Groups UX on mobile

* Leaderboards => Rankings on groups

* Unused vars

* create: remove automatic setting of log scale

* Use react-query to cache notifications (#625)

* Use react-query to cache notifications

* Fix imports

* Cleanup

* Limit unseen notifs query

* Catch the bounced query

* Don't use interval

* Unused var

* Avoid flash of page nav

* Give notification question priority & 2 lines

* Right justify timestamps

* Rewording

* Margin

* Simplify error msg

* Be explicit about limit for unseen notifs

* Pass limit > 0

* Remove category filters

* Remove category selector references

* Track notification clicks

* Analyze tab usage

* Bold more on new group chats

* Add API route for listing a bets by user (#567)

* Add API route for getting a user's bets

* Refactor bets API to use /bets

* Update /markets to use zod validation

* Update docs

* Clone missing indexes from firestore

* Minor notif spacing adjustments

* Enable tipping on group chats w/ notif (#629)

* Tweak cors regex for vercel

* Your limit bets

* Implement selling shares

* Merge branch 'main' into limit-orders

* Fix lint

* Move binary search to util file

* Add note that there might be closed form

* Add tooltip to explain limit probability

* Tweak

* Cancel your limit orders if you run out of money

* Don't show amount error in probability input

* Require limit prob to be >= .1% and <= 99.9%

* Fix focus input bug

* Simplify mobile betting dialog

* Move mobile limit bets list into bet dialog.

* Small fixes to existing sell shares client

* Lint

* Refactor useSaveShares to actually read from localStorage, use less bug-prone interface.

* Fix NaN error

* Remove TODO

* Simple bet fill notification

* Tweak wording

* Sort limit bets by limit prob

* Padding on limit bets

* Match header size

Co-authored-by: Ian Philips <iansphilips@gmail.com>
Co-authored-by: ahalekelly <ahalekelly@gmail.com>
Co-authored-by: mantikoros <sgrugett@gmail.com>
Co-authored-by: Ben Congdon <ben@congdon.dev>
Co-authored-by: Austin Chen <akrolsmir@gmail.com>
2022-07-10 13:05:44 -05:00
mantikoros
d063e209dd Revert "expand search bar when typing on mobile"
This reverts commit 43b1096313.
2022-07-09 22:04:50 -04:00
Marshall Polaris
480b3e7c54
Make referral stuff not busted (#632) 2022-07-09 14:38:23 -07:00
mantikoros
43b1096313 expand search bar when typing on mobile 2022-07-09 17:27:39 -04:00
Marshall Polaris
67a05c2f1b
Migrate transact function to v2 (#635) 2022-07-09 13:54:15 -07:00
Marshall Polaris
581a42f288
Migrate stripeWebhook and createCheckoutSession to v2 (#636) 2022-07-09 13:43:18 -07:00
mantikoros
e7e686d579 return creator liquidity after resolution 2022-07-09 13:53:50 -04:00
Marshall Polaris
c1ca1471a1
Migrate createAnswer function to v2 (#634)
* Migrate createAnswer function to v2

* Remove unhelpful toString on APIError
2022-07-09 00:26:56 -07:00
Marshall Polaris
fdde73710e
Migrate claimManalink function to v2 (#628)
* Implement helpful `toString` on client `APIError`

* Migrate claimManalink function to v2
2022-07-08 15:28:04 -07:00
Marshall Polaris
d9f42caa6a
Migrate addLiquidity and withdrawLiquidity functions to v2 (#627) 2022-07-08 15:08:17 -07:00
Marshall Polaris
ed0544212d
Migrate changeUserInfo function to v2 (#626) 2022-07-08 15:00:03 -07:00
mantikoros
93b293ca0e remove quick betting for FR markets 2022-07-08 12:50:46 -04:00
mantikoros
50c5f8b6eb reenable fees on share sales; rename getCpmmFees() 2022-07-08 12:34:16 -04:00
Ian Philips
b1b016f9e0
Enable tipping on group chats w/ notif (#629) 2022-07-07 17:23:13 -06:00
Ian Philips
d6136a9937 Minor notif spacing adjustments 2022-07-07 17:17:10 -06:00
Ben Congdon
c3bc25a4b9
Add API route for listing a bets by user (#567)
* Add API route for getting a user's bets

* Refactor bets API to use /bets

* Update /markets to use zod validation

* Update docs
2022-07-07 15:36:02 -07:00
Ian Philips
999c1cd8e3 Bold more on new group chats 2022-07-07 15:52:28 -06:00
Ian Philips
e456b9a855 Analyze tab usage 2022-07-07 15:24:13 -06:00
Ian Philips
3eee4a4103 Track notification clicks 2022-07-07 15:06:29 -06:00
Ian Philips
3ff8b26312 Remove category selector references 2022-07-07 14:55:28 -06:00
Ian Philips
d6e808e1a3 Remove category filters 2022-07-07 14:45:26 -06:00
Ian Philips
cfbb78af48
Use react-query to cache notifications (#625)
* Use react-query to cache notifications

* Fix imports

* Cleanup

* Limit unseen notifs query

* Catch the bounced query

* Don't use interval

* Unused var

* Avoid flash of page nav

* Give notification question priority & 2 lines

* Right justify timestamps

* Rewording

* Margin

* Simplify error msg

* Be explicit about limit for unseen notifs

* Pass limit > 0
2022-07-07 14:41:50 -06:00
mantikoros
a22b29ad6d create: remove automatic setting of log scale 2022-07-07 12:36:34 -04:00
Ian Philips
7f8617832f Unused vars 2022-07-07 07:05:12 -06:00
Ian Philips
b8748fd49a Leaderboards => Rankings on groups 2022-07-07 06:54:00 -06:00
Ian Philips
93b2900015 Groups UX on mobile 2022-07-07 06:53:14 -06:00
Ian Philips
a23c744c3e Small groups UX changes 2022-07-06 17:24:53 -06:00
Ian Philips
e969540c72 Slight notifications refactor 2022-07-06 15:06:41 -06:00
Ian Philips
54b4f97a84 Move timestamp to same line 2022-07-06 13:45:31 -06:00
Ian Philips
de20ee9fb9
Show tip notifications (#623)
* Show tip notifications

* Optimizing notifications for mobile

* Unused vars

* Move income reason logic to income notif

* Remove unnecessary icons

* Unused vars
2022-07-06 13:30:51 -06:00
Austin Chen
2d1e76eae8 When duplicating, add the original link in description 2022-07-06 10:39:19 -07:00
Ian Philips
434b8b9dbe Just show first names to save space 2022-07-06 07:51:32 -06:00
Ian Philips
83a02c4b20 Small notifications ux improvements 2022-07-06 07:45:47 -06:00
Ian Philips
a6143c1abb Always group income 2022-07-06 07:27:21 -06:00
Austin Chen
029021b351 Remove Categories from /create 2022-07-05 17:20:37 -07:00
Austin Chen
b71944607b Simplify Tweet text 2022-07-05 16:48:59 -07:00
Austin Chen
cb25a7752d
Duplicate a question from '...' screen (#622)
* Duplicate a question from '...' screen

* Remove unused code
2022-07-05 16:26:58 -07:00
Ian Philips
3a6d28e2c2
Bold groups with recent chat activity (#621)
* Bold groups with recent chat activity

* Cleanup

* Cleanup
2022-07-05 17:18:37 -06:00
Sinclair Chen
270a5fc139 also filter by username when adding people 2022-07-05 14:34:16 -07:00
Marshall Polaris
9bff858696
Fix up lint configuration, lint line endings (#615)
* Make sure we ignore all built code in common and functions

* Add lint for Unix line endings

* Fix line endings in withdraw-liquidity.ts
2022-07-05 12:25:44 -07:00
Ian Philips
b26648c1ce
Daily trading bonuses (#618)
* first commit, WIP

* Give trading bonuses & paginate notifications

* Move read & update into transaction

* Move request bonus logic to notifs icon
2022-07-05 11:29:26 -06:00
Sinclair Chen
af2b148b34 show names on admin user table 2022-07-04 13:25:44 -07:00
Ian Philips
790fdad1e3 Display refered by publicly 2022-07-04 09:18:01 -06:00
Ian Philips
22f917e250 Avatar sizes to 24, size 20 is broken 2022-07-04 08:32:51 -06:00
Ian Philips
e712ad8289
Allow users to choose who referred them (#611)
* Allow users to choose who referred them

* Refactor

* Rewording

* Match list styles

* Match empty text styles
2022-07-04 07:49:41 -06:00
mantikoros
d78bbcb3df fix navbar tracking 2022-07-03 23:43:18 -04:00
Austin Chen
9839b7b5a4 Allow customizing starting balance & antes 2022-07-03 16:46:15 -07:00
Pico2x
960f8a1b3d
Toggle weekly leaderboard and daily/weekly/alltime portfolio graph (#616)
* Toggle weekly leaderboard and daily/weekly/alltime portfolio graph

* Formatmoney for tooltip value
2022-07-03 14:18:12 -05:00
mantikoros
1a6afaf44f
Pseudo numeric market (#609)
* create pseudo-numeric contracts

* graph and bet panel for pseudo numeric

* pseudo numeric market layout, quick betting

* Estimated value

* sell panel

* fix graph

* pseudo numeric resolution

* bets tab

* redemption for pseudo numeric markets

* create log scale market, validation

* log scale

* create: initial value can't be min or max

* don't allow log scale for ranges with negative values (b/c of problem with graph library)

* prettier delenda est

* graph: handle min value of zero

* bet labeling

* validation

* prettier

* pseudo numeric embeds

* update disclaimer

* validation

* validation
2022-07-02 14:37:59 -05:00
Ian Philips
2dce3e15a1 Correct margin on tabs 2022-07-01 17:03:26 -06:00
Ian Philips
b9931e65da Allow adding anyone's contract to a group 2022-07-01 16:37:30 -06:00
James Grugett
cb68530e2a Use client side contract search for emulator 2022-07-01 12:26:45 -04:00
Ben Congdon
d29115b05a
Nitpick on Manalinks claim page (#608) 2022-07-01 08:40:43 -07:00
Ian Philips
5034a43c3c Filter for ian's deleted users 2022-07-01 08:29:12 -06:00
Ian Philips
3165e42119
Referrals (#592)
* add trigger for updated user

* Add referral bonuses and notifications for them

* Cleanup

* Add share group button, cleanup

* Cleanup

* Add referrals list to user profile

* Remove unused

* Referral bonus => constant

* Refactor

* Add referral txn to helper fn

* Move reads into firebase transaction

* Use effects to write referral info

* Flex-wrap profile objects

* Small ui changes

* Restrict referral user to one update

* Remove rogue semicolon

* Note about group referral query details

* Track referrals, add them to settings list
2022-07-01 07:47:19 -06:00
Ben Congdon
7fc1ec6bd2
Clear suggested FR answer after submission (#603) 2022-06-30 15:13:59 -07:00
Ben Congdon
c5efd5b7d0
Market Resolution API (#600)
* Add market resolution API

* Add additional free market resolution validation

* Address review comments

* Refactor resolution validation code somewhat

Co-authored-by: Marshall Polaris <marshall@pol.rs>
2022-06-30 15:11:45 -07:00
Marshall Polaris
fc7f19e785
Finalize v2 resolvemarket migration (#598)
* Update resolve-market to be a v2 function

* Cleanup API error responses

* Update frontend to use v2 version of resolvemarket

* Appease ESLint

* Address review comments

* Appease ESLint

* Remove unnecessary auth check

* Fix logic bug in FR market validation

* Make it so you can specify runtime opts for v2 functions

* Cleanup to resolve market API resolutions input, fixes

* Fix up tiny lint

* Last minute cleanup to resolvemarket FR API input validation

Co-authored-by: Benjamin <ben@congdon.dev>
2022-06-29 16:47:06 -07:00
Marshall Polaris
2fbbc66029
Point v2 functions @ localhost during emulation (#597) 2022-06-29 16:31:53 -07:00
Austin Chen
7bbc425690 Only show "My Groups" when there is at least 1 group 2022-06-29 17:54:08 -05:00
Austin Chen
19d12c949a Add a line spacer on the sidebar 2022-06-29 17:51:11 -05:00
Marshall Polaris
3b4666ba3e
Add Firebase schema collection helpers (kind of an RFC) (#583)
* Add Firebase schema collection helpers

* Decentralize definitions from schema file (James feedback)

* Add lint comment
2022-06-29 12:21:40 -07:00
Austin Chen
8132fa595b Don't add space when there are 0 groups 2022-06-29 13:08:01 -05:00
Austin Chen
2d79d7f8db
Rework nav to show list of groups (#596)
* Rework nav to show list of groups

* Fix lint

* Replace Portfolio with Profile link

* Lint: remove unused vars
2022-06-29 12:33:20 -05:00
Ian Philips
8c3c30c707
Show groups on user page, allow to join/leave (#594)
* Show groups on user page, allow to join/leave

* Link to groups

* Unused var
2022-06-29 11:00:43 -05:00
Forrest Wolf
7f9b0557c4
Reorganize verify scripts (#589)
* Update verify to match check for functions

* Give each subdirectory a verify:dir script
2022-06-28 12:46:25 -07:00
Austin Chen
c18a0378e9 Tweak nav items around 2022-06-28 11:18:55 -05:00
Austin Chen
2f434c849d Remove portfolio link; user icon links to portfolio 2022-06-28 11:03:14 -05:00
Marshall Polaris
0b585d1c98
Typescript project references take 2 (#586)
* More liberal .gitignores on TS output directories

* Use project references for Typescript functions project

* Use /dist dir for Cloud Functions deployment payload

* Fix Github actions functions tsc job
2022-06-27 13:32:24 -07:00
James Grugett
4107d5fedb Fix weird layout on refreshing create page 2022-06-27 14:40:40 -05:00
James Grugett
1e904f567a Revert "Use Typescript project references, improve functions build/deploy (#575)"
This reverts commit 4edad9f19b.
2022-06-27 12:30:22 -05:00
Sinclair Chen
54356b8d2f
Remove undo. Show full tip amount. Linear scale. (#573) 2022-06-27 11:18:15 -05:00
Austin Chen
c1765ca0cb Use green for FR (and numeric) cards 2022-06-26 19:44:10 -05:00
Ben Congdon
3b6ba76db6
Add market liquidity addition events to bets feed (#578)
* Add liquidity events to bets feed

* Use larger avatar for liquidity feed items
2022-06-26 19:00:02 -05:00
Marshall Polaris
0067bee94b
Compute stats in Firebase instead of Vercel (#584)
* Add stats updating cloud function

* Read stats from database on client instead of computing them

* Improve logging for stats updater

* Tidying up
2022-06-26 14:42:42 -07:00
Marshall Polaris
2e5d852a77 Fix lint 2022-06-25 18:20:54 -07:00
Marshall Polaris
11f6a57c54 Fix types on API LiteUser 2022-06-25 18:20:10 -07:00
Justin
fa86f5e89a
Add Users API endpoint (#547)
* add users endpoint to API

* docs, url

* tweak docs
2022-06-25 16:28:01 -07:00
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
Marshall Polaris
4edad9f19b
Use Typescript project references, improve functions build/deploy (#575)
* More liberal .gitignores on TS output directories

* Use project references for Typescript projects

* Use /dist dir for Cloud Functions deployment payload

* Disable `next build` typechecking

* Fiddle with GitHub tsc jobs
2022-06-24 22:41:30 -07:00
Austin Chen
3123021d94 Rename "Details" to "About" 2022-06-24 18:41:02 -05:00
Austin Chen
da81035e58 Group leaderboards show members only by default 2022-06-24 18:38:39 -05:00
Austin Chen
8357361038 Remove unused function 2022-06-24 18:06:20 -05:00
Austin Chen
f224fc2e28 Clean up Group Sidebar by moving into Details tab 2022-06-24 16:02:05 -05:00
Ian Philips
969cdcaa16 Search group contracts 2022-06-24 12:32:59 -05:00
James Grugett
b7dbcaaadf Run prettier 2022-06-24 12:27:03 -05:00
Pico2x
e7abe709b3
[Leaderboard] Show daily 'topBettor' leaderboard (#579) 2022-06-24 12:24:20 -05:00
James Grugett
8d7bf6fb64 Apply tag and creatorId filters to contract firestore search 2022-06-24 12:19:04 -05:00
Ian Philips
8ced159d9a Various group & mobile ux improvements 2022-06-24 12:16:37 -05:00
Pico2x
ebc4bd6bcf
[PortfolioGraph] Shows a graph of the portfolio value over time (#570)
* [Portfolio Graph] Shows a graph of the portfolio value over time

* [PortfolioGraph] Fix some nits.

* [PortfolioGraph] Comment out portfolio-value-section

Hides the component completely for now, so we can land today. My plan would be to land today, wait for the history to build up, and then revert this commit. As opposed to leaving the PR idle for a while, and then have to deal with conflicts.

* [PortfolioGraph] Rm duplicate firestore rule
2022-06-24 12:14:20 -05:00
Marshall Polaris
d8a0cc281d
Greatly extend static page generation timeout (#576) 2022-06-23 21:51:46 -07:00
Marshall Polaris
603bec9e88
Ameliorate homepage search spam (#564)
* Don't recompute search filters when follows loaded unnecessarily

* Don't wait for router to get saved search sort
2022-06-23 16:47:03 -07:00
Marshall Polaris
4f9e303daa
Clean up definition of v2 cloud function URLs (#562) 2022-06-23 16:46:49 -07:00
Ian Philips
f0d4e9940c Improve group user search 2022-06-23 16:49:14 -05:00
Ian Philips
17ac6c58b2 Don't prompt to comment on FR bets, arrow spacing 2022-06-23 16:09:26 -05:00
Ian Philips
b5810481d0 Restore category in tags to /create 2022-06-23 15:55:05 -05:00
Sinclair Chen
8cc0cf160a lint 2022-06-23 14:41:42 -05:00
Sinclair Chen
00c2012ccf Refactor empty avatar component 2022-06-23 14:23:40 -05:00
Ian Philips
9757ed1d8b lint 2022-06-23 13:02:52 -05:00
Ian Philips
211905c27f Free daily markets on hiatus 2022-06-23 13:00:14 -05:00
Ian Philips
75907f6c18 Join group button 2022-06-23 12:40:32 -05:00
Ian Philips
b569f67fc1 Group discussion ux improvements 2022-06-23 12:36:09 -05:00
ahalekelly
28c8cc6863
Fix line off the right of closed markets (#569) 2022-06-23 12:13:13 -05:00
Ben Congdon
cdd8af241b
Show resolution time in market cards when appropriate (#565)
* Show resolution time in market cards when appropriate

* Rebase and fix contract-search-firestore
2022-06-23 12:12:57 -05: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
ahalekelly
4eedf65b21
API update pool (#553)
* Update api pool and totalLiquidity

* fix pool type

* reverting totalLiquidity changes

* pool and totalLiquidity docs description

* Changed pool type to match elsewhere
2022-06-23 00:37:04 -07:00
Austin Chen
ba39eb114c Hide "Get M$" on private instances 2022-06-22 19:02:50 -05:00
Austin Chen
6f789c9363 Fix build 2022-06-22 18:45:48 -05:00
Austin Chen
fee36a378c Use firestore-based search for private instances 2022-06-22 18:44:23 -05:00
James Grugett
16ac25bb77 Move more nav options to More menu on mobile 2022-06-22 17:34:43 -05:00
Justin
4ea7b6692a
add resolutionProbability to LiteMarket (#546) 2022-06-22 15:28:11 -07:00
Ian Philips
237a6c4d2a Unused vars 2022-06-22 17:21:31 -05:00
Ian Philips
6a35d3bf2d Remove group details cache, update group directly 2022-06-22 17:19:17 -05:00
James Grugett
e5e13cc598 Update follow leaderboard copy 2022-06-22 16:22:45 -05:00
James Grugett
8276046f8e Number of followers => Total followers 2022-06-22 16:17:21 -05:00
James Grugett
a785fe4f83 Fix follow leaderboard layout on mobile 2022-06-22 15:52:23 -05:00
James Grugett
8b1d132e17
Daily/Weekly/Monthly Leaderboards by Fede (#557)
* [Leaderboards] Added period toggle for leaderboards

* [Leaderboards] TopBettors now calculates by period correctly

* [Leaderboard] Use a subcollection for the portfolio caching

* [Leaderboard] Switches to a tab view, temporarily hides the missing topBettors periods

* [Leaderboard] Reverts random yarn.lock changes

* Fix type error from merge

* Increase timeout on update metrics

* Update firebase rules to allow reading user portfolioHistory

Co-authored-by: Pico2x <pico2x@gmail.com>
2022-06-22 15:29:40 -05:00
Ian Philips
495cbef995 portfolio fix 2022-06-22 12:54:41 -05:00
Ian Philips
eb02207c56 portfolio fix 2022-06-22 12:51:20 -05:00
Ian Philips
a1ea864799 Debounce 2022-06-22 11:43:47 -05:00
Ian Philips
3b3717d307
Groups (#510)
* Folds=>groups

* Show groups on user profile

* Allow group creation from /create

* Refactoring to groups

* Convert folds to groups

* Add new add to group notification

* Fix user profile tab bug

* Add groups nav and tab for my groups

* Remove bad profile pages

* remove comments

* Add group list dropdown to sidebar

* remove unused

* group cards ui

* Messages=>Comments, v2, groupDetails

* Discussion time

* Cleaning up some code

* Remove follow count

* Fix pool scoring for cpmm

* Fix imports

* Simplify rules, add GroupUser collection

* Fix group cards

* Refactor

* Refactor

* Small fixes

* Remove string

* Add api error detail handling

* Clear name field

* Componentize

* Spacing

* Undo userpage memo

* Member groups are already in my tab

* Remove active contracts reference for now

* Remove unused

* Refactoring

* Allow adding old questions to a group

* Rename

* Wording

* Throw standard v2 APIError

* Hide input for non-members, add about under title

* Multiple names to & # more

* Move comments firestore rules to appropriate subpaths

* Group membership, pool=>volume

* Cleanup, useEvent

* Raise state to parent

* Eliminate unused

* Cleaning up

* Clean code

* Revert tags input deletion

* Cleaning code

* Stylling

* Limit members to display

* Array cleanup

* Add categories back in

* Private=>closed

* Unused vars
2022-06-22 11:35:50 -05:00
Ben Congdon
67d0a6c0c2
Create Top Followed Users leaderboard (#531)
* Create Top Followed Users leaderboard

* Switch to increment/decrement approach for caching user follower counts

* Backfill script for user follow counts

* Appease ESLint

* Address review comment

Co-authored-by: James Grugett <jahooma@gmail.com>
2022-06-22 11:05:54 -05:00
ahalekelly
7a09365f00
New tooltip for binary market chart, with date and time (#529)
* New tooltip for binary market chart

* Tooltip on one line and rewrote date formatter

* Interpolate graph points and updated date format

* Reduced point count to 300 desktop, 50 mobile
2022-06-22 10:45:15 -05:00
mantikoros
a8b874a32f track comment tips 2022-06-21 10:36:44 -05:00
James Grugett
9a97da72d8 Don't show sell button if you have sold all your shares 2022-06-21 10:14:55 -05:00
mantikoros
d4f2a81735 exclude certain categories for new users 2022-06-21 10:01:51 -05:00
James Grugett
1b3b4eb6d8 Don't show sell button for closed markets 2022-06-21 09:59:12 -05:00
Marshall Polaris
5add7eea49
Remove notification box about public/hidden bets (#544) 2022-06-20 18:29:46 -05:00
Justin
d572efad1a
Add Statistics link to sidebar (#545)
* add stats link to sidebar & mobile nav

* prettier
2022-06-20 18:28:18 -05:00
Ian Philips
9004c694ca Fix comments & bets mixing in tabs ui 2022-06-20 08:58:18 -05:00
Marshall Polaris
08632a3a07
Correctly proxy GET and HEAD requests instead of dying (#542) 2022-06-18 02:09:44 -07:00
Sinclair Chen
833dd37469
Comment tips (attempt 2) (#539)
* Add tip arrows UI (visual)

* move tipper into its own component

* simplify score calculation

* Add tip txns

- more specific txn types
- fix transact cloud function to be able to create tip txns
- insert tips into comments via a context

* Refactor tipper to send tip txns

* Stop tipping yourself. Disable anons.

* Style tipper (smaller)

* remove default exports

* capitalize tooltips

* rename stuff

* add exhausting hook dependencies

* replace context with prop threading

* fix eslint unused vars

* fix: thread tips correctly into fr comments
2022-06-17 22:28:16 -05:00
Marshall Polaris
bb934d8390
Remove surprising 2 minute edge caching for API market data (#541) 2022-06-17 17:43:02 -07:00
James Grugett
83ded17625 Revert "Comment tips (#469)"
This reverts commit e567782a7d.
2022-06-17 16:31:21 -05:00
mantikoros
7679849c7d show 2 decimal places for fees 2022-06-17 16:28:25 -05:00
Sinclair Chen
e567782a7d
Comment tips (#469)
* Add tip arrows UI (visual)

* move tipper into its own component

* simplify score calculation

* Add tip txns

- more specific txn types
- fix transact cloud function to be able to create tip txns
- insert tips into comments via a context

* Refactor tipper to send tip txns

* Stop tipping yourself. Disable anons.

* Style tipper (smaller)

* remove default exports

* capitalize tooltips

* rename stuff

* add exhausting hook dependencies

* replace context with prop threading

* fix eslint unused vars
2022-06-17 14:19:42 -07:00
Sinclair Chen
e0a40d4d24 Replace leaderboard cake icon with line go up 2022-06-17 10:38:47 -07:00
Marshall Polaris
732a474cc9
Add userId to bets in API (#530)
* add userid to bets

* allBets -> bets

* revert one

Co-authored-by: wasabipesto <21313833+wasabipesto@users.noreply.github.com>
2022-06-17 00:35:38 -07:00
Ben Congdon
172f14c16f
Include answer probabilities in FreeResponse API results (#526)
* Include answer probabilities in FreeResponse API results

* Appease ESLint
2022-06-17 00:20:43 -07:00
Ben Congdon
a8ae724159
Don't show the 'New' chip on resolved markets (#523)
* Don't show the 'New' chip on resolved markets

* Add createdTime check to contract-details
2022-06-16 22:52:53 -05:00
ahalekelly
f063d5cd24
Step charts (#520)
* Use step charts

* Fixed formatting

* Fixed flat line on right side of chart

* Tweaked chart margins

* Restored right margin
2022-06-16 22:51:48 -05:00
Ben Congdon
60bb892601
Include free response answers in FullMarket API response (#519) 2022-06-16 15:14:59 -07:00
Sinclair Chen
b99f9dd193 make leaderboard margin same as other pages 2022-06-16 14:43:34 -07:00
Sinclair Chen
8219929227 fix: sidebar wider on medium screens 2022-06-16 14:14:08 -07:00
James Grugett
ecbfed049d Reveal email in admin table 2022-06-16 14:13:08 -05:00
mantikoros
d2a1af7c15 track search, track charity donation 2022-06-16 11:49:57 -05:00
mantikoros
6c6f03e622 fix subtle tabs bug 2022-06-16 11:29:04 -05:00
mantikoros
a15d39110b bug fix: tracking messing with alogolia 2022-06-15 22:17:28 -05:00
mantikoros
f295e0a537 track landing page 2022-06-15 21:42:11 -05:00
James Grugett
b1597c0f24 Figure out a better hack to fake the url on home page. (And fix bug navigating back to home.) 2022-06-15 21:00:30 -05:00
SirSaltyy
6a73dc042c
Update Trending Markets (#513) 2022-06-16 00:05:25 +01:00
James Grugett
0c1ca11304 Don't show unsavedChanges warning if you are submitting new market. 2022-06-15 17:19:16 -05:00
mantikoros
781506129c sign in, sign up button styling 2022-06-15 16:58:52 -05:00
mantikoros
c45da8c334
Tracking (#511)
* tracking helper functions

* track everything

* remove extraneous code
2022-06-15 16:34:34 -05:00
James Grugett
730b7272ce Warn about unsaved changes on create page. 2022-06-15 15:12:16 -05:00
James Grugett
e4f1d7cae1 Change eslint unused var to 'warn' instead of 'error' 2022-06-15 14:48:12 -05:00
James Grugett
cc4b9abd9f Revert "Automated market resolution (#404)"
This reverts commit a3663d03e8.
2022-06-14 23:31:20 -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
TrueMilli
a3663d03e8
Automated market resolution (#404)
* Added radio buttons to market creation (non functional)

* Ignoring vs code files

Should this be done in the repo or should everyone using VS Code do that himself globally on his machine(s)?

* Removed 'automatic' resolution

* added union type for resolution

* revert: resolution could be anything here (non binary markets)

* Expanded ChoicesToggleGroup for string choices

* Added combined resolution and required buttons to market creation

* restricted automatic resolution to binary markets

* added automatic resolution to contract

* added automatic resolution to contract overview

* string or number array to mixed array

* created const for resolutions

* Added comments for leading semicolons

* configuration of auto resolution on market creation

* v1.22.19

* v1.0.0

* v0.0.0

* v1.0.0

* v1.22.19

* Mock display automatic resolution

* Revert changes to market creation

* Revert "v1.22.19"

This reverts commit 22f59adc9c.

* Removed resolutiontype from contract creation

* Added auto resolution time to contract

* Auto resolution date editable

* refactoring

* Editable interface for auto resolution

* New edit interface for auto resolution

* Setting of auto resolve date when changing close date

* prohibited changing other peoples markets

* removed unnecessary export

* refactoring

(cherry picked from commit 4de86d5b08)

* Added comments for leading semicolons

(cherry picked from commit 60739c7853)

* Ignoring vs code files

Should this be done in the repo or should everyone using VS Code do that himself globally on his machine(s)?

(cherry picked from commit 944de9398a)

* removed unused imports and variables

* added type for binary resolution

* Prettier

* const for binary resolutions

* using the type "resolution"

* Prettier

* Re-added comment

* Update functions/src/create-contract.ts

* Revert "Ignoring vs code files"

This reverts commit 09aea5c207.

* launch config for debugging with vs code WIP

* "Launch Chrome" does not work since login via google is not possible in debugger-chrome
* Breakpoints are unbound when attached to chrome

* Revert "Added comments for leading semicolons"

* prettier

* linebreak crlf

* vscode settings

* correct linebreaks
* search exclusion
* automatic prettifier

* vscode settings

* correct linebreaks
* search exclusion
* automatic prettifier

* Working debugger config

* fix merge

* Removed comments, default resolution MKT

* removed vscode from gitignore

* refactoring description update

* Added auto resolution to LiteMarket

* fix date, setDate mutates object

* fixed firestore.rules

* script to add auto resolution to all markets

* regularely auto resolve markets

* fix description error

* moved calculate ts for access in firebase

* Revert "moved calculate ts for access in firebase"

This reverts commit 8380bf4f72.

* fix reference to calculate for firebase

* fixed references to time

* renamed function

* added description

* added auto resolution to description

* direct bool check instead of != null

* direct bool check instead of != undefined

* remove explicit type

* Fix free response markets

* removed contract from functionname

* interval set to 1h

* query instead of filter

* folds ~> contracts

* query instead of filter

* promise.all instead of foreach

* removed contractDoc from function header

* removed autoResolution from function header

* batchedWaitAll instead of promise.all

* removed unused parameter

* replaced auto resolution with constant

* suggestions from PR

* fix comment

* removed unused imports

* added scripts to add close dates on prod

* optimization

* removed test script

* security: only auto resolve markets which are closed

* consistency checks

* re-added type check for binary markets
* moved check of probability into switch case block

* removed unused import

* auto resolution every minute

* auto resolution time optional

* pr fixes
2022-06-14 15:01:32 -05:00
mantikoros
b08cdd495f Revert "Refinement of LiteMarket (#479)"
This reverts commit 9945738811.
2022-06-14 12:06:22 -05:00
SirSaltyy
be777ba122
about button directs to "how to" (#501)
* Create how to manifold.md

* Updates to docs

Updated bounties, added new "How to Manifold" page, edited "About MM" page.

* Update sidebar.tsx
2022-06-14 18:02:21 +01:00
TrueMilli
9945738811
Refinement of LiteMarket (#479)
* split into two function to access the pool value as number

* rename function

* changes to the exported object

* removal of totalLiquidity: this value was only set for binary markets and it's value is identical to getPoolvalue(contract)
* pool: set in the same way as in the "Market Overview" from contract-info-dialog.tsx now
* totalShares: total shares of the contract. It's value is equal to the old "pool" value in case of binary markets

* update docs

* removal of totalShares
2022-06-14 12:01:12 -05:00
mantikoros
0ecff1b581
Heap analytics (#500)
* add heap

* remove hotjar

* prettier formatting conflicting with es lint

* stop weird prettier/eslint conflict
2022-06-14 11:54:58 -05:00
James Grugett
92b368f11e Fix sorting for Your bets table 2022-06-14 11:27:11 -05:00
James Grugett
be094ef8e5 Tweaks to stats page 2022-06-14 10:27:52 -05:00
Ian Philips
e49f614acb
Remove unused acitivity items-related code (#492)
* Remove unused acitivity items

* Remove activity page
2022-06-14 07:13:24 -06:00
Austin Chen
716e00374c Tweak /charity page style 2022-06-13 21:27:20 -07:00
Austin Chen
af3895de79
Add quadratic matching to Manifold for Charity (#486)
* Calculate quadratic funding match

* Tweak copy

* More concise quadratic funding calculation

Co-authored-by: Sinclair Chen <abc.sinclair@gmail.com>

* Fix imports and calculations

* Remove unused var for now

* Clean up styling

Co-authored-by: Sinclair Chen <abc.sinclair@gmail.com>
2022-06-13 20:53:29 -07:00
mantikoros
dd4444caf9 deprecation warning for numeric markets 2022-06-13 21:09:09 -05:00
mantikoros
d9f0428e41 alert box component 2022-06-13 21:08:56 -05:00
mantikoros
64542f775a non-cash-dropping logo gif 2022-06-13 20:32:47 -05:00
James Grugett
dcaddd6a1a Move contract hook back into ContractPageContent. (Fixes going back to home.) 2022-06-13 16:05:46 -05:00
James Grugett
05f1da430c Stats: Use action count of the user who is tenth percentile 2022-06-13 15:51:17 -05:00
mantikoros
e2d7e94e4c prettier 2022-06-13 11:52:29 -05:00
mantikoros
e6a1046039 landing page branding, UI tweaks 2022-06-13 11:22:50 -05:00
mantikoros
a34a32d790 delete old landing page 2022-06-13 11:20:34 -05:00
James Grugett
f3d4827115
Listen for contract updates when navigating from home to contract page. (#494) 2022-06-13 11:04:56 -05:00
Ian Philips
68da02ec00 Fix href is missing query values 2022-06-13 08:42:47 -06:00
Marshall Polaris
72f4a2f603 Fix prettier errors 2022-06-12 21:49:02 -07:00
Marshall Polaris
aaef9842d4 Fix lint error 2022-06-12 21:44:35 -07:00
Marshall Polaris
816fc5d64c Revert "Revert "Turn on no unused variables linting, kill dead code (#484)""
This reverts commit 5beda1ded7.
2022-06-12 21:42:41 -07:00
mantikoros
0d2204bb02 Put "Get M$" in sidebar 2022-06-12 23:34:11 -05:00
mantikoros
246aa5c214 "add funds" => "get M$" 2022-06-12 23:26:05 -05:00
Austin Chen
5beda1ded7 Revert "Turn on no unused variables linting, kill dead code (#484)"
This reverts commit 515928a69a.
2022-06-12 20:55:48 -07:00
Daniel Reeves
4ad04869a1
Typo fix (feedback #697) (#490) 2022-06-12 19:40:02 -07:00
Marshall Polaris
515928a69a
Turn on no unused variables linting, kill dead code (#484)
* Slightly fix up ChoicesToggleGroup

* Kill a bunch of dead code and unused variables

* Turn on no-unused-vars lint

* Un-kill some dead code that James likes
2022-06-12 19:04:55 -07:00
mantikoros
3d39b705ae stats: show market type, payout mechanism 2022-06-12 18:37:01 -05:00
mantikoros
e34d34080d Show liquidity pool; change tab to "Subsidize" 2022-06-12 18:34:18 -05:00
Austin Chen
49bd954945 Rename to "Manifold for Charity" 2022-06-11 09:15:59 -07:00
James Grugett
789c9aa32a Stats: Add chart of the amount of mana bet 2022-06-10 23:44:19 -05:00
James Grugett
457db07da4 Show all answers in answer panel 2022-06-10 23:28:09 -05:00
James Grugett
f4a66263dd Stats: Compute charts for total actions of top tenth of users 2022-06-10 23:22:48 -05:00
Ian Philips
ee816d6552
Must listen to contract updates for probs to update (#482)
* Must listen to contract updates

* remove unused import

* Rename liveContract
2022-06-10 17:36:18 -06:00
Ian Philips
89784bf5eb
Notifications for liquidity proiders/provisions (#478)
* Notifications for liquidity proiders/provisions

* typo

* Rename

* Return default text

* Marke needs resolution notifications

* remove todo
2022-06-10 16:48:28 -06:00
Ian Philips
8bdc33f683 Revert using bet probs, must make totalShares work 2022-06-10 15:58:44 -06:00
Marshall Polaris
9cccc08021
Fix busted comment permalink copying code (#481)
* Fix busted comment permalink copying code

* Fix busted comment permalink href
2022-06-10 14:31:53 -07:00
Ian Philips
f1c3914807
Properly fill probs on DPMM bets (#480)
* Properly fill probs on DPMM bets

* Remove unused import
2022-06-10 15:15:52 -06:00
James Grugett
15882904eb Disallow following yourself via market page 2022-06-10 12:55:55 -05:00
James Grugett
ad1a40ba3e Switch select all to outline button 2022-06-10 12:45:51 -05:00
James Grugett
fba3905724 Creator leaderboard 'Market volume' => 'Total bet' 2022-06-10 12:35:18 -05:00
James Grugett
f2c6c8c483 Change Similar tab to exclude people you follow 2022-06-10 12:28:02 -05:00
James Grugett
a68e943d0b Refactor to load bets once on market page 2022-06-10 12:23:35 -05:00
mantikoros
e28dfaaa80 fix ios scrolling in bet panel 2022-06-10 11:36:07 -05:00
James Grugett
86581a421a Home: Add floating plus button that takes you to /create 2022-06-10 11:22:36 -05:00
James Grugett
25c1e9c3a3 Tweak layout of user page buttons 2022-06-10 11:11:31 -05:00
mantikoros
077bd946ff fix ContractLeaderboard 2022-06-10 11:01:32 -05:00
Ian Philips
ead13b4e08 Time flies when you floor it 2022-06-10 09:15:55 -06:00
Austin Chen
05c6575ebb Extend wasabicharts iframe height 2022-06-09 18:35:38 -07:00
Ian Philips
30eac1bd96 Initial probs = 50 2022-06-09 14:26:46 -06:00
James Grugett
2564eb9c26 Linkify bettor username in Bets tab 2022-06-09 15:00:31 -05:00
Ian Philips
699bddcb2a
Notif ux improvements (#471)
* Save resolved values in notifs

* Clean up

* Various ux improvements
2022-06-09 11:39:23 -06:00
Ian Philips
8634af702a
Save resolved values in notifs (#470)
* Save resolved values in notifs

* Clean up
2022-06-09 10:30:26 -06:00
Ian Philips
64f04185d4 Fix comment inputs on mobile 2022-06-09 10:15:34 -06:00
Ian Philips
bdb3bbd960 Don't open comment w/o new bet 2022-06-09 08:53:01 -06:00
Ian Philips
65bc0f0f86 Disable always autofocus 2022-06-09 07:36:36 -06:00
Ian Philips
3d18b12ede bet.probAfter => getDpmOutcomeProb 2022-06-09 07:22:03 -06:00
James Grugett
f52b756163 Use lighter gray in small follow button to deemphasize 2022-06-08 23:06:25 -05:00
James Grugett
a2eece5f5c Reveal all bets in Bets tab from June 1st onward 2022-06-08 23:03:07 -05:00
Marshall Polaris
5a2ff18859
Add paging to /markets API endpoint (#468)
* Add really simple paging to markets endpoint

* Document changes to markets endpoint

* n -> limit
2022-06-08 18:08:06 -07:00
Ian Philips
01adf50ae1
Update FR comment prob and input after bet (#467)
* Update FR comment prob and input after bet

* Remove comment

* eslint

* Use proper deps and useEvent hook
2022-06-08 17:09:49 -06:00
James Grugett
88bf22622d Fix follow dialog staying open on navigate 2022-06-08 15:51:53 -05:00
James Grugett
c9a4fa8679 Add small follow button after creator name in market page 2022-06-08 15:27:53 -05:00
James Grugett
4e83aa1431 Put back edit following button 2022-06-08 14:42:23 -05:00
James Grugett
f809acd6fd 'Discover' => 'Similar' and shows recs based on user you have open 2022-06-08 14:38:04 -05:00
James Grugett
d7e52c1969 Extract TextButton component with blue underline. 2022-06-08 14:23:10 -05:00
James Grugett
21d6815de1 Don't show follow button for yourself 2022-06-08 14:22:10 -05:00
mantikoros
0cd9943e0d
Liquidity withdrawal (#457)
* withdrawLiquidity cloud function

* update rules

* exclude antes from getCpmmLiquidityPoolWeights

* update correct lp shares

* liquidity panel

* don't create bet if less than 1 surplus share

* withdrawLiquidity return type

* static analysis fix

* hook dependency

* prettier

* renaming

* typo

* getCpmmLiquidityPoolWeights: always exclude antes

* delete unused function

* casting
2022-06-08 13:00:49 -05:00
Ian Philips
45eb5a3e63
Always show notif settings details (#460) 2022-06-08 11:24:07 -06:00
James Grugett
a31766b020 Run prettier... 2022-06-08 11:38:09 -05:00
James Grugett
bc752b853a Prevent comment text overlap with submit button 2022-06-08 11:34:37 -05:00
James Grugett
323a62f041 Put back numbers in home tab titles for categories / following 2022-06-08 11:24:35 -05:00
Ian Philips
61d7f0eca0 No more flying graph points 2022-06-08 09:12:33 -06:00
Ian Philips
936cabe353
Speed up notification loading by prepopulating relevant info (#453)
* Populate notification with relevant info

* eslint

* Remove duplicated code

* Unused ?

* Add new q notification, other small fixes
2022-06-08 08:43:24 -06:00
Ian Philips
7e37fc776c
Fr comment ux improvements (#451)
* Extend comment input box, only use airplane

* Only 1 commentable bet, shrink input, fix feed lines

* Pad sign in to comment button

* Small changes
2022-06-08 07:24:12 -06:00
James Grugett
ad6594f0bc Add discover tab of users based on markets you have bet on 2022-06-07 23:42:42 -05:00
James Grugett
ac763de16b Run prettier! 2022-06-07 23:16:05 -05:00
James Grugett
00cbec2309 Show edit following button on home 2022-06-07 23:07:05 -05:00
James Grugett
66cf69e425 Fix react query console error 2022-06-07 23:06:14 -05:00
James Grugett
879ab272e0
Following and follower list (#456)
* Create following button that opens follow list in modal.

* Move react query deps to web package.json

* UseFollowers hook

* Following and followers button, dialog with tabs.

* Fix line endings

* Remove carriage return from default vscode eol

* Add placeholder message if no users followed / no followers

* Tweak spacing
2022-06-07 22:24:18 -05:00
Marshall Polaris
18044e7302 api/v0/bets -> api/v0/bet 2022-06-07 15:44:07 -07:00
James Grugett
82b189aa48 Don't show numeric bet panel if market closed 2022-06-07 17:03:22 -05:00
Marshall Polaris
244bbc51b2
Migrate sellBet cloud function to v2 sellbet (#438)
* Migrate sellBet to v2

* Kill sellBet warmup requests

* Point client at new v2 sellbet function

* Clean up `getSellBetInfo`

* Fix up functions index.ts
2022-06-07 14:08:56 -07:00
Marshall Polaris
60e830974e
Migrate sellShares cloud function to v2 sellshares (#440)
* Migrate `sellShares` to v2 `sellshares`

* Point client at new v2 sellshares function

* Clean up `getCpmmSellBetInfo`
2022-06-07 13:54:58 -07:00
Austin Chen
2ac7caaf24
Rename /analytics to /stats to work around adblockers (#437)
* Rename /analytics to /stats to work around adblockers

* Fix prettier lint
2022-06-07 08:37:23 -07:00
Ian Philips
4aec46f880 Follow notif groups => Other activity 2022-06-06 16:36:55 -06:00
Ian Philips
85ad343d5d Follow notifications => user profile 2022-06-06 16:30:31 -06:00
Ian Philips
a7a482eecd
Various notifications bugfixes/improvements (#442)
* Various notifications bugfixes/improvements

* eslint
2022-06-06 16:15:36 -06:00
James Grugett
849e7d03a8 Switch to tabs for categories vs following 2022-06-06 14:53:05 -05:00
Marshall Polaris
d9eb9798e5
Point client at new v2 versions of createmarket and placebet (#433)
* Kill 'warmup spam' for createContract and placeBet

* Point v2 function calls at v2 endpoints

* Add real prod placebet and createmarket endpoints
2022-06-06 12:46:06 -07:00
Ian Philips
44b3579cc7 Add tip to see more 2022-06-06 12:01:12 -06:00
James Grugett
caa43856af Run prettier :P 2022-06-06 12:55:13 -05:00
James Grugett
587357c13f Description for categories / users you are following with edit button. 2022-06-06 12:51:45 -05:00
Ian Philips
6aa639591b Minor settings line wording tweaks 2022-06-06 11:46:26 -06:00
Ian Philips
1976bc755e Revert "Revert "Notification detail, grouping, and settings control [wip] (#403)""
This reverts commit 07f2d390e5.
2022-06-06 11:36:59 -06:00
Ian Philips
07f2d390e5 Revert "Notification detail, grouping, and settings control [wip] (#403)"
This reverts commit 37c7f909a3.
2022-06-06 10:54:25 -06:00
Ian Philips
37c7f909a3
Notification detail, grouping, and settings control [wip] (#403)
* Revert "Revert "Notifications ux fixes - wip (#383)""

This reverts commit 699b03eb42.

* Group & provide more control over notification display

* UI/UX improvements

* Remove unused text key

* Refactor

* Refactor

* Show answer resolution in notification

* Disable eslint on single linefor exhaustive deps

* Handle arbritrary notifications

* Refactor

* Remove unused vars

* Add follow user

* Various UX improvements, add follow notif

* Various small ui changes

* Show notification settings breakdown

* Improve notification status lines
2022-06-06 10:52:11 -06:00
James Grugett
773465c6c5 Move select all button to top of category selector modal 2022-06-06 10:44:37 -05:00
mantikoros
43b0fe6749
Contract card ui tweaks: consistent market type colors, no underline,… (#402)
* contract card ui tweaks: consistent market type colors, no underline, adjust font/border size

* bigger probabiity numbers in contract card

* revert non-color changes; change prob bar width to 1.5
2022-06-06 09:54:43 -05:00
Marshall Polaris
e712a054ae Fix line endings 2022-06-05 18:57:49 -07:00
Jack
004dd7168e
Fix free response answers with 0 bets disappearing (#427)
Before this PR, free response answers and their associated comments disappeared when all shares in the answer were sold. If it's just an answer, this is a surprising UX but not that bad. But this can also disappear an entire comment thread with great discussion, as I noticed on one of my markets recently.

I suppose the downside is that these answers take up space and are more likely to be undesired - but I think answers with M$1 of bets are much more common anyway.
2022-06-05 17:20:06 -07:00
James Grugett
a39b1e502c Fix navigate to home not working 2022-06-05 15:45:33 -05:00
James Grugett
96db414ca1
Category checklist (#426)
* Use ChoicesToggleGroup for categories vs following

* Edit categories modal

* Filter closed and resolved using Configure. Set page to 0.

* Add useEvent hook, incase we want to use it before React releases it.

* useMemo on filters computation

* Try to fix prettier

* Use check box! Add select all/none button
2022-06-05 14:06:08 -05:00
James Grugett
3d31641050 Fix clicking card from user profile has no effect 2022-06-04 23:21:24 -05:00
James Grugett
a42a0f086c Remove Row and run prettier 2022-06-04 21:53:55 -05:00
James Grugett
cfd6af7c72 Tweak create page layout 2022-06-04 21:28:27 -05:00
James Grugett
11974f68fc Run prettier 2022-06-04 19:14:14 -05:00
James Grugett
93bb1dd519 Support ctrl or command click to open link in new tab 2022-06-04 19:13:07 -05:00
James Grugett
5152be57ba Quick back from clicking contract card on home! Preserves search state. 2022-06-04 19:00:13 -05:00
James Grugett
cd12628565 Tag page: load sort option from storage 2022-06-04 18:17:32 -05:00
Marshall Polaris
069b88d6fd
Fix API calls to hit emulated Firebase (#424) 2022-06-04 15:19:46 -07:00
Justin
e3eb43a14b
add volume to api response (#413) 2022-06-04 13:33:07 -07:00
Marshall Polaris
f8c44efeba
Small cleanup to some common code (#422)
* Remove unnecessary type helpers

* Turn on unused code lint
2022-06-04 13:30:54 -07:00
Forrest Wolf
b89753e1fe
Add yarn verify script (#378)
* Add yarn check script

* Rename

* Add verify script to subdirectories for convenience
2022-06-03 15:10:14 -07:00
Marshall Polaris
49859e6f00
Call cloud functions directly from web client instead of proxy (#405) 2022-06-03 00:50:24 -07:00
James Grugett
c1bda8a775
Follow other users. Filter markets by followed (#387)
* Add follow button to user page

* Update follows in the database using follow button.

* Add toggle for followed market creators to home

* Hide follow toggle from user's markets page

* Check that sold bet is by auth'd user

* Change follow toggle to category pill

* Remove unused imports

* Remove console.logs
2022-06-02 23:52:14 -05:00
Sinclair Chen
749f7aad40 copyedit: username in bet list empty state 2022-06-02 18:07:47 -07:00
Forrest Wolf
397d90c6b7
Replace some more uses of any with more specific types (#389)
* Give confirmation button icon a type

* Give setBids a type

* Make StripeSession type more specific

* Give MenuButton buttonContent a type
2022-06-02 17:40:41 -07:00
TrueMilli
0f2a311b74
Refactoring (#401)
* refactoring

(cherry picked from commit 4de86d5b08)

* removed unused imports and variables

* added type for binary resolution

* Prettier

* const for binary resolutions

* using the type "resolution"

* Prettier

* Update functions/src/create-contract.ts

* launch config for debugging with vs code
* "Launch Chrome" does not work since login via google is not possible in debugger-chrome
* Breakpoints are unbound when attached to chrome
2022-06-02 17:30:34 -07:00
James Grugett
bbb9a2c1fa Quick bet: Opposite arrow sells position 2022-06-02 18:24:10 -05:00
mantikoros
06c5c97a03 down betting arrow disabled for free response markets 2022-06-02 16:25:41 -05:00
mantikoros
5a4bb65d80 remove extra space (to fix prettier static check) 2022-06-02 16:00:38 -05:00
mantikoros
5af2e1fef0 up arrows green, down arrows red 2022-06-02 15:54:03 -05:00
Austin Chen
5b142baa98 Revert "Demote charity to more menu"
This reverts commit 311b39ffe9.
2022-06-02 13:35:31 -07:00
mantikoros
4fbc7703ce create page: remove numeric markets 2022-06-02 14:27:01 -05:00
Sinclair Chen
e1b1f30c55 make sell button show on mobile (bet list) 2022-06-02 10:56:56 -07:00
James Grugett
311b39ffe9 Demote charity to more menu 2022-06-01 23:31:38 -05:00
Ian Philips
78a359407d
Notifications reverted ux (#386)
* Revert "Revert "Notifications ux fixes - wip (#383)""

This reverts commit 699b03eb42.

* <p>=><div>
2022-06-01 12:26:41 -06:00
Ian Philips
699b03eb42 Revert "Notifications ux fixes - wip (#383)"
This reverts commit b5057f4028.
2022-06-01 11:52:27 -06:00
Ian Philips
b5057f4028
Notifications ux fixes - wip (#383)
* Notifications generating on comment,answer,contract update

* Notifications MVP

* Submitted an answer => answered

* Listen for unseen notifications

* Fix userlink formatting, move page

* Fix links

* Remove redundant code

* Cleanup

* Cleanup

* Refactor name

* Comments

* Cleanup & update notif only after data retrieval

* Find initial new notifs on user change

* Enforce auth rules in db

* eslint update

* Code review changes

* Refactor reason

* Add todos

* Show question in notifiation title

* Allow larger width on md

* Condense on mobile

* Decrease padding, hide title on mobile

* Line clamp notifications

* Shrink text
2022-06-01 11:31:46 -06:00
TrueMilli
29a09ad276
Made an actual comment (#384) 2022-06-01 10:20:45 -07:00
James Grugett
2c4aa6152e Hide sell buttons in other people's profiles 2022-06-01 11:28:47 -05:00
Ian Philips
59830579a9
Set timeout to reset the free market banner (#367)
* wip - trigger recheck when past time

* wip - trigger recheck when past time

* Reset logic

* Interval=>timeout
2022-06-01 07:54:48 -06:00
Ian Philips
1c980ba678
Notifications (#354)
* Notifications generating on comment,answer,contract update

* Notifications MVP

* Submitted an answer => answered

* Listen for unseen notifications

* Fix userlink formatting, move page

* Fix links

* Remove redundant code

* Cleanup

* Cleanup

* Refactor name

* Comments

* Cleanup & update notif only after data retrieval

* Find initial new notifs on user change

* Enforce auth rules in db

* eslint update

* Code review changes

* Refactor reason
2022-06-01 07:11:25 -06:00
Marshall Polaris
35c373f6ce
MULTI contracts are not a thing (#381) 2022-05-31 20:40:08 -07:00
James Grugett
dec286583a Show bets loading indictor instead of wrong data 2022-05-31 22:21:45 -05:00
Marshall Polaris
9f1fe3ee17
Fix busted avatar links on charity pages (#380) 2022-05-31 20:02:50 -07:00
Marshall Polaris
7c4ec2a8e3
Refactor contract typing to be more concise and more correct (#355)
* Refactor contract types slightly

* Refactor contract types greatly

* Kill dead binary DPM contract creation code

* Use BinaryContract, DPMContract, etc. type aliases
2022-05-31 19:42:35 -07:00
Forrest Wolf
30adb5e1f8
Fix dependency of useEffect in BetsList (#379)
* Fix dependency of useEffect in BetsList

* Revert "Fix dependency of useEffect in BetsList"

This reverts commit 077b211f22.

* Disable linter for BetsList useEffect deps

* Add hideBetsBefore to useEffect dependencies

* Fix formatting
2022-05-31 21:36:00 -05:00
James Grugett
9cb24c9f3c Make categories work when signed out 2022-05-31 21:23:36 -05:00
James Grugett
b236ebdbd9 Fix janky horizontal scrollbar on home on mobile 2022-05-31 20:07:28 -05:00
Austin Chen
a840143990 Publicly display bets without infinite looping
React why
2022-05-31 18:06:29 -07:00
Sinclair Chen
c8bf71d40d
Allow selling CPMM binary position from bet table (#372)
* Allow selling CPMM binary position from bet table

* Only click to collapse on bet header, not body
2022-05-31 17:36:58 -07:00
Sinclair Chen
3d9d60e8fe refactor Row, Col to accept all div props 2022-05-31 17:13:54 -07:00
Sinclair Chen
6106eeee95 copyedit: donations available after May 2022-05-31 13:23:01 -07:00
James Grugett
5bcff4171b Revert "Publicly display bets placed after 06-01-2022"
This reverts commit a4330cfdf2.
2022-05-31 14:15:26 -05:00
Austin Chen
a4330cfdf2 Publicly display bets placed after 06-01-2022 2022-05-31 10:49:07 -07:00
Austin Chen
3bc4e7b336 Embed @wasabipesto's charts on /analytics 2022-05-31 08:32:11 -07:00
Austin Chen
5978f4b1cb Show blog link in sidebar 2022-05-29 17:33:41 -07:00
James Grugett
23944bf47a Filter redemption bets out of market 'Bets' tab 2022-05-28 15:57:12 -05:00
James Grugett
90a8de09d7 Ask a question => Create a question 2022-05-28 15:48:08 -05:00
James Grugett
4c81106612 Don't show quick bet when signed out, or for numeric markets 2022-05-28 15:36:16 -05:00
James Grugett
29a05ffff2 Disable quick bet for resolved markets 2022-05-28 15:27:01 -05:00
Marshall Polaris
c3a5205d8e
Use cross-env for things that set environment variables (#359) 2022-05-28 13:21:05 -07:00
James Grugett
45f92379bc Portfolio: Fix calculation of whether you sold all your shares 2022-05-28 00:18:09 -05:00
Austin Chen
2ea7ddc1aa Hide mobile bottom bar if Manifold is iframed 2022-05-27 21:27:37 -07:00
Marshall Polaris
86625798cd
Clean up some mess related to nullable collectedFees (#352)
* contract.collectedFees is no longer sometimes nonexistent

* Fix typing issues around payouts code
2022-05-27 14:02:02 -07:00
James Grugett
279b139556 Add 'sold' filter option in portfolio page 2022-05-27 15:51:55 -05:00
James Grugett
15d203977a Portfolio: Consistently filter out contracts you have sold out of. 2022-05-27 15:40:52 -05:00
Forrest Wolf
1e0845f4b9
Replace some uses of any with more specific types (#344)
* Add tsconfig.json for common

* Prefer `const` over `let` over `var`

* Kill dead code

* Fix some trivial Typescript issues

* Turn on Typescript linting in common except for no-explicit-any

* Correctly specify tsconfig dir name in functions eslintrc

* Give react children explicit types

* Add explicit types to removeUndefinedProps

* Create StripeSession type

* Give event in Dropdown an explicit type

* Revert "Give event in Dropdown an explicit type"

This reverts commit 80604310f2.

* Give bids in NewBidTable an explicit type

* Cast results of removeUndefinedProps when neccessary

* Fix type of JoinSpans

* Revert "Cast results of removeUndefinedProps when neccessary"

This reverts commit 5541617bc8.

* Revert "Add explicit types to removeUndefinedProps"

This reverts commit ccf8ffb0b5.

* Give React children types everywhere

* Give event a type

* Give event correct type

* Lint

* Standardize React import

Co-authored-by: Marshall Polaris <marshall@pol.rs>
2022-05-26 15:22:44 -07:00
Marshall Polaris
420ea9e90e
Add more linting to web package (#343)
* Import React a lot

* Fix misc. linting concerns

* Turn on many recommended lints for `web` package
2022-05-26 14:41:24 -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
mantikoros
7b0be014eb show resolved n/a for numeric markets 2022-05-26 09:39:14 -05:00
Ian Philips
6f23c16df7 Show up arrow if shares in numeric markets 2022-05-26 06:23:22 -06:00
Sinclair Chen
38fa58406d Fix embeds on incognito (blocked localStorage) 2022-05-25 22:30:03 -07:00
Austin Chen
eb68d059e2 Extend analytics to 90 days 2022-05-25 19:22:50 -07:00
Marshall Polaris
b8b1c0d056
Add tsconfig, more linting to common package (#324)
* Add tsconfig.json for common

* Prefer `const` over `let` over `var`

* Kill dead code

* Fix some trivial Typescript issues

* Turn on Typescript linting in common except for no-explicit-any

* Correctly specify tsconfig dir name in functions eslintrc
2022-05-25 17:12:36 -07:00
Ian Philips
0c3fa9f065
Handle free response outcomes for yes/no shares (#338) 2022-05-25 16:51:33 -06:00
Ian Philips
1334840ee0
Fix comment links from /activity & add to emails (#320) 2022-05-25 16:47:08 -06:00
Ian Philips
f0d44be2f4 Clean up time diff code 2022-05-25 16:04:14 -06:00
Ian Philips
f3be3b1f3c Maybe free market countdown will work now, beats me 2022-05-25 15:55:50 -06:00
Ian Philips
d117ff600a Adjust spacing on % input 2022-05-25 12:47:44 -06:00
Ian Philips
959ee5f8d1
Improve create market UI (#336)
* Move to tailwindui

* Remove commented code

* Prettier

* Show custom prob toggle, limit to 5-95%

* match left margin

* Show prob, date, time, other ui changes

* fix for firefox
2022-05-25 12:13:51 -06:00
Ian Philips
d69f4f9a0a
Move to tailwindui for create market page (#332)
* Move to tailwindui

* Remove commented code

* Prettier

* Show custom prob toggle, limit to 5-95%

* match left margin

* Show prob, date, time, other ui changes
2022-05-25 11:54:28 -06:00
James Grugett
92df092ad3 Fix DOM error in console 2022-05-25 11:48:37 -05:00
Forrest Wolf
c5763e6ec3
Extract signup prompt (#333)
* Extract SignUpPrompt component

* Return null instead of false when not showing SignUpPrompt

* Add trailing newline

* Lint
2022-05-25 09:25:39 -07:00
Ian Philips
1942e1c47a
Show just first 3 letters and chosen answer on fr cards (#318)
* Show just first 3 letters and chosen answer

* 3 dots

* Just show resolved and the chosen answer

* Remove unused truncate & hide resolved except on xs
2022-05-25 07:13:33 -06:00
Austin Chen
eef5dda0f3 Shrink card margin between question & % 2022-05-24 17:25:23 -07:00
Austin Chen
d5a362502a Display liquidity "pool" instead of "bet" volume 2022-05-24 16:57:34 -07:00
Austin Chen
8715ff2740 Semibold the question on cards 2022-05-24 16:39:50 -07:00
Austin Chen
f9336c00be
Preview the quick bet result on hover (#319)
* Switch from triangle to a circle arrow

WIP

* Revert "Switch from triangle to a circle arrow"

This reverts commit 370f8eefe4.

* Show amount moved in probability

* Animate the prob bar change too

* Pull out quick bet display component

* Minor cleanups

* Clean up comments

* Close empty divs

* Feedback from Ian

* Pull out constant

* Get rid of quick bet separators

* Fix typescript change

* Invert colors so gray indicates placed bets

* Update comment on useSaveShares re: Ian's comments
2022-05-24 16:38:43 -07:00
Marshall Polaris
2d8ad40e70
Add outcome type to API market descriptors (#325) 2022-05-24 14:31:49 -07:00
mantikoros
c3be126337
Revert "Update leaderboards.tsx (#314)" (#317)
This reverts commit d19d60eb6a.
2022-05-24 09:31:42 -05:00
Ian Philips
811a7cece7 Market => question 2022-05-24 08:28:09 -06:00
Ian Philips
49bfb67daa Revert to showing FR answer 2022-05-24 08:24:01 -06:00
Ian Philips
13bf5ac253 Free daily market bugfix 2022-05-24 07:31:44 -06:00
SirSaltyy
d19d60eb6a
Update leaderboards.tsx (#314)
Renamed top creators header from "market volume" to "market liquidity".
2022-05-24 14:05:12 +01: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
Austin Chen
a8e47d4fc7 Update "No markets found" to point to /create
Fixes #308
2022-05-23 17:49:07 -07:00
Ian Philips
fc320ca1e4
Shrink avatar, paddding, gaps for mobile screens (#275)
* Shrink avatar, paddding, gaps for mobile screens

* Adjust padding, add arrow to input area

* Padding and reply ui adjustments
2022-05-23 16:09:40 -06:00
mantikoros
854daaebb7 nav bar: gray background for selected page (indigo color was too prominent) 2022-05-23 16:49:30 -05:00
mantikoros
244fd7c981 changed sidebar button color — violet doesn't match color scheme 2022-05-23 16:38:42 -05: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
Ian Philips
fb33f829cc Clean up free market countdown bugfix 2022-05-23 15:14:50 -06:00
Ian Philips
0f01753795 Daily free market countdown fix 2022-05-23 11:26:17 -06:00
Ian Philips
d0347ff5c2
Add countdown timer for daily free market (#276)
* Add countdown timer for daily free market

* Reset example numbers

* Remove daily

* Free market reset => 4pm UTC
2022-05-23 08:43:11 -06:00
Ian Philips
355b2261a7 Show numeric bet panel between sm-xl 2022-05-23 08:04:55 -06:00
Ian Philips
e94d204a87
Simplify market creation page (#268)
* Simplify market creation page

* Minor improvements

* Prettier
2022-05-23 06:35:50 -06:00
James Grugett
fc6b36b690 Adjust numeric graph axis to use large number formatting 2022-05-22 22:05:52 -05:00
James Grugett
21527275d1 Fix numeric market embeds 2022-05-22 22:03:05 -05:00
James Grugett
1c73bba908 Show x value in numeric graph's tooltip 2022-05-22 17:48:02 -05:00
James Grugett
f85b10e517 Exclude partial day from analytics 2022-05-22 17:35:10 -05:00
Marshall Polaris
73d538c7cf
Modularize imports of hero icons in compiler (#292) 2022-05-22 12:40:34 -07:00
Marshall Polaris
d072216d2d
Kill /about page (#293) 2022-05-22 12:40:16 -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
3db1de6b66
Add some useEffect dependencies (#289) 2022-05-21 14:48:15 -07:00
James Grugett
c5660ab762 Prevent flash of "No markets found" on search load 2022-05-21 13:51:41 -04:00
James Grugett
688ebb797a Add "Last updated" sort option 2022-05-21 13:44:55 -04:00
Marshall Polaris
540476f65a
Public API improvements (#266)
* Remove needless wrappers from API requests and responses

* Return real HTTP status codes instead of status field

* More robustly handle API errors

* Fix broken error handling in NumericResolutionPanel warmup
2022-05-20 14:58:14 -07:00
Austin Chen
03a13248a4 Limit large numbers to 3 sig figs 2022-05-20 15:25:32 -04:00
Austin Chen
52ad4c42b0 Persist homepage sort 2022-05-20 15:08:00 -04:00
Austin Chen
4c93da3cc0 Use a blue bar for Numeric types 2022-05-20 14:00:22 -04:00
Austin Chen
5d96fdafd6 Add padding to homepage 2022-05-20 13:53:12 -04:00
mantikoros
6f1a569797 back to M$ — the worst option except for all the others 2022-05-19 22:28:38 -04:00
James Grugett
1616ffc817 Make filter for isResolved work in all cases 2022-05-19 22:13:58 -04:00
mantikoros
99c41b6112 bug fix: use new placeBet api in numeric bet panel 2022-05-19 20:39:23 -04:00
Sinclair Chen
4c7836abc7
Show embed view of normal market links in iframes (#254) 2022-05-19 17:34:08 -07:00
Marshall Polaris
20f4b97d8b
Rewrite client for new public APIs to use fetch instead of callables (#241)
* Rename `lib/firebase/api-call` -> `lib/firebase/fn-call`

This relieves ambiguity now that we will be using our actual
public API in the client.

* Rewrite client API calls to createContract, placeBet

* Tiny fixup for client market creation code
2022-05-19 15:04:34 -07:00
James Grugett
d4a49789d1 Add daily signups 2022-05-19 17:13:30 -04:00
James Grugett
a275b3a9c2 Fix analytics 2022-05-19 16:53:49 -04:00
James Grugett
4396456ed1 Add tooltip to analytics charts 2022-05-19 16:14:27 -04:00
mantikoros
be3d4d7735 exclude antes from bets list 2022-05-19 15:26:44 -04:00
James Grugett
76f27d1a93
Numeric range markets!! (#146)
* Numeric contract type

* Create market numeric type

* Add numeric graph (coded without testing)

* Outline of numeric bet panel

* Update bet panel logic

* create numeric contracts

* remove batching for antes for numeric markets

* Remove focus

* numeric market range [1, 100]

* Zoom graph

* Hide bet panels

* getNumericBets

* Add numeric resolution panel

* Use getNumericBets in bet panel calc

* Switch bucket count to 100

* Parallelize ante creation

* placeBet for numeric markets

* halve std of numeric bets

* Update resolveMarket with numeric type

* Set min and max for contract

* lower std for numeric bets

* calculateNumericDpmShares: use sorted order

* Use min and max to map the input

* Fix probability calc

* normpdf variance mislabeled

* range input

* merge

* change numeric graph color

* fix getNewContract params

* bet panel labels

* validation

* number input

* fix bucketing

* bucket input, numeric resolution panel

* outcome label

* merge

* numeric bet panel on mobile

* Make text underneath filled green answer bar selectable

* Default to 'all' feed category when loading page.

* fix numeric resolution panel

* fix numeric bet panel calculations

* display numeric resolution

* don't render NumericBetPanel for non numeric markets

* numeric bets: store shares, bet amounts across buckets in each bet object

* restore your bets for numeric markets

* numeric pnl calculations

* remove hasUserHitManaLimit

* contrain contract type

* handle undefined allOutcomeShares

* numeric ante bet amount

* use correct amount for numeric dpm payouts

* change numeric graph/outcome color

* numeric constants

* hack to show correct numeric payout in calculateDpmPayoutAfterCorrectBet

* remove comment

* fix ante display in bet list

* halve bucket count

* cast to NumericContract

* fix merge imports

* OUTCOME_TYPES

* typo

* lower bucket count to 200

* store raw numeric value with bet

* store raw numeric resolution value

* number input max length

* create page: min, max to undefined if not numeric market

* numeric resolution formatting

* expected value for numeric markets

* expected value for numeric markets

* rearrange lines for readability

* move normalpdf to util/math

* show bets tab

* check if outcomeMode is undefined

* remove extraneous auto-merge cruft

* hide comment status for numeric markets

* import

Co-authored-by: mantikoros <sgrugett@gmail.com>
2022-05-19 12:42:03 -05:00
Ian Philips
7d8ccb78a4
Remove unused bets (redemptions, antes) and sort by desc in query (#264)
* Remove unused bets and sort in query

* remove console

* Explicitly ignore or include redemptions

* Pass options from parent function

* Fix let=>const
2022-05-19 10:03:37 -06:00
Ian Philips
8013862f15 Center question button on lg 2022-05-19 09:20:38 -06:00
Ian Philips
6935f8865d Move comment btn to its own row on xs 2022-05-18 21:34:59 -06:00
Ian Philips
e6dabf97d9
Show prob at time of comment on binary markets (#255)
* Show prob at time of comment on binary markets

* unused import
2022-05-18 19:38:02 -06:00
James Grugett
6a30a41b10 Make analytics show data up to current hour 2022-05-18 18:53:53 -04:00
James Grugett
e9ee7e2355 Truncate user link 2022-05-18 17:08:46 -04:00
James Grugett
1f3f800a57 Show close time in cards on close date sort 2022-05-18 17:08:46 -04:00
Ian Philips
6d3aaf71d4 Any question => anything 2022-05-18 13:47:53 -06:00
Sinclair Chen
e2b03f31e9 Style current page on mobile nav bar 2022-05-18 15:45:08 -04:00
Ian Philips
daf6cadea9 Remove border from sidebar buttons 2022-05-18 10:52:00 -06:00
Austin Chen
7b3c8ea046 Revert "back to M$ — playtime is over"
This reverts commit ed41d99484.
2022-05-18 12:09:24 -04:00
Ian Philips
ca9e93fe47 Show loading indicator on comment submit 2022-05-18 10:08:42 -06:00
Austin Chen
f17675bbcf Fix typo 2022-05-18 12:07:36 -04:00
Austin Chen
44c53ae96d Kill the ugly "Sign in" button 2022-05-18 12:06:41 -04:00
Austin Chen
89b05be5ec Tweak "Ask a question" button VisD 2022-05-18 11:57:22 -04:00
Austin Chen
39870dd933
Bets on profile, again (#251)
* Revert "Revert "Show every user's bets on their profile (#170)""

This reverts commit 142206b79a.

* Fix typo

* Delete portfolio page
2022-05-18 11:52:12 -04:00
Ian Philips
eb3ac802c0 Fix #208 - check for comments without ids 2022-05-18 09:35:32 -06:00
Ian Philips
974d5a8d89 hide free daily market when signed out 2022-05-18 09:25:56 -06:00
James Grugett
142206b79a Revert "Show every user's bets on their profile (#170)"
This reverts commit d50cc39c27.
2022-05-18 10:59:08 -04:00
James Grugett
d51a20e2e0 Add back useState to import 2022-05-18 10:57:45 -04:00
James Grugett
acd59767e4 Move search and sort/filter options in one line on mobile 2022-05-18 10:42:56 -04:00
Boa
7b3c21cf98
Comments ux improvements and bugfixes (#246)
* Show majority stake on comments

* Darken comment input text

* Fix old FR comments displayed in general section

* Refactor feed comments and bets into files

* Only allow user to comment on most recent bet

* Fix overlapping sign in to comment

* Only calculate current users bets once

* Minor tweaks & is betting @ prob
2022-05-18 08:42:13 -06:00
Austin Chen
d50cc39c27
Show every user's bets on their profile (#170)
* Show user bets on their profile

* Add an alert for current users

* Replace `/portfolio` with `/Austin?tab=Bets`

* Replace `/Austin?tab=Bets` with `/Austin/bets`

* Use replaceState for better browser history

* Remove two console.logs

* Note a bug

* Fix path

* Write in description of why we're doing this
2022-05-18 10:36:17 -04:00
mantikoros
42c981a54d remove border on ask question button 2022-05-18 10:21:03 -04:00
James Grugett
76ffe8eea1 Infinite scroll: automatically load new page of results 2022-05-17 19:29:46 -04:00
James Grugett
be9df7bcd8 Fix links beginning with https 2022-05-17 17:11:24 -04:00
mantikoros
ed41d99484 back to M$ — playtime is over 2022-05-17 15:34:58 -04:00
James Grugett
7da46050e5
Swap home and explore (#244)
* Add activity page. Copy explore page into home

* Update navbar with activity. Show explore instead if signed out.

* Move category selector into contract search

* Make algolia filter by category

* Default tag page to all filter
2022-05-17 12:56:10 -05:00
Sinclair Chen
1bf2073e61
refactor SiteLink to not repeat (#125) 2022-05-17 10:36:36 -07:00
Sinclair Chen
f8601af45c
Bet embed (#204)
* Add bet buttons to embed

- Make only title link to market
- Prevent avatar / username from being clicked on

* refactor: remove extra elem, de-indent

* adjust embed info row styles

* make bet panel smaller

* make sell panel smaller
2022-05-17 10:31:19 -07:00
Ian Philips
d458d8a299 Includes=>endsWith for multi digit answers 2022-05-17 10:13:29 -06:00
Ian Philips
ef98c16c26 Created contrac today => true to avoid free market flash 2022-05-17 10:06:00 -06:00
mantikoros
b98468c7ea show none option in categories 2022-05-17 12:02:46 -04:00
Ian Philips
1afda07525 Handle linking from feed 2022-05-17 10:00:09 -06:00
Boa
8337cb251f
Enable url linking to comments and a copy to clipboard function [wip] (#239)
* Link to comments & highlight comment

* Copy link, show toast and fade bg

* Remove unused imports

* Standardize link copied toast

* Add linking to answer comment threads

* Refactor open answers component, use indigo highlight

* Distinguish chosen answer a bit more
2022-05-17 09:55:26 -06:00
mantikoros
5310da05e2 fix double hashtag 2022-05-17 11:49:10 -04:00
mantikoros
2858fd090c "create market" => "ask question" 2022-05-17 11:32:20 -04:00
mantikoros
14ce820dcb cache deservesDailyFreeMarket locally 2022-05-17 11:32:10 -04:00
mantikoros
f47d75c120 landing page tweaks 2022-05-17 10:25:51 -04:00
mantikoros
4860150334 change slogan 2022-05-17 10:02:29 -04:00
Austin Chen
a3c1cd2cc1 Unhardcode M$ in more locations 2022-05-17 08:17:22 -04:00
Austin Chen
8982dcae10 Replace "m1234" with "ϻ1234" 2022-05-17 08:13:12 -04: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
aafd2a226f
Clean up some stuff with SellPanel and AmountInput (#232)
* Hoist SellAmountInput logic into SellPanel

* Ditch now-unnecessary SellAmountInput

* Clean up sale proceeds markup

* Clean unused imports

* BuyPanel doesn't need userBets
2022-05-16 20:27:37 -07:00
Austin Chen
6c6cbdc1a5
Redesign the contract card (#235)
* Redesign the card

* Limit to 1 category on a card

* Make card tags a lighter gray

* Righbar always starts from the bottom
2022-05-16 19:15:22 -04: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
Marshall Polaris
72b21925e5
Allow users to generate an API key in their profile (#182)
* Add /private-users/apiKey to DB

* Add field to edit API key on profile

* Move API key to bottom of profile page

Austin thinks this is better since most people don't care about it.
2022-05-15 20:41:07 -07:00
James Grugett
19da0c6c82 Default to 'all' feed category when loading page. 2022-05-15 23:09:49 -04:00
James Grugett
727d85ddac Make text underneath filled green answer bar selectable 2022-05-15 23:07:38 -04:00
Marshall Polaris
ee91a94466
Clean up some bet panel markup and CSS (#231)
* Tidy up probability change markup

* Tidy up payout markup
2022-05-15 14:10:26 -07:00
James Grugett
c85b806bc1 Change analytics to 45 days instead of 90 to fix timeout 2022-05-15 15:50:28 -04:00
Marshall Polaris
07ded756d9
Remove unused imports from random files (#224) 2022-05-13 18:30:52 -07:00
Marshall Polaris
bc5cd5be45
Clean up some markup in the sidebar (#220)
* Remove wrapper div around logo

* Small refactor, remove wrapper around sidebar profile summary

* Remove random unused imports

* Replace random styles with Tailwind classes
2022-05-13 18:07:44 -07:00
Marshall Polaris
33c0471c29
Clean up some markup around the top of the page (#189)
* Remove unnecessary wrapper div around sidebar

* Remove extra column used for alignment on homepage

* Remove extra wrapper div around whole page
2022-05-13 16:47:50 -07:00
Marshall Polaris
babca140f1
Fix random errors (#205)
* Fix warning in ShareMarket component

* Fix NewContract component to use keys on category list

* Refactor NewContract component to assign `value` to `select`
2022-05-13 16:42:48 -07:00
James Grugett
8be6b79732 Remove 'Category' label 2022-05-13 16:19:15 -04:00
James Grugett
8ce3a09471 Shrink vertical padding on feed answer group 2022-05-13 16:16:46 -04:00
James Grugett
e660acab56 Put back hotjar code, but deactivate from hotjar site 2022-05-13 15:07:32 -04:00
James Grugett
67717bbde7 Prevent having to go back twice from profile / tag search page 2022-05-13 15:01:38 -04:00
James Grugett
b195dcdfd2 Print build info only once 2022-05-13 14:33:02 -04:00
James Grugett
5f59623be8 Disable hotjar 2022-05-13 14:31:03 -04:00
James Grugett
d62156b8c0 Hide scrollbar on categories 2022-05-13 14:27:47 -04:00
Austin Chen
805a997ba0 Fix hotjar typo
Copy+pasting is hard >.>
2022-05-13 10:59:47 -04:00
Austin Chen
bf07b45467 Add id to hotjar script
Apparently needed by NextJS
2022-05-13 10:49:01 -04:00
Austin Chen
c99cf7579b Try out Hotjar 2022-05-13 10:11:57 -04:00
James Grugett
06cdf2a84a
Show category on market card (#197)
* Show category on market card

* Show multiple categories in contract description

* Tweak layout of contract card and show multiple categories
2022-05-12 18:28:21 -05:00
Austin Chen
e0d266887c
Show prob of FR answer as a bar chart (#200) 2022-05-12 14:04:51 -04:00
Austin Chen
25d3fbcc5f Add a hover to the category selector 2022-05-12 13:47:07 -04:00
Ian Philips
c2f8aee89e Touch up reply buttons 2022-05-12 10:27:52 -06:00
James Grugett
aafc08f24c Prevent android chrome from defining categories on tap 2022-05-12 12:07:46 -04:00
Ian Philips
fed49d3040 Hide ante in FR bets tab 2022-05-12 09:48:19 -06:00
James Grugett
31f57f8ff2 Condense category names to just the tag name 2022-05-12 11:18:44 -04:00
James Grugett
49f900b298 Tags input: save on enter 2022-05-12 11:13:35 -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
Boa
403156ed1a
FR ux changes, restore submit button for comments (#195) 2022-05-12 08:59:05 -06:00
James Grugett
696e6a7882 Revert "Fix hyperlinks when starting with an open paren"
This reverts commit 2fd9759bc1.
2022-05-11 21:42:33 -04:00
Marshall Polaris
1063897c7c
Clean up extra wrapper and CSS on BetRow (#178) 2022-05-11 14:35:50 -07:00
Boa
02ed9bf7e1
Single threaded comments (#175)
* Remove unused hideOutcome in comments

* Remove unused hideOutcome in comments

* Add replyToComment fields to Comment

* Add 1 threaded replies to comments & answers

* Allow smooth scrolling within pages via #

* remove yarn-error log

* correct spelling

* Remove smooth-scroll-to-hashtag component

* Cleanup & show user position/bets in replies
2022-05-11 15:11:46 -06:00
Sinclair Chen
aa433e309c
restyle home page (separation between markets) (#186) 2022-05-11 12:51:45 -07:00
Austin Chen
2fd9759bc1 Fix hyperlinks when starting with an open paren 2022-05-11 15:28:28 -04:00
James Grugett
2b9e639281 Default to 'all' search filter for markets on user page 2022-05-11 00:19:29 -04:00
Marshall Polaris
b55e807c62
Truncate multi-line commit messages in console build info (#180) 2022-05-10 21:12:00 -07:00
Marshall Polaris
22c594eb79
Print out build info in console (#179)
* Print out build info in console

* Fix up build info printing per feedback
2022-05-10 20:57:09 -07:00
James Grugett
948d878222 Prevent 500 error on markets with no collected fees 2022-05-10 23:01:07 -04: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
6c9df223d8
Feed container markup cleanup (#173)
* Move FeedContainer stuff into ActivityFeed

* Greatly clean up ActivityFeed container markup
2022-05-10 13:59:19 -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
Sinclair Chen
a297f6492d
move manaToUSD to format.ts (#172) 2022-05-10 11:14:24 -07:00
Austin Chen
b97301c6fa Hardcode two new frontpage markets 2022-05-10 13:03:53 -04:00
mantikoros
264e5058ea
Separate out fees (#169)
* deduct market ante from profits

* display creator fees in stats

* show creator earnings in stats

* separate out creator, liquidity fees in payouts and deduct from profits

* include creator payout in resolution emails

* deduct liquidity from profits

* hide cost tooltip if daily free market
2022-05-10 08:49:14 -05:00
Marshall Polaris
d34907681a
Remove some random unnecessary wrapper divs (#163)
* Remove wrapper div in user comment feed item

* Remove wrapper div around feed market card title link

* Remove wrapper div around BetRow
2022-05-09 15:50:20 -07:00
mantikoros
ef43e46153 include fees in tooltip 2022-05-09 17:33:24 -04:00
Marshall Polaris
8a99f3772a
Cleanup avatar again (#161)
* Reinstate avatar component cleanup

This was reverted due to a bug, fixed in the subsequent commit.

* Kill additional wrapper divs around avatars

This also fixes a bug where the `w-8` answer row wrapper div was
constraining the width of the `w-10` avatar, leading it to be `w-8`
and `h-10` and appear as an oval.
2022-05-09 14:32:59 -07:00
mantikoros
5135135e79
Separate out fees (#159)
* deduct market ante from profits

* display creator fees in stats

* show creator earnings in stats

* separate out creator, liquidity fees in payouts and deduct from profits
2022-05-09 16:04:40 -05:00
Boa
a5b0372a6e
Free response markets with investment cap (#157)
* Show error message for FR bet

* Allow M$ limit for markets

* Allow M$ limit for markets

* Apply M$ limit to FR answer bets

* Improve error message

* Improve error message

* Only check stats if mana limit set

* Consolidate logic

* Remove unused variable

* absolute import

* absolute imports
2022-05-09 14:09:07 -06:00
James Grugett
d55990d5d4 Fix contract search not adjusting to new user 2022-05-09 15:47:18 -04: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
Ian Philips
8fbbeffd38 Revert one more avatar component change 2022-05-09 10:33:52 -04:00
Ian Philips
5c1bc78408 Revert avatar component changes 2022-05-09 10:18:05 -04:00
Marshall Polaris
acc9c84e2e
More absolute imports (#156)
* Configure functions module to allow absolute imports

* Convert common imports in functions to be absolute

* Convert common imports in web to be absolute

* Convert lib imports in web to be absolute

* Convert hooks imports in web to be absolute

* Convert components imports in web to be absolute
2022-05-09 09:04:36 -04:00
Marshall Polaris
dd2366458d
Fix up target in web tsconfig (#155) 2022-05-08 23:57:29 -07:00
Austin Chen
b47e4364ad Remove circle around markets/comments count 2022-05-08 22:53:02 -04:00
Marshall Polaris
5efcf61289
Configure compiler to allow absolute imports from root (#147) 2022-05-08 13:33:58 -07:00
Austin Chen
2eed1c432a Hardcode in 8 frontpage markets 2022-05-07 19:44:01 -04:00
Austin Chen
cea9422802 Update site copy 2022-05-07 10:10:25 -04:00
Austin Chen
22a9901148 Feature Nonlinear as a charity 2022-05-07 08:15:40 -04:00
James Grugett
4de0fcd198 Revert "Represent DB avatar URLs as non-null (#128)"
This reverts commit bf8e09b6c1.
2022-05-06 14:29:15 -04:00