Commit Graph

240 Commits

Author SHA1 Message Date
Marshall Polaris
0cf9a90cfb
Remove some dead code related to tags, categories, and old feed stuff (#765)
* Remove dead image storage code

* Kill tag page

* Kill tag and categories related component UI

* Kill some old algo feed kind of code
2022-08-18 15:46:11 -07:00
Marshall Polaris
972f215f0c
Rewrite useQueryAndSortParams machinery to be faster/simpler/better (#758)
* Rewrite useQueryAndSortParams machinery to be faster/simpler/better

* Politely debounce Algolia querying

* Tidy some stuff up

* Style changes suggested by James
2022-08-14 22:09:25 -07:00
Marshall Polaris
3cb28cdecb
Teach AuthContext to manage the private user doc (#738)
* Return both user and privateUser from `createuser`

* Make `useStateCheckEquality` more flexible

* Make `AuthContext` track the private user doc

* Change `usePrivateUser` hook to use the auth context data

* Pass both user and private user through SSR to auth context

* Fix bug in create user flow
2022-08-12 13:41:00 -07:00
Austin Chen
dc95587cca
Add editor toolbar to choose and embed markets (#702)
* Embed markets using the "add markets" template

* Override dev domain

* Improve market modal style

- contract searchbar now sticky
- entire card clickable to select (if quickbet is hidden)
- adjust selected card styles

* remove extra export

* Hide pills

* Fix browser redirect warning

* Insert all markets instead of just one

* fix type error

* fixup "Insert all markets instead of just one"

Co-authored-by: Sinclair Chen <abc.sinclair@gmail.com>
2022-08-11 14:32:02 -07:00
Marshall Polaris
847d3d0f27
Fix efficiency problems with visibility checking code (#730)
* Fix problems with visibility checking code

* Tear out old contract tracking stuff per James

* Use `useEvent` in VisibilityObserver per James suggestion
2022-08-09 15:28:27 -07:00
Marshall Polaris
592125b5e7
Fix broken useBets filters (#731) 2022-08-09 10:50:11 -05:00
James Grugett
98806a806f Fix query params on emulator/private instance 2022-08-07 18:07:36 -07:00
Ian Philips
798253f887
Challenge Bets (#679)
* Challenge bets

* Store avatar url

* Fix before and after probs

* Check balance before creation

* Calculate winning shares

* pretty

* Change winning value

* Set shares to equal each other

* Fix share challenge link

* pretty

* remove lib refs

* Probability of bet is set to market

* Remove peer pill

* Cleanup

* Button on contract page

* don't show challenge if not binary or if resolved

* challenge button (WIP)

* fix accept challenge: don't change pool/probability

* Opengraph preview [WIP]

* elim lib

* Edit og card props

* Change challenge text

* New card gen attempt

* Get challenge on server

* challenge button styling

* Use env domain

* Remove other window ref

* Use challenge creator as avatar

* Remove user name

* Remove s from property, replace prob with outcome

* challenge form

* share text

* Add in challenge parts to template and url

* Challenge url params optional

* Add challenge params to parse request

* Parse please

* Don't remove prob

* Challenge card styling

* Challenge card styling

* Challenge card styling

* Challenge card styling

* Challenge card styling

* Challenge card styling

* Challenge card styling

* Challenge card styling

* Add to readme about how to dev og-image

* Add emojis

* button: gradient background, 2xl size

* beautify accept bet screen

* update question button

* Add separate challenge template

* Accepted challenge sharing card, fix accept bet call

* accept challenge button

* challenge winner page

* create challenge screen

* Your outcome/cost=> acceptorOutcome/cost

* New create challenge panel

* Fix main merge

* Add challenge slug to bet and filter by it

* Center title

* Add helper text

* Add FAQ section

* Lint

* Columnize the user areas in preview link too

* Absolutely position

* Spacing

* Orientation

* Restyle challenges list, cache contract name

* Make copying easy on mobile

* Link spacing

* Fix spacing

* qr codes!

* put your challenges first

* eslint

* Changes to contract buttons and create challenge modal

* Change titles around for current bet

* Add back in contract title after winning

* Cleanup

* Add challenge enabled flag

* Spacing of switch button

* Put sharing qr code  in modal

Co-authored-by: mantikoros <sgrugett@gmail.com>
2022-08-04 15:27:02 -06:00
Ian Philips
e700697423 Fix group referrals not working 2022-08-02 17:18:08 -06:00
Ian Philips
0b06ded5e5
Groups contracts (#709)
* Update group links in trigger and api

* Remove extra call during creation

* Remove grouplinks on frontend

* Deserialize

* Consolidate logic

* Move function locally
2022-08-01 21:15:09 -06:00
James Grugett
87f6949d80 Use custom search index for search results. Hide sort options while there's a query. 2022-07-29 18:13:53 -07:00
James Grugett
d6cf4332da Delete query param when empty 2022-07-29 17:37:34 -07:00
James Grugett
be01a15230
Refactor search to not use Algolia components (#705)
* In progress refactor to not use Algolia components

* Cleanup

* Only query when necessary

* Read and update url params for query and sort

* Don't push router

* Don't update url if using default sort

* Add popstate listener to improve home navigation

* Remove console.logs
2022-07-29 19:08:51 -05:00
Ian Philips
6fb9849007
Allow to add/remove from groups on market page (#685)
* Allow to add/remove from groups on market page

* remove lib

* Fix Sinclair's relative import from May

* Clean
2022-07-22 11:34:10 -06:00
mantikoros
91bec9c996
Referrals page (#676)
* Referrals page added to sidebar; useSaveReferral; InfoBox

* text color

* eslint

* migrate useUsers hook to react-query (#674)

* Remove bet button from free response comments

* Make answer replies more closely spaced together

* Host Ida and Alex's MTG Guesser game (#656)

* Copy over code from Mtg Guesser

* Run Prettier

* CSS Tweaks: Hover feedback, button positioning

* Hide all but counterspell & burn, for now

* Move to /mtg directory

* Fix prettierignore

* smaller jsons (#673)

limited burn to only red cards and also added limited json files to only have fields needed to play

* Add Ida's tweak to card position

Co-authored-by: marsteralex <bob.masteralex@gmail.com>

* Adjust card positioning

* Make the select screen index.html

* Remove other guessing games

* Remove alternate versions; add Alex's email

* Remove unused jsons

* Small FR comments tweaks

* Spacing tweak

* Changing manalinks table UI (#665)

From table to card view

* Fix comment spacing on non-FR

* Move "Send M$" lower in sidebar More list.

* Move leaderboards up in mobile nav

* eslint

* prettier

Co-authored-by: Sinclair Chen <abc.sinclair@gmail.com>
Co-authored-by: James Grugett <jahooma@gmail.com>
Co-authored-by: Austin Chen <akrolsmir@gmail.com>
Co-authored-by: marsteralex <bob.masteralex@gmail.com>
Co-authored-by: ingawei <46611122+ingawei@users.noreply.github.com>
2022-07-21 14:43:10 -05:00
Marshall Polaris
03858e4a8c
Make a React context to be the source of truth for authenticated user (#675)
* Make a React context to manage the logged in user events

* Remove unnecessary new user creation promise machinery

* Slight refactoring to auth context code

* Improvements in response to James feedback
2022-07-21 00:38:26 -07:00
Sinclair Chen
aa554ca9f6
migrate useUsers hook to react-query (#674) 2022-07-20 16:31:18 -07:00
Ian Philips
2152e5286a Score & sort by unique bettors in last 3 days 2022-07-19 16:29:41 -06:00
Ian Philips
a1e03c3a25 Allow opening notifs in new tabs, return newest notifs 2022-07-19 13:58:51 -06:00
Marshall Polaris
61cbb07bd5
Fix some broken stuff on the homepage contract search routing (#664)
* Use Next router more appropriately

* Replace instead of push when modifying search query params
2022-07-19 12:33:53 -07:00
Ian Philips
c236eb15b1
Cache notifs in local, gives instant load of old notifs (#662)
* Cache notifs in local, gives instant load of old notifs

* Small refactor, add ss auth

* unused vars

* Add back in replaceAll

* Save all notifs

* Memoize paginated notifs

* Replace all => replace with regexp
2022-07-19 09:04:47 -06:00
mantikoros
b5f0b58898 usePing 2022-07-17 15:17:31 -05:00
James Grugett
1edc1993e1 Cache follows in localstorage 2022-07-16 14:58:25 -05:00
Sinclair Chen
2543bdcdfc
refactor string matching (#649) 2022-07-15 14:16:00 -07:00
Ian Philips
47579e8509 Fix network spam with modified deps array 2022-07-15 07:28:04 -06:00
Ian Philips
9c49f2e2d7 Revert "Revert "Order groups by most recent chat activity (#650)""
This reverts commit 17c9beca28.
2022-07-15 06:52:08 -06:00
James Grugett
17c9beca28 Revert "Order groups by most recent chat activity (#650)"
This reverts commit 6e1aa4b0f4.
2022-07-14 20:51:38 -05:00
Ian Philips
6e1aa4b0f4
Order groups by most recent chat activity (#650)
* Order groups by most recent chat activity

* Use group chat slug constant

* Match source slug and isSeenOnHref

* Listen for group member changes
2022-07-14 16:46:45 -06:00
James Grugett
8daf1b2ba8 Return undefined instead of null for useUserById(undefined) 2022-07-14 12:03:29 -05:00
Sinclair Chen
a93e64c830
fix: let useUserById accept undefined userId (#648) 2022-07-14 12:02:46 -05:00
Ian Philips
4eba3c8124 Try new way of calculating rankings for large groups 2022-07-14 09:09:12 -06:00
Ian Philips
ee01328553 Remove group slugs from contracts on delete group 2022-07-14 07:53:41 -06:00
Sinclair Chen
5ebd4498a0
Remove deprecated useUserById implementation (#571)
* Remove duplicate useUserById implementation

* fix bug: firebase doesn't accept empty paths
2022-07-13 17:43:20 -07:00
Ian Philips
7a49549389 Ignore rankings/members for huge groups for now 2022-07-13 16:20:56 -06:00
Ian Philips
55c91dfcdd
Categories to groups (#641)
* start on script

* Revert "Remove category filters"

This reverts commit d6e808e1a3.

* Convert categories to official default groups

* Add new users to default groups

* Rework group cards

* Cleanup

* Add unique bettors to contract and sort by them

* Most bettors to most popular

* Unused vars

* Track unique bettor ids on contracts

* Add followed users' bets to personal markets

* Add new users to welcome, bugs, and updates groups

* Add users to fewer default cats
2022-07-13 15:11:22 -06: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
e7e686d579 return creator liquidity after resolution 2022-07-09 13:53:50 -04:00
Ian Philips
b1b016f9e0
Enable tipping on group chats w/ notif (#629) 2022-07-07 17:23:13 -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
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
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
Ian Philips
b9931e65da Allow adding anyone's contract to a group 2022-07-01 16:37:30 -06: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
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
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
Austin Chen
da81035e58 Group leaderboards show members only by default 2022-06-24 18:38:39 -05:00
Ian Philips
8ced159d9a Various group & mobile ux improvements 2022-06-24 12:16:37 -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
6a35d3bf2d Remove group details cache, update group directly 2022-06-22 17:19:17 -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
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
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
mantikoros
d2a1af7c15 track search, track charity donation 2022-06-16 11:49:57 -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
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
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
f3d4827115
Listen for contract updates when navigating from home to contract page. (#494) 2022-06-13 11:04:56 -05: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
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
James Grugett
f2c6c8c483 Change Similar tab to exclude people you follow 2022-06-10 12:28:02 -05:00
James Grugett
f809acd6fd 'Discover' => 'Similar' and shows recs based on user you have open 2022-06-08 14:38:04 -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
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
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
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
Ian Philips
a7a482eecd
Various notifications bugfixes/improvements (#442)
* Various notifications bugfixes/improvements

* eslint
2022-06-06 16:15:36 -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
Marshall Polaris
e712a054ae Fix line endings 2022-06-05 18:57:49 -07: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
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
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
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
f3be3b1f3c Maybe free market countdown will work now, beats me 2022-05-25 15:55:50 -06: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
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
James Grugett
688ebb797a Add "Last updated" sort option 2022-05-21 13:44:55 -04:00
Sinclair Chen
4c7836abc7
Show embed view of normal market links in iframes (#254) 2022-05-19 17:34:08 -07: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
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
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
76ffe8eea1 Infinite scroll: automatically load new page of results 2022-05-17 19:29:46 -04:00
Ian Philips
ef98c16c26 Created contrac today => true to avoid free market flash 2022-05-17 10:06:00 -06:00
mantikoros
14ce820dcb cache deservesDailyFreeMarket locally 2022-05-17 11:32:10 -04:00
James Grugett
19da0c6c82 Default to 'all' feed category when loading page. 2022-05-15 23:09:49 -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
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
Sinclair Chen
abf23a1462
Pre-load charity order to prevent "jump" (#122) 2022-05-03 10:25:14 -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