Commit Graph

356 Commits

Author SHA1 Message Date
Ian Philips
d90901b4e3 Check creator balance again upon acceptance 2022-08-05 05:03:47 -06:00
James Grugett
33906adfe4 Revert "Switch comments/chat to rich text editor (#703)"
This reverts commit f52da72115.
2022-08-04 16:49:59 -07:00
Sinclair Chen
f52da72115
Switch comments/chat to rich text editor (#703)
* Switch comments/chat to rich text editor

* Remove TruncatedComment

* Re-add submit on enter

* Insert at mention on reply

* Update editor style for send button

* only submit on enter in chat

* code review: refactor

* use more specific type for upload

* fix ESlint and errors from merge

* fix trigger on every render eslint warning

* Notify people mentioned in comment

* fix type errors
2022-08-04 16:34:04 -07:00
Sinclair Chen
edae709f5f
Notify mentioned users on market publish (#683)
* Add function to parse at mentions

* Notify mentioned users on market create

- refactor createNotification to accept list of recipients' ids
2022-08-04 15:35:55 -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
SirSaltyy
2d3ca47b52
500 mana email (#687)
* Create 500-mana.html

* Update 500-mana.html

Fixed typos and links not working

* Added "create a good market" guide

added page creating-market.html
For Stephen to set up condition (email 3 days after signing up)

* Update 500-mana.html

updated 500 Mana email (still need to make changes to create market guide)

* email changes

* sendOneWeekBonusEmail logic

* add dayjs as dependency

* don't use mailgun scheduling

Co-authored-by: mantikoros <sgrugett@gmail.com>
2022-08-04 13:03:02 -05:00
Marshall Polaris
f8a74aa438
Allow admins to resolve any market (#711) 2022-08-02 15:34:20 -07:00
Keri Warr
cfeb50826c
Add endpoint for reading currently authenticated user (#710) 2022-08-02 00:06:23 -07:00
Marshall Polaris
6901507461
Allow unspecfied outcome as input to sellshares (#706)
* Allow unspecfied outcome as input to `sellshares`

* Fix small details
2022-08-01 23:53:12 -07: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
Marshall Polaris
b4e8c5d602
Backfill missing group IDs (#708) 2022-08-01 16:40:04 -06:00
ingawei
ae2e7dfe30
noobify welcome demo (#699)
* noobify welcome
* also beginning to add greyscale color scheme
2022-07-30 02:50:03 -05:00
mantikoros
1aaae93113
Multiple choice markets (#698)
* multipe choice answers

* create multiple choice cloud function

* multi choice market page

* show outcome '0'

* stats: multi choice type

* update place bet

* answer doc id = outcome

* update resolve market

* prettier

* fix

* fix resolution
2022-07-27 21:40:33 -05:00
Ian Philips
013ff1d941 Show api error on create contract 2022-07-26 16:44:51 -07:00
Marshall Polaris
b506e96548
Implement "sell all shares" functionality in sellshares and expose API (#696)
* Change `sellshares` to be able to sell all shares

* Sell all shares properly on bet panel UI

* Add API route for selling shares, document
2022-07-26 12:47:19 -07:00
mantikoros
ec0e25e5ed create user: remove ip check 2022-07-25 18:25:23 -07:00
Marshall Polaris
312b244e2a
Small backend cleanups (#643)
* Reuse DAY_MS in update-metrics job

* More concise transaction in cancelbet

* Remove some meaningless awaits

* Do less work in onCreateLiquidityProvision

* Do less work in onCreateAnswer
2022-07-24 00:45:45 -07:00
Marshall Polaris
a1d5d161dd
Revamp backend code to support good local function development (#657)
* Move concurrently dep upwards

* Add express as explicit dependency

* Accept just one HTTP method per endpoint

* Fix endpoint option coalescing

* Expressification of cloud functions

* Nicer logging of API requests

* Refactor web package.json

* Add ts-node and nodemon to dev dependencies, bring back cors

* Add scaffolding to point dev server at local functions

* Enable emulator in dev server scaffolding

* Fix up a little stuff I broke
2022-07-24 00:26:38 -07:00
Sinclair Chen
6c89e5f18f
Add @ mentions to editor (#670)
* Add @ mentions to editor

* Fix mention list not loading

* Sort mention list by prefix, follow count

* Render at mention with Linkify component

- mentions are now Next <Link> rather than <a>
- fix bug where editor.getText() returns [object Object] for mentions
- fix mention rendering for posted markets
2022-07-23 20:37:34 -07:00
Marshall Polaris
6c8c068327
Write script to fix old comments without IDs and user IDs (#680) 2022-07-23 13:48:28 -07:00
Ian Philips
56a579ff91 Don't filter for group contract ids 2022-07-22 16:44:03 -06:00
Ian Philips
abde013ab6 Re-get contracts to get updated links 2022-07-22 16:40:37 -06:00
Ian Philips
5f074206de
Backfill and forward fill contracts with group info (#686)
* Backfill and forward fill contracts with group info

* No nested queries :(

* Fix filter

* Pass empty arrays instead of undefined
2022-07-22 16:28:53 -06:00
Ian Philips
d319b654ce Add creator id to unique bettor ids 2022-07-22 14:15:42 -06:00
Austin Chen
87170894e2 Suppress eslint warning for script 2022-07-22 09:12:01 -07:00
Ian Philips
83cb0a6130 Allow clickable username in welcome message 2022-07-22 08:19:06 -06:00
Ian Philips
bfb11339ca Convert world and culture categories 2022-07-22 08:12:40 -06:00
Sinclair Chen
4b4734531f
refactor createNotif - put ?: args in object (#681) 2022-07-21 17:08:09 -07:00
Ian Philips
921ac4b2a9 Fix last 3 days number 2022-07-19 17:22:23 -06:00
Ian Philips
1f0983a145 Find old contracts to decrement score on 2022-07-19 17:08:51 -06:00
Ian Philips
2152e5286a Score & sort by unique bettors in last 3 days 2022-07-19 16:29:41 -06:00
James Grugett
93b9ace477 Comment email: Subject no longer varies between questions so emails are threaded in gmail 2022-07-19 14:54:42 -05:00
Ian Philips
39c38a669e Referrals bug fix and attribute group 2022-07-18 10:40:44 -06:00
SirSaltyy
d012561c50
Create 500-mana.html (#658) 2022-07-18 15:13:16 +01:00
Ian Philips
906cfc29c8 Endswith=>includes to handle sort query in group chat 2022-07-18 07:59:21 -06:00
James Grugett
6d8ad74b4d Redeem shares of makers after sellshares 2022-07-16 13:11:13 -05:00
ingawei
7d24a3e4a2
Inga/manalink bug fixes (#653)
* fixed manalinks bug of claiming own manalink, and also rerouting to home upon claiming if not logged in
* no more multiple hardcoded manalink messages
2022-07-15 20:42:37 -05:00
Ian Philips
a6cbb6b759 Small notifications ux improvements 2022-07-15 11:53:30 -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
James Grugett
a9018d77c7 If a limit bet doesn't match any orders, don't update the contract, don't redeem shares. Perf win! 2022-07-14 18:01:35 -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
Ian Philips
deaa595f07 Exclude contract creator in both places 2022-07-14 09:32:50 -06:00
Ian Philips
eb6b1b9f89 Rename on-delete-group 2022-07-14 08:02:54 -06:00
Ian Philips
ee01328553 Remove group slugs from contracts on delete group 2022-07-14 07:53:41 -06:00
Sinclair Chen
664e55a40b
Add typing, pasting links (#646) 2022-07-13 15:56:15 -07:00
Sinclair Chen
f08d6bda93
when adding package, don't put ^ before version (#645) 2022-07-13 15:14:06 -07: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
Sinclair Chen
9a11f55762
Rich content (#620)
* Add TipTap editor and renderer components

* Change market description editor to rich text

* Type description as JSON, fix string-based logic

- Delete make-predictions.tsx
- Delete feed logic that showed descriptions

* wip Fix API validation

* fix type error

* fix extension import (backend)

In firebase, typescript compiles imports into common js imports
like `const StarterKit = require("@tiptap/starter-kit")`

Even though StarterKit is exported from the cjs file, it gets imported
as undefined. But it magically works if we import *

If you're reading this in the future, consider replacing StarterKit with
the entire list of extensions.

* Stop load on fail create market, improve warning

* Refactor editor as hook / fix infinite submit bug

Move state of editor back up to parent
We have to do this later anyways to allow parent to edit

* Add images - display, paste + uploading

* add uploading state of image

* Fix placeholder, misc styling

min height, quote

* Fix appending to description

* code review fixes: rename, refactor, chop carets

* Add hint & upload button on new lines

- bump to Tailwind 3.1 for arbitrary variants

* clean up, run prettier

* rename FileButton to FileUploadButton

* add image extension as functions dependency
2022-07-13 11:58:22 -07:00
James Grugett
50eee33a6e Redeem shares of makers after matching with limit bets 2022-07-13 12:51:19 -05:00