Commit Graph

1104 Commits

Author SHA1 Message Date
Ian Philips
3ff8b26312 Remove category selector references 2022-07-07 14:55:28 -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
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
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
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
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
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
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
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
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
Austin Chen
7bbc425690 Only show "My Groups" when there is at least 1 group 2022-06-29 17:54:08 -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
James Grugett
4107d5fedb Fix weird layout on refreshing create page 2022-06-27 14:40:40 -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
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
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
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
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
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
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
Justin
4ea7b6692a
add resolutionProbability to LiteMarket (#546) 2022-06-22 15:28:11 -07: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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
f4a66263dd Stats: Compute charts for total actions of top tenth of users 2022-06-10 23:22:48 -05: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
James Grugett
fba3905724 Creator leaderboard 'Market volume' => 'Total bet' 2022-06-10 12:35:18 -05:00
James Grugett
a68e943d0b Refactor to load bets once on market page 2022-06-10 12:23:35 -05:00
James Grugett
86581a421a Home: Add floating plus button that takes you to /create 2022-06-10 11:22:36 -05:00
mantikoros
077bd946ff fix ContractLeaderboard 2022-06-10 11:01:32 -05: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
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
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
45eb5a3e63
Always show notif settings details (#460) 2022-06-08 11:24:07 -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
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
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
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
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
a39b1e502c Fix navigate to home not working 2022-06-05 15:45:33 -05:00
James Grugett
cfd6af7c72 Tweak create page layout 2022-06-04 21:28:27 -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
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
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
mantikoros
4fbc7703ce create page: remove numeric markets 2022-06-02 14:27:01 -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
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
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
James Grugett
9cb24c9f3c Make categories work when signed out 2022-05-31 21:23:36 -05:00
Sinclair Chen
6106eeee95 copyedit: donations available after May 2022-05-31 13:23:01 -07:00
Austin Chen
3bc4e7b336 Embed @wasabipesto's charts on /analytics 2022-05-31 08:32:11 -07: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
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
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
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
SirSaltyy
d19d60eb6a
Update leaderboards.tsx (#314)
Renamed top creators header from "market volume" to "market liquidity".
2022-05-24 14:05:12 +01: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
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
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
21527275d1 Fix numeric market embeds 2022-05-22 22:03:05 -05:00
James Grugett
f85b10e517 Exclude partial day from analytics 2022-05-22 17:35:10 -05: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
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
52ad4c42b0 Persist homepage sort 2022-05-20 15:08:00 -04:00
Austin Chen
5d96fdafd6 Add padding to homepage 2022-05-20 13:53:12 -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
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
James Grugett
6a30a41b10 Make analytics show data up to current hour 2022-05-18 18:53:53 -04:00
Austin Chen
f17675bbcf Fix typo 2022-05-18 12:07:36 -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
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
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
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
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
mantikoros
b98468c7ea show none option in categories 2022-05-17 12:02:46 -04:00
Austin Chen
a3c1cd2cc1 Unhardcode M$ in more locations 2022-05-17 08:17:22 -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
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
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
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
e660acab56 Put back hotjar code, but deactivate from hotjar site 2022-05-13 15:07:32 -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
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
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
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
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
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
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
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
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
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
James Grugett
4de0fcd198 Revert "Represent DB avatar URLs as non-null (#128)"
This reverts commit bf8e09b6c1.
2022-05-06 14:29:15 -04:00
SirSaltyy
e41f646b42
Remove all spaces between M$ and the associated number (#134)
* Remove all spaces between M$ and the associated number

* Update index.tsx
2022-05-05 22:19:47 -04:00
Boa
bbf419953e
Show comments on profile (#137)
* WIP - got comments on the user page

* Remove number from chosen FR answer

* Distinguish wining and losing FR answers

* Show no answers text

* Simplify get answer items logic

* Show answer number

* Show answer # when resolving

* Fix import path

* Add user's collated comments onto profile

* Allow linking to comments/markets in profile

* Allow preload of users contracts in profile

* Remove unused check

* Small code improvements
2022-05-05 16:30:30 -06:00
Austin Chen
b42e77858f Search through charity preview, description, and tags too 2022-05-05 10:12:16 -04:00
Marshall Polaris
bf8e09b6c1
Represent DB avatar URLs as non-null (#128) 2022-05-04 11:07:22 -07:00
Ian Philips
a004d3a4bf Always show answer panel 2022-05-03 17:54:00 -04:00
Ian Philips
278bcb9724 Show resolved FR answers 2022-05-03 16:57:39 -04:00
Sinclair Chen
f2217d1d8b
Improve donate box UI in mid-size window (#126) 2022-05-03 13:36:00 -07:00
Sinclair Chen
abf23a1462
Pre-load charity order to prevent "jump" (#122) 2022-05-03 10:25:14 -07:00
mantikoros
14544d064a charity page: remove centering 2022-05-03 11:26:02 -04:00
Sinclair Chen
3434b3de3f
Move all charity images to imgur + Next (#120) 2022-05-03 07:00:33 -07:00
James Grugett
ab4dbc798c Change analytics to 90 days. Default to DAU / MAU chart instead of DAU / WAU. 2022-05-02 18:18:42 -04:00
Sinclair Chen
2f6a3c4e00
Replace email with free response market (#118) 2022-05-02 12:48:15 -07:00
Sinclair Chen
db695875c4
CPM: sort charities by amount raised (#117)
* Sort charities by amount raised (after Featured)

* Sort donations chronologically

* refactor charities query to remove parens
2022-05-02 10:55:40 -07:00
James Grugett
6232284e92 Larger font on amount input 2022-05-02 12:15:00 -04:00
Sinclair Chen
fdbcffcfbc
CPM simple feed (#116)
* Add minimal feed

* Display full cent amount for raised < $1
2022-05-02 08:23:12 -07:00
James Grugett
06b7e49e98
[In progress] Server-side feed computation (#106)
* Store view counts & last viewed time

* Schedule updating user recommendations. Compute using tf-idf.

* Update contract's lastBetTime and lastCommentTime on new bets and comments.

* Remove contract's lastUpdatedTime

* Remove folds activity feed

* Implement getFeed cloud function

* Hook up client to use getFeed

* Script to cache viewCounts and lastViewTime

* Batched wait all userRecommendations

* Cache view script runs on all users

* Update user feed each hour and get feed from cache doc.

* Delete view cache script

* Update feed script

* Tweak feed algorithm

* Compute recommendation scores from updateUserFeed

* Disable lastViewedScore factor

* Update lastCommentTime script

* Comment out console.log

* Fix timeout issue by calling new cloud functions with part of the work.

* Listen for contract updates to feed.

* Handle new user: use default feed of top markets this week

* Track lastUpdatedTime

* Tweak logic of calling cloud functions in batches

* Tweak cloud function batching
2022-05-01 11:36:54 -05:00
Austin Chen
bbc8915f79 Clean up prediction market on charities 2022-04-30 17:42:08 -04:00
Austin Chen
53a584f37d Add in LTFF, ARC, RC 2022-04-30 17:35:10 -04:00
Marshall Polaris
731e5d5b7c
Apply permissive CORS headers to API (#115)
* Take cors package as dependency

* Apply permissive CORS headers to all API routes
2022-04-30 13:30:49 -07:00
mantikoros
a3311bd5aa embed total donations market on charity page 2022-04-30 16:27:19 -04:00
Austin Chen
f5e5af0b7a Revert "bound initial probability to [0.1, 0.9]"
This reverts commit da153ceea9.
2022-04-30 13:05:43 -04:00
Austin Chen
ccd0e42734 Revert "give@ isn't set up, use info@"
This reverts commit d2218b5b8b.
2022-04-30 11:19:20 -04:00
Austin Chen
d2218b5b8b give@ isn't set up, use info@ 2022-04-30 09:45:24 -04:00
Austin Chen
5c03f1581a Fix lowercase search, tweak copy 2022-04-30 08:42:25 -04:00
Austin Chen
774ba6fba6 Show confetti on donate 2022-04-30 08:18:25 -04:00
Austin Chen
c51aa0b6b4 Simpify Donate panel 2022-04-30 08:13:38 -04:00
Austin Chen
bd98e8810e Disable "Read more..." for now 2022-04-30 08:09:57 -04:00
James Grugett
3bb4111445 Make charity cards extend same length in row. Tweak image padding 2022-04-29 23:55:32 -04:00
Austin Chen
78e8927de4
Image preview: truncate to 100 chars, show avatar url (#111)
* Truncate image preview to 120 chars

* Try 100 chars instead

* Pass along creatorAvatarUrl

Hoping nothing breaks if the avatarUrl is empty

* Thread through avatarUrl all the way

* Fix typescript
2022-04-29 19:38:31 -04: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
78997c1e45
Show comments position (#110)
* Add betting activity back to feed

* Show position in bin. markets, no comments on bets

* Degroup bets on Bets tab

* Show users position or recent bet with comments

* Add tooltip on answer to FR comments

* Style improvements

* Only use bets by current user for comment input
2022-04-29 15:11:04 -06:00
James Grugett
fa8ebe36bd Move loading indicator into SearchableGrid. 2022-04-29 10:05:32 -04:00
James Grugett
7e9007aad1 Fetch markets client side on explore page (to avoid vercel 5MB limit for static props) 2022-04-29 09:53:51 -04:00
Ian Philips
ca8420d61b Allow free daily market with M-zsh 2022-04-29 07:38:46 -06:00
Marshall Polaris
2ddd95e904
Make tags page filter on server side (#108) 2022-04-28 22:39:39 -07: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
mantikoros
da153ceea9 bound initial probability to [0.1, 0.9] 2022-04-28 10:47:18 -04:00
mantikoros
5a5069a419 sitemap: market changefreq; homepage priority = 1 2022-04-27 13:47:51 -04:00
mantikoros
e926741177 sitemap: remove non-public pages; sort by 24hr volume; make market page priority depend on volume 2022-04-27 13:40:02 -04:00
Ian Philips
9fbd521732 Top traders -> Top bettors 2022-04-26 08:42:45 -06:00
Boa
7b70b9b3bd
Free comments (#88)
* Allow free comments with optional bets

* Send emails for comments without bets

* Refactor to share logic

* No free comments on free response questions

* Minor fixes

* Condense line
2022-04-21 11:09:06 -06:00
James Grugett
c592a3ab59 Fix type error take 2 2022-04-20 01:04:53 -05:00
James Grugett
987e36c357 Fix type error 2022-04-19 22:36:19 -05:00
Marshall Polaris
30d92becd6
Kill allowTransparency on 404 Discord widget (#84) 2022-04-19 21:42:04 -05:00
James Grugett
190a39b2d6 Autofocus question input on /create page 2022-04-19 11:04:07 -05:00
James Grugett
e8e19e0e5d Add monthly retention (code suggested by co-pilot) 2022-04-19 01:57:27 -05:00
James Grugett
3c6369726e Add weekly activiation rate 2022-04-19 01:47:58 -05:00
James Grugett
a6e6e2f52f Include top answer in answer card. 2022-04-18 21:44:31 -05:00
James Grugett
9c74f88b4a
Improve Free response UI (#78)
* Add legend to free response graph

* Hide answers panel unless resolving. Correctly order answers

* No gray background for add answer & resolve panel. Tweak spacing

* Max answer length 240 chars

* Show answer text in resolution for market page, card instead of number.

* Remove remaining answer #'s. Refactor outcome/resolution labels.

* Move answer panel back up

* Tweak spacing

* Update placement of bet button on mobile for FR answer feed item

* Fix reversed feed for binary markets

* Show multi resolve options

* Clean up unused parts of answer item

* Lighten resolve buttons

* Show answer text in market resolve email
2022-04-18 18:02:40 -05:00
James Grugett
b637ab1536 Analytics: Add ratios of daily, weekly, monthly active users 2022-04-15 20:56:07 -05:00
Austin Chen
624d99fc1d Show number of traders in "More" panel 2022-04-13 12:11:49 -07:00
James Grugett
75b39cbf6f Remove loans: no new loans 2022-04-13 12:52:12 -05:00
James Grugett
4268e03293 Redirect to contract page if home loads initially with query params 2022-04-12 23:11:10 -05:00
James Grugett
e53cde5b34 Quick back navigation into feed 2022-04-11 16:13:26 -05:00
mantikoros
ea07edcbd3 add funds: remove M$500 purchase option 2022-04-09 18:56:05 -05:00
James Grugett
ec49a73c74
Algo feed (#77)
* Implement algo feed

* Remove 'See more...' from feed items

* Fix problem with useUpdatedContracts.

* Tweak some params
2022-04-09 18:10:58 -05:00
mantikoros
2fe71731e4 create: fixed ante of $100 2022-04-09 13:51:22 -05:00
mantikoros
ab41404d07
contract tabs: separate market timeline from your trades (#76)
* contract tabs: separate market timeline from your trades

* contract tabs: use pre-existing tab component

* tab styling
2022-04-08 16:13:10 -05:00
James Grugett
f773a59676 FR: Move description above answers 2022-04-07 16:19:27 -05:00
James Grugett
aff6acc8f4 Refactor contract components into contract directory 2022-04-07 16:15:51 -05:00
James Grugett
5e8decfa4e Move tweet, embed buttons plus communities and tags into a market info dialog 2022-04-07 15:52:54 -05:00
mantikoros
7e6545a669 app: viewport meta tag to prevent Safari from automatically zooming in 2022-04-06 22:54:44 -05:00
James Grugett
a2344492a2 Simplify useContractWithPreload 2022-04-06 13:56:08 -05:00
mantikoros
e3800612ea "A market for every question" 2022-04-06 13:20:16 -05:00
James Grugett
8ccf834724 Fix url link to fold page tab: markets and leaderboard 2022-04-04 13:28:33 -05:00
mantikoros
18bba89507 raise min ante to M$50 2022-04-04 10:47:29 -05:00
mantikoros
9c11104110 create panel: remove add tags section 2022-04-04 10:32:04 -05:00
James Grugett
6d25494713 Add Manifold Markets logo on signed out home. 2022-04-04 00:45:23 -05:00
James Grugett
20db898753 Home: remove tabs for Recent activity vs Explore 2022-04-04 00:27:25 -05:00
James Grugett
6ce53a4418 Only show one of bet panel or bet row. Bring back sticky bet panel & sidebar 2022-04-03 18:43:30 -05:00
James Grugett
9420b10bd9 Fix overlapping bet panel 2022-04-03 16:57:38 -05:00
James Grugett
d7b702fe00 Portfolio page! Add to sidebar when signed in, move about into more. 2022-04-03 15:48:25 -05:00
Austin Chen
34e7a27125
Standardize on a single Tabs component (#72)
* Extract out Tabs component

* Use tabs component on /home

* Use Tabs on Fold pages too
2022-03-30 23:24:35 -07:00
Austin Chen
75e48204ef
Add left sidebar (with mobile support this time) (#71)
* Revert "Reverting side navbar for now"

This reverts commit a90441d9d5.

* Use padding instead of margin for bg color

* Use a slideout menu on mobile

* Remove "wide" page option

* Stick right sidebar on page bottom

* Darken bg on hover
2022-03-30 22:35:20 -07:00
James Grugett
a90441d9d5 Reverting side navbar for now 2022-03-30 22:51:15 -05:00
Austin Chen
5c12da140d
Add a left sidebar on desktop (#70)
* Copy in nav from TailwindUI

* Split up nav files

* Hook up sidebar options to the current page

* Tweak padding

* Insert a right sidebar on folds & contracts

* Keep column always centered

* Remove markets and folds from top navbar

* Extract out sidebaricon; link to /about

* Rename to "useFollowedFoldIds"

* Cache followed folds in localstorage

* Remove unused mobile sidebar (for now)

* Remove unused code

* Remove sidebar from landing page

* Tweak resolution panel styling

* Remove the top navbar entirely

* Completely remove the old navbar

* Add "more" and profile link

* Rearrange sidebar ordering

* Remove unused component

* Add Sign In button for logged-out users

* Remove extra options for signed-out users
2022-03-30 16:56:51 -07:00
James Grugett
ed5f69db7a
Sell shares panel (#69)
* Split BuyAmountInput out of AmountInput

* Buy and sell tabs. Compute some sell info

* In progress

* BuyPanel & SellPanel with banner above that shows current shares and toggle button

* Remove "Remaining balance"

* Bring back 'Place a trade'. Tweaks

* Sell shares cloud function.

* Sell all shares by default. Switch back to buy if sell all your shares.

* Cache your shares in local storage so sell banner doesn't flicker.

* Compute sale value of shares with binary search to keep k constant.

* Update bets table to show BUY or SELL

* Fixes from Stephen's review

* Don't allow selling more than max shares in cloud function

* Use modal for sell shares on desktop.

* Handle floating point precision in max shares you can sell.
2022-03-29 14:56:56 -05:00
Austin Chen
a40d593d32 Refactor useQueryAndSortParams into the SearchableGrid component 2022-03-29 08:09:46 -07:00
Sinclair Chen
50eb9bd4bd
Remove resize handles from input fields (#67) 2022-03-25 09:27:28 -07:00
Austin Chen
bad58652b8 Tweak copy 2022-03-24 22:53:12 -07:00
James Grugett
7d8a87615a Embed market: dynamically adjust graph height 2022-03-24 12:03:17 -05:00
Austin Chen
b6281b0b56 Generate sitemap server-side 2022-03-24 09:52:13 -07:00
Austin Chen
1374309de3 Only show profitable trades in "Smartest Money" 2022-03-23 12:06:39 -07:00
James Grugett
9c19966ef9 Show fewer graph ticks on mobile so they don't overlap. padding 2022-03-22 21:05:31 -05:00
James Grugett
cbc01d8160 Fix analytics tabs on mobile 2022-03-22 18:26:06 -05:00
Austin Chen
c40c7af0b0 Condense analytics graphs using tabs 2022-03-22 15:53:06 -07:00
James Grugett
6d5a4d6e3f Week-on-week retention graph 2022-03-22 16:24:26 -05:00
James Grugett
09da7fcb7c Add weekly active users chart. Put daily active first. 2022-03-21 17:42:12 -05:00
Austin Chen
a3067527ee Fix crash when there aren't any bets 2022-03-21 15:19:42 -07:00
James Grugett
4a617a4c07 Share embed button 2022-03-21 15:23:21 -05:00
Austin Chen
37b8cc9687
Show a top 5 leaderboard on resolved markets (#66)
* Show a top5 leaderboard on resolved markets

* Only show profitable traders

* Include sales in profits

* Copy Leaderboard styling

* Also show the top comment and trade

* Fix padding for solo bets

* Only show both comment & bet if they differ
2022-03-20 18:07:45 -07:00
James Grugett
7df69dda4d Embedded market: Make only top section a link 2022-03-20 18:17:37 -05:00
James Grugett
cc15eb2044 Make embedded market link a clickable link 2022-03-20 18:12:33 -05:00
James Grugett
ee6f91a52f Created embed page for analytics 2022-03-20 17:21:28 -05:00
James Grugett
087a2a1f8f Monthly active users 2022-03-20 16:23:25 -05:00
James Grugett
48f5c28d75 Simplified contract embed 2022-03-20 16:05:16 -05:00
James Grugett
164f5fba06 Simple market embed page 2022-03-20 12:45:17 -05:00
mantikoros
927a5137a2 update api to include cfmm props 2022-03-17 11:55:06 -05:00
Austin Chen
e39f6d4125 Move fold items into folds/ 2022-03-17 00:56:25 -07:00
Austin Chen
318da1bd6f Move nav items into nav/ 2022-03-17 00:50:45 -07:00
James Grugett
addc883440 Track seen contracts in feed. Order feed by seen time priority. 2022-03-17 02:29:19 -05:00
mantikoros
c183e00d47
Cfmm (#64)
* cpmm initial commit: common logic, cloud functions

* remove unnecessary property

* contract type

* rename 'calculate.ts' => 'calculate-dpm.ts'

* rename dpm calculations

* use focus hook

* mechanism-agnostic calculations

* bet panel: use new calculations

* use new calculations

* delete markets cloud function

* use correct contract type in scripts / functions

* calculate fixed payouts; bets list calculations

* new bet: use calculateCpmmPurchase

* getOutcomeProbabilityAfterBet

* use deductFixedFees

* fix auto-refactor

* fix antes

* separate logic to payouts-dpm, payouts-fixed

* liquidity provision tracking

* remove comment

* liquidity label

* create liquidity provision even if no ante bet

* liquidity fee

* use all bets for getFixedCancelPayouts

* updateUserBalance: allow negative balances

* store initialProbability in contracts

* turn on liquidity fee; turn off creator fee

* Include time param in tweet url, so image preview is re-fetched

* share redemption

* cpmm ContractBetsTable display

* formatMoney: handle minus zero

* filter out redemption bets

* track fees on contract and bets; change fee schedule for cpmm markets; only pay out creator fees at resolution

* small fixes

* small fixes

* Redeem shares pays back loans first

* Fix initial point on graph

* calculateCpmmPurchase: deduct creator fee

* Filter out redemption bets from feed

* set env to dev for user-testing purposes

* creator fees messaging

* new cfmm: k = y^(1-p) * n^p

* addCpmmLiquidity

* correct price function

* enable fees

* handle overflow

* liquidity provision tracking

* raise fees

* Fix merge error

* fix dpm free response payout for single outcome

* Fix DPM payout calculation

* Remove hardcoding as dev

Co-authored-by: James Grugett <jahooma@gmail.com>
2022-03-15 17:27:51 -05:00
James Grugett
93287f8dc1
Answers in feed (#63)
* Compute answer group feed items

* Refactor feed code into 5 files under feed directory.

* Convert to typed ActivityItems

* Use feed "mode". Clean up cases.

* Implement feed answer groups!

* FR: Use nested comments/bets under answers for contract page. filter more items out of FR feed.

* Linkify answer text on activity feed

* Default feed excluded tags are case insensitive

* Show followed folds first

* Allow filtering your trades

* Store users's last sort in localstorage

* Use avatar of user that submitted answer and name instead of pencil icon. Spacing. Show up to 3 comments in asnwer group.

* Don't reveal market creator's bets

* Fix communites feed to be abbreviated

* Remove complicated answer group logic

Co-authored-by: Austin Chen <akrolsmir@gmail.com>
2022-03-14 15:29:32 -05:00
Austin Chen
14e2071b1d Show followed folds first 2022-03-13 11:55:05 -07:00
Austin Chen
917e066a45 Add a searchbar over all folds 2022-03-10 10:14:06 -08:00
James Grugett
fe49ae4d5a Hide fast fold follow widget for now 2022-03-09 22:08:55 -06:00
James Grugett
79bd299b68 Enforce max question length, description length, and tag length. 2022-03-09 11:08:57 -06:00
Austin Chen
da4ce99755
Merge Manifold for Teams infra into main codebase (#61)
* Add dev target for TheoremOne

* Restrict signups to theoremone.co emails

* Add new indices

* Forbid reads from unauthenticated users

* Client-side render pages that need auth

These pages are now client-side rendered:
- /home
- /leaderboards
- /market/...
- /fold/...

* Hide 404 for private Manifolds

* Brand instance for TheoremOne

* Hide "Add Funds" and "Personalize your feed"

* "M$" =>  "T$"

* Hide Discord & About Page too

* Update placeholders for teams

* Update firestore.indexes.json

* Switch /analytics to propz

* Migrate per-env code into common/

* More migrations to PROJECT_ID

* Conditionally use SSG depending on public vs private instance

* Fix props to be empty object

* Move more logic into access

* Spin out config files for each environment

* Generify most of the customizable brand stuff

* Move IS_PRIVATE_MANIFOLD to access.ts

* Rename access.ts to envs/constants.ts

* Add "dev:dev" alias

* Rever firestore rules to existing settings

* Fixes according to James's review
2022-03-08 18:43:30 -08:00
Austin Chen
a32bb57167 Update about page 2022-03-07 10:40:53 -08:00
James Grugett
d7d8fb94c4
Trim activity feed (#60)
* Trim activity feed: show only items from last 24 hours, remove contract description, shorter width.

* Preserve feed ordering based on initial fetch of bets

* Add see more button, description to explore items
2022-03-04 18:06:11 -06:00
James Grugett
e49b64ee9f Flex shrink 0 on bet panel container 2022-03-04 10:33:38 -08:00
James Grugett
cb9fa0ceb2 Daily active users & comments 2022-03-03 12:59:12 -08:00
Austin Chen
ef77779cec Format Tailwind classes with Prettier
Not sure why Husky hooks aren't enforcing this 🤷
2022-03-03 01:09:32 -08:00
Austin Chen
d9fb2c0557 Tweak padding 2022-03-03 01:07:21 -08:00
James Grugett
c30962bf80 Create bet count and market count charts in our analytics 2022-03-02 17:52:41 -08:00
James Grugett
6abf235505 Show correct remaning balance for ante input when creating market 2022-03-02 13:50:19 -08:00
James Grugett
2a03751d49 Widen bet panel 2022-03-02 13:43:48 -08:00
James Grugett
985cdd2537
🏦 Per-market loans! (#57)
* Loan backend: Add loanAmount field to Bet, manage loans up to max loan amount per market -- buy, sell, and resolve.

* Loan frontend: show your loan amount in bet panel, answer bet panel

* Resolve emails include full payout not subtracting loan

* Exclude sold bets from current loan amount

* Handle bets table for loans. Sell dialog explains how you will repay your loan.

* Floor remaining balance

* Fix layout of create answer bet info

* Clean up Sell popup UI

* Fix bug where listen query was not updating data.

* Reword loan copy

* Adjust bet panel width

* Fix loan calc on front end

* Add comment for includeMetadataChanges.

Co-authored-by: Austin Chen <akrolsmir@gmail.com>
2022-03-01 21:31:48 -06:00
James Grugett
ce30b34480 Fetch somewhat less data for fold static props 2022-03-01 18:08:46 -08:00
James Grugett
c372a0af9d Filter out undefined contracts in fold 2022-03-01 12:40:46 -08:00
James Grugett
71faee584c Add funds menu option, and Add funds page 2022-02-28 17:32:53 -08:00
Austin Chen
445e90f2b9 Link to analytics page from /about 2022-02-28 17:11:37 -08:00
James Grugett
a680d80793 Free response: Show invested and payouts on market page, don't show payout if yes/no 2022-02-28 15:58:13 -08:00
James Grugett
c6eb729e46 Remove border on feed tabs 2022-02-28 15:22:01 -08:00
James Grugett
8884f1beb9
Expose resolutionTime in API (#56)
* Expose resolutionTime. Compute closeTime to be the min of resolution and close time

* Rename settled to resolved, newest to most recent
2022-02-28 11:40:48 -08:00
James Grugett
0ccba20d5c Add explore tab on home feed that shows random inactive markets. 2022-02-27 13:37:11 -08:00
James Grugett
a3592f388b Fix feed to actually sort by last bet 2022-02-25 16:19:32 -06:00
James Grugett
ab5ea0181d Feed: Send only contracts with bets in last 24 hours. Instead of all contracts: 2.2MB => 0.8MB 2022-02-25 02:11:10 -06:00
James Grugett
cd590031e7 Feed updates: 1. Order by any bet instead of top 10 & comments 2. No resolved contracts 3. Show loading while fetching recent bets clientside so order preserved 4. Don't change order from new bets 2022-02-25 01:59:53 -06:00
James Grugett
185e68fa23 Fix 'undefined chance' in metatag description 2022-02-22 14:17:58 -06:00
James Grugett
207a12df55 Listen to followed folds. Follow button retreives from local storage. 2022-02-20 23:12:35 -06:00
James Grugett
8580698c15 Split answers panel into 5 files 2022-02-20 16:25:58 -06:00
mantikoros
42f88766b3 api: remove userId from bets 2022-02-19 22:51:51 -06:00
mantikoros
096a9e773a refactor /home logic to useActiveContracts 2022-02-19 18:02:40 -06:00
mantikoros
60f72fa6ab FastFoldFollowing: check if followedFoldIds is defined 2022-02-19 17:26:49 -06:00
mantikoros
2c572dd89a FastFoldFollowing: check if user defined 2022-02-19 17:23:03 -06:00
mantikoros
13727bb19f
Fast fold following (#51)
* fast follow folds

* FastFoldFollowing component on homepage
2022-02-19 17:17:36 -06:00
James Grugett
2a5172cb48 Switch to sending only recent bets and comments from static props 2022-02-18 12:43:13 -06:00
Austin Chen
a17342e55c
New, pretty user page (#48)
* Show bio, banner, and social links on user page

* Minor tweaks

* Allow edits to their user page

* Fix build; add a white ring around users

* From userpage, link to /profile (which is always editable now)

* Update userpage SEO

* Clean up Profile menu

* Fixes according to Stephen's code review
2022-02-17 17:16:58 -08:00
James Grugett
20ec09b7c6 Remove filter out of binary contracts 2022-02-17 18:39:06 -06:00
James Grugett
0a3b14883c Update SEO for non-binary markets 2022-02-17 18:34:17 -06:00
James Grugett
c48913d91e Sort bets/comments on client. Somehow server order is getting flipped? 2022-02-17 18:18:43 -06:00
Austin Chen
8f40350a75 API: Rename to LiteMarket/FullMarket; include creator avatar url 2022-02-17 16:04:05 -08:00
James Grugett
b2501d8145
Free response (#47)
* Answer datatype and MULTI outcome type for Contract

* Create free answer contract

* Automatically sort Tailwind classes with Prettier (#45)

* Add Prettier Tailwind plugin

* Autoformat Tailwind classes with Prettier

* Allow for non-binary contracts in contract page and related components

* logo with white inside, transparent bg

* Create answer

* Some UI for showing answers

* Answer bet panel

* Convert rest of calcuate file to generic multi contracts

* Working betting with ante'd NONE answer

* Numbered answers. Layout & calculation tweaks

* Can bet. More layout tweaks!

* Resolve answer UI

* Resolve multi market

* Resolved market UI

* Fix feed and cards for multi contracts

* Sell bets. Various fixes

* Tweaks for trades page

* Always dev mode

* Create answer bet has isAnte: true

* Fix  card showing 0% for multi contracts

* Fix grouped bets feed for multi outcomes

* None option converted to none of the above label at bottom of list. Button to resolve none.

* Tweaks to no answers yet, resolve button layout

* Show ante bets on new answers in the feed

* Update placeholder text for description

* Consolidate firestore rules for subcollections

* Remove Contract and Bet type params. Use string type for outcomes.

* Increase char limit to 10k for answers. Preserve line breaks.

* Don't show resolve options after answer chosen

* Fix type error in script

* Remove NONE resolution option

* Change outcomeType to include 'MULTI' and 'FREE_RESPONSE'

* Show bet probability change and payout when creating answer

* User info change: also change answers

* Append answers to contract field 'answers'

* sort trades by resolved

* Don't include trailing !:,.; in links

* Stop flooring inputs into formatMoney

* Revert "Stop flooring inputs into formatMoney"

This reverts commit 2f7ab18429.

* Consistently floor user.balance

* Expand create panel on focus

From Richard Hanania's feedback

* welcome email: include link to manifold

* Fix home page in dev on branches that are not free-response

* Close emails (#50)

* script init for stephen dev

* market close emails

* order of operations

* template email

* sendMarketCloseEmail: handle unsubscribe

* remove debugging

* marketCloseEmails: every hour

* sendMarketCloseEmails: check undefined

* marketCloseEmails: "every hour" => "every 1 hours"

* Set up a read API using Vercel serverless functions (#49)

* Set up read API using Vercel serverless functions

Featuring:
/api/v0/markets
/api/v0/market/[contractId]
/api/v0/slug/[contractSlug]

* Include tags in API

* Tweaks. Remove filter for only binary contract

* Fix bet probability change for NO bets

* Put back isProd calculation

Co-authored-by: Austin Chen <akrolsmir@gmail.com>
Co-authored-by: mantikoros <sgrugett@gmail.com>
Co-authored-by: mantikoros <95266179+mantikoros@users.noreply.github.com>
2022-02-17 17:00:19 -06:00
Austin Chen
51aa8df010
Set up a read API using Vercel serverless functions (#49)
* Set up read API using Vercel serverless functions

Featuring:
/api/v0/markets
/api/v0/market/[contractId]
/api/v0/slug/[contractSlug]

* Include tags in API
2022-02-17 12:56:24 -08:00
James Grugett
d6f15deff4 Fix home page in dev on branches that are not free-response 2022-02-17 01:02:48 -06:00
mantikoros
443acdbcf8 beautify trades page 2022-02-14 16:00:46 -06:00
Austin Chen
e4f1fbde3f Link to each question from Admin page 2022-02-13 16:09:30 -08: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
James Grugett
dc0c9cf1d4 Filter undefined contracts 2022-02-10 17:06:27 -06:00
James Grugett
4150479aa3 Break words and linkify fold about text 2022-02-10 14:57:41 -06:00
James Grugett
00fbe711e5 Only show leaderboard scores that round up to M$ 1 or more 2022-02-10 14:51:14 -06:00
Austin Chen
bcc011c1fd Allow admins to edit questions 2022-02-09 10:58:33 -08:00
James Grugett
2d7c895964 Shrink about headers to h2 2022-02-08 00:21:47 -06:00
James Grugett
19baf86963 Sort fold & tag markets by 24-hour-vol 2022-02-07 23:03:55 -06:00
James Grugett
546005139b Fix recent activity label on mobile 2022-02-07 22:06:58 -06:00
James Grugett
2b5a0b1111 Require at least 2 follows to show a community (or show it if you are the curator) 2022-02-07 20:56:25 -06:00
James Grugett
faa49b750e Always show follow a community prompt 2022-02-06 20:03:42 -06:00
Austin Chen
ab6cfd2564 Show all recent activity if user has no folds 2022-02-06 16:03:36 -08:00
James Grugett
25e498ab3c Create market includes tags input. 2022-02-06 17:14:07 -06:00
James Grugett
63b7f64683 Listen for folds in contract page 2022-02-06 16:55:14 -06:00
Austin Chen
5aebd7eb41 Use font-weight: 600 for bold text 2022-02-06 01:23:45 -08:00
Austin Chen
516656f194 Clean up About page 2022-02-06 00:35:58 -08:00
Austin Chen
d2f5742231 Export all users to a CSV with name and email 2022-02-05 21:34:36 -08:00
mantikoros
dc2fada751 create: handle null 2022-02-05 19:10:26 -06:00
mantikoros
fae28fed7c create: don't replace undefined antes 2022-02-05 19:02:13 -06:00
James Grugett
1c8c2a4126 Fix home error after new contracts 2022-02-05 15:56:42 -06:00
James Grugett
d0a56cd1af Merge branch 'send-all-data' 2022-02-04 20:22:43 -06:00
James Grugett
31fbd6b900 Send all comments and bets to home page, so feed loads immediately 2022-02-04 20:09:34 -06:00
mantikoros
f7b981c55c "winnings" => "trader profits" 2022-02-04 17:42:08 -06:00
mantikoros
d439a2e1c0 create page: fix ante resetting 2022-02-04 17:40:03 -06:00
mantikoros
1ab7a4162c fix market close date time 2022-02-04 17:38:40 -06:00
James Grugett
637a76cf34 Cache first step of generating feed: folds you follow and contracts you bet on. 2022-02-04 17:24:54 -06:00
Austin Chen
a46c311a99 Clean up titles on /home 2022-02-04 10:30:13 -08:00
mantikoros
b4a68bf436 redirect signed out users on /profile and /trades to homepage 2022-02-03 21:19:42 -06:00
mantikoros
03f36cf954
User profile (#44)
* add id, userId to comment

* change user info cloud function and script; move cleanUsername to common

* change user info script

* fix rules

* add fund button: useLocation hook

* profile page

* merge

* profile stuff

* avatar uploading to storage bucket

* changeUserInfo: use transaction

* Styles for profile page

* Edit mode for profile, and more styles

Co-authored-by: James Grugett <jahooma@gmail.com>
2022-02-03 21:04:56 -06:00
James Grugett
ca89fd158d Make home communities look better on mobile. Add Covid & AI. 2022-02-03 19:00:17 -06:00
James Grugett
00f632ec47 Remove tw-elements for now 2022-02-03 18:10:19 -06:00
James Grugett
c36ce3e521 Change home tags to communities 2022-02-03 17:40:37 -06:00
James Grugett
e5f553fa1a Merge branch 'main' into custom-feed 2022-02-03 17:33:12 -06:00
James Grugett
587e1e5d61 Add loading spinner while feed loads 2022-02-03 17:12:09 -06:00
James Grugett
8e06e4351e Add tw-elements UI library 2022-02-03 17:11:38 -06:00
mantikoros
4294481b5b change fee structure 2022-02-03 16:59:59 -06:00
James Grugett
3cf4cb7a77 Show custom feed of contracts from folds your follow or have bet on. 2022-02-03 16:54:08 -06:00
James Grugett
6c9f566d3d Add hashtag in tags of fold card 2022-02-03 14:13:51 -06:00
Austin Chen
426d41ba44 Surface a list of tags on /home 2022-02-03 11:00:49 -08:00
Austin Chen
193b9ae6bf Restyle /folds page 2022-02-03 10:47:26 -08:00
James Grugett
a90e9b7083 Reorder fold page queries to be more in parallel 2022-02-03 00:19:59 -06:00
James Grugett
fdbaa5270b Show hot markets in fold feed 2022-02-02 23:58:27 -06:00
James Grugett
00ac581736 Show your performance in fold 2022-02-02 23:34:35 -06:00
James Grugett
95268844aa Add text to fold "about" explaining how markets are included. 2022-02-02 14:20:04 -06:00
James Grugett
f80ef1cd34 Add hot markets to home feed 2022-02-02 00:40:46 -06:00
James Grugett
b95f258763 Add package.json to common directory, and lodash dependency 2022-02-01 12:59:51 -06:00
James Grugett
96c1410f01 Rename Fold => Community in UI 2022-02-01 12:12:55 -06:00
James Grugett
565ded1063 Add folds links in market, hide tags behind Show tags toggle. 2022-02-01 12:06:42 -06:00
James Grugett
4e1174a4dc Option to disallow market creation from fold 2022-01-31 22:10:02 -06:00
James Grugett
5b5e6c78d6 Use expanding text area for description on make-predictions 2022-01-31 21:33:43 -06:00
James Grugett
3bbe6062e9 Change description input to use textarea 2022-01-31 21:31:49 -06:00
James Grugett
bc208df597 Add tags input for make-predictions 2022-01-31 21:13:37 -06:00
James Grugett
6525ffc6c3 Add ante and close date to make predictions 2022-01-31 20:58:41 -06:00
James Grugett
08eac5b0ef Add my calendly to about 2022-01-31 20:44:49 -06:00
James Grugett
2e1fdd7d7a Add border bottom back on fold page 2022-01-31 19:29:59 -06:00
mantikoros
d49656cb77 create: market close includes time 2022-01-30 23:20:27 -06:00
James Grugett
00b7f3505f Listen for contract updates in folds feed 2022-01-30 22:12:12 -06:00
James Grugett
9d2b99f237 Listen for updates of contracts on home 2022-01-30 22:03:20 -06:00
James Grugett
997f13d986 Make leaderboard not error on non-existant users 2022-01-30 21:25:52 -06:00
mantikoros
f06ca8305c
Resolve prob (#41)
* rename MKT to PROB; show resolved probability; move format utilities to common

* ProbabilitySelector

* resolve to PROB

* prob and mkt labels
2022-01-30 15:51:30 -06:00
jahooma
482654d06b Update folds SEO to include curator. 2022-01-28 13:45:32 -06:00
jahooma
f04d66d5c8 Don't focus feed create unless there's no question yet 2022-01-28 13:23:44 -06:00
jahooma
f75dc0200d Remove link create a market in placeholder 2022-01-28 12:54:15 -06:00
jahooma
53a6748c6d Hide negative earners on leaderboard. Show empty message if none on leaderboard. 2022-01-28 12:43:35 -06:00
jahooma
764790c1e1 Add simple Fold page SEO 2022-01-28 12:34:13 -06:00
jahooma
d5742900b0 Remove border on ask question form. Add padding to fold title on mobile 2022-01-28 12:13:12 -06:00
James Grugett
649c6f4642
Make navbar render signed in or signed out by page (#39) 2022-01-27 17:06:31 -06:00
mantikoros
bd6c215cd3
use img instead of next js image for avatar, logo (#38) 2022-01-27 16:50:55 -06:00
jahooma
9b59ea9fbe Bring back global leaderboards linked from profile menu 2022-01-27 16:43:45 -06:00
jahooma
f2c4d3e9c1 Change to white backgrounds for content. Remove page's margin, set individually. 2022-01-27 16:37:43 -06:00
jahooma
4ca1d33d65 Make tag page check lowercase tag field 2022-01-27 15:11:32 -06:00
mantikoros
f58126e630 create: remove default close date 2022-01-27 14:31:09 -06:00
mantikoros
9acb07aa14 home: remove hot, closing soon sections 2022-01-27 14:23:55 -06:00
jahooma
bb788d5201 Change placeholder in fold create question 2022-01-27 14:05:59 -06:00
mantikoros
d2e78eb5de markets: make 24hr vol default sort 2022-01-27 12:48:47 -06:00
jahooma
9764a03189 Add create market to top of fold activity. Auto-adds the primary tag of the fold. 2022-01-27 12:45:35 -06:00
jahooma
61d2557c35 Launch folds in nav bar, update copy. 2022-01-27 01:10:28 -06:00
jahooma
769763d006 Tweaks 2022-01-27 00:38:42 -06:00
Austin Chen
c047365bb4 Include "Buy" tag inside buttons 2022-01-26 16:28:57 -06:00
jahooma
b1abfcda8b Placeholder when no activity on folds page 2022-01-26 14:39:25 -06:00
jahooma
ef8157025f Compute fold follower count from cloud function. 2022-01-26 14:27:16 -06:00
Austin Chen
e4377ee3a3
Allow betting directly from the activity feed (#36)
* Show a popup for betting on the Activity feed

* Replace the popup with a YES/NO selector

* Autofocus the bet amount

* Hide BetRow when not appropriate

* Make bet modal larger on desktop

* Default to YES if no bet choice has been made yet
2022-01-26 14:08:03 -06:00
jahooma
76841e53b1 Follow and unfollow folds 2022-01-26 14:03:32 -06:00
jahooma
c3f49c44a0 Cardify folds in fold list 2022-01-26 12:44:16 -06:00
jahooma
8e511e7cc9 Add about to top of fold page on mobile. Layout tweaks 2022-01-26 12:02:53 -06:00
jahooma
2ea05f8913 Folds query on lowercase tags. Adding to description updates tags & lowercaseTags fields. 2022-01-25 17:52:21 -06:00
jahooma
8b0091f30d Split out create fold button. Show about description on /folds 2022-01-25 17:02:02 -06:00
jahooma
897eb0c27b Handle 404 errors for non-existent fold subpages 2022-01-25 15:44:32 -06:00