Commit Graph

846 Commits

Author SHA1 Message Date
Marshall Polaris
79be0c555b Fix tiny bug in auth context code 2022-08-12 13:45:38 -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
James Grugett
3cbf5a6f7d Always show search placeholder 2022-08-12 14:35:27 -05:00
Sinclair Chen
daba28423a
Improve create page UI (#746)
* Adjust create page styles

* Keep answers when switching market type
2022-08-11 14:41:21 -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
4e8b94a28c
Componentize confetti to isolate re-renders due to window size (#740)
* Componentize confetti to isolate re-renders due to window size

* Clean up debug logging
2022-08-11 12:55:25 -07:00
Marshall Polaris
ad75ecdc87
Move liquidity provision fetch down into ContractTabs (#741) 2022-08-11 12:53:54 -07:00
James Grugett
4d953d58a1 Move group chat back into a tab 2022-08-10 12:28:02 -05:00
mantikoros
63538ae925 referral link on user page, manalinks, market share dialog; native sharer on mobile 2022-08-09 21:51:08 -05:00
Marshall Polaris
c07daafb8d
Make homepage load user via SSR, pass it to contract stuff (#729) 2022-08-09 15:28:52 -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
5715b0e44a
Random contract page fixups (#712)
* Remove some divs and so on

* Correctly align bet avatars and text in feed

* Extract sidebar component on contract page
2022-08-09 13:25:42 -07:00
mantikoros
1e3c5cb936 add qr code to referrals 2022-08-09 12:27:52 -05:00
Marshall Polaris
e7f1d3924b
Fix up several pages to load user data on the server (#722)
* Fix up several pages to load user data on the server

* Add key prop to `EditUserField`
2022-08-08 22:43:04 -07:00
Marshall Polaris
5649161348
Pass page props user to auth provider if present (#724)
* Pass page props user to auth provider if present

* Rename `user` -> `serverUser`

* Don't load from local storage if server told us a user
2022-08-08 22:42:52 -07:00
Marshall Polaris
85e55312ca
What will be removed, is removed (#721) 2022-08-08 15:05:25 -07:00
James Grugett
98806a806f Fix query params on emulator/private instance 2022-08-07 18:07:36 -07:00
James Grugett
8fb3b42ea1 Default to trending. Fix close date being opposite 2022-08-07 17:48:43 -07:00
Sinclair Chen
5892ccee97
Rich text in comments, fixed (#719)
* Revert "Revert "Switch comments/chat to rich text editor (#703)""

This reverts commit 33906adfe4.

* Fix typing after being weird on Android

Issue: character from mention gets deleted. Most weird on Swiftkey:
mention gets duplicated instead of deleting.

See https://github.com/ProseMirror/prosemirror/issues/565
https://bugs.chromium.org/p/chromium/issues/detail?id=612446

The keyboard still closes unexpectedly when you delete :(

* On reply, put space instead of \n after mention

* Remove image upload from placeholder text

- Redundant with image upload button
- Too long on mobile

* fix dependency
2022-08-06 13:39:52 -07:00
Marshall Polaris
d43b9e1836
Vercel auth phase 2 (#714)
* Add cloud function to get custom token from API auth

* Use custom token to authenticate Firebase SDK on server

* Make sure getcustomtoken cloud function is fast

* Make server auth code maximally robust

* Refactor cookie code, make set and delete more flexible
2022-08-05 20:49:29 -07:00
James Grugett
e0196f7107 Rename file contracts-list to contracts-group 2022-08-05 17:46:32 -07:00
James Grugett
b3b06896be Add loading indicator when algolia search is initially loading 2022-08-05 17:44:55 -07:00
James Grugett
ced404eb74 Local search filters on groups, exclude contractIds 2022-08-05 12:01:16 -07:00
Ian Philips
60ebadbbe5 Add not about donating winnings to charity 2022-08-05 09:58:02 -06:00
mantikoros
1e66f4d140
Share row (#715)
* 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

* market share row

* Add lite market endpoint

* 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>

* 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>

* See challenges you've accepted too

* Remove max height

* 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

* 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

* Revert "Switch comments/chat to rich text editor (#703)"

This reverts commit f52da72115.

* merge conflict

* share modal

* merge issue

* eslint

* bigger link icion

Co-authored-by: Ian Philips <iansphilips@gmail.com>
Co-authored-by: James Grugett <jahooma@gmail.com>
Co-authored-by: SirSaltyy <104849031+SirSaltyy@users.noreply.github.com>
Co-authored-by: Sinclair Chen <abc.sinclair@gmail.com>
2022-08-05 00:22:45 -05: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
Ian Philips
912ccad530 Remove max height 2022-08-04 16:09:33 -06:00
Ian Philips
c93f9c5483 See challenges you've accepted too 2022-08-04 15:58:48 -06: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
James Grugett
7e46188107 Add lite market endpoint 2022-08-03 22:21:22 -07:00
Ian Philips
82419d0b92
Groups chat ux (#713)
* Add in group chat bubble

* Show chat bubble on nav with unseen notifs

* Spacing

* More spacing

* Remove chat tab

* Show chat on help/welcome/updates/features groups

* Cleanup

* Scroll with updated height
2022-08-03 15:38:35 -06:00
mantikoros
6563082746 move claim button 2022-08-02 15:22:53 -07:00
mantikoros
164d9ef079 manalinks: mention referral bonus 2022-08-02 15:22:53 -07:00
Marshall Polaris
b83caf4dd9 Just make me endpoint forward the backend response 2022-08-02 00:21:51 -07:00
Keri Warr
cfeb50826c
Add endpoint for reading currently authenticated user (#710) 2022-08-02 00:06:23 -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
ec84245dd4
Add some API endpoints for reading group info (#707) 2022-08-01 14:59:45 -07:00
Ian Philips
0819c3918f Most popular=> Trending 2022-08-01 09:03:46 -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
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
mantikoros
079a2a3936 eslint 2022-07-29 16:06:22 -07:00
mantikoros
779b6dfc0c manalink referrals 2022-07-29 15:09:48 -07:00
mantikoros
ada3f0787c create: add bottom margin 2022-07-28 11:44:07 -07: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
James Grugett
b1c4f018f9 Expose cancel bet api 2022-07-27 17:38:25 -07: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
Ian Philips
af25a6c795 Allow adding multiple contracts to group in modal 2022-07-25 18:27:43 -07:00
Marshall Polaris
06948bb98b
Make setNotificationsAsSeen return a promise (#692) 2022-07-25 16:37:23 -07:00