Commit Graph

110 Commits

Author SHA1 Message Date
Ian Philips
274f7fa849 Send market closed notifications every 5 days 2022-10-11 10:22:38 -06:00
Ian Philips
4f5c93be96 Badge notifications ui changes 2022-10-10 15:01:18 -06:00
Ian Philips
f26ba1c4a2
Award badges for market creation, betting streaks, proven correct (#891)
* Award badges for market creation, betting streaks, proven correct

* Styling

* Add minimum unique bettors for proven correct

* Add name, refactor

* Add notifications for badge awards

* Correct styling

* Need at least 3 unique bettors for market maker badge

* Lint

* Switch to badges_awarded

* Don't include n/a resolutions in market creator badge

* Add badges by rarities to profile

* Show badges on profile, soon on market page

* Add achievements to new user

* Backfill all users badges
2022-10-10 14:32:29 -06:00
James Grugett
310a41d63e Make loan and bet streak links hoverable in notifications 2022-10-08 12:51:58 -05:00
Ian Philips
79af4b2be0 Compare to the const ya sillyhead 2022-10-04 08:11:04 -06:00
Ian Philips
42cc07e4a6 Hide market title in notifs if grouped 2022-10-03 14:59:27 -06:00
Ian Philips
94ffac287e Payout resolution notifications styling 2022-09-26 15:57:38 -04:00
mantikoros
24cf42284f replace "predictor" => "trader" 2022-09-19 14:03:52 -05:00
mantikoros
fde90be5a2 fix resolve prob notification text 2022-09-17 15:01:45 -05:00
Ian Philips
a2d912bb5a Add more info to limit order notif 2022-09-16 09:02:58 -06:00
Ian Philips
61c672ce4c Show negative payouts 2022-09-15 15:50:26 -06:00
Ian Philips
7628713c4b Enrich contract resolved notification 2022-09-15 15:25:19 -06:00
Ian Philips
8c6a40bab7 Enrich limit order notification 2022-09-15 13:39:46 -06:00
Ian Philips
d6b0a1edc0 Betting streak reset to 7am UTC and store streak data on notif 2022-09-14 07:27:20 -06:00
Ian Philips
df3d7b591d Componentize notification line setting, don't use useEffect 2022-09-13 17:00:34 -06:00
Ian Philips
34bad35cb8 Betting=>predicting 2022-09-13 16:19:52 -06:00
Ian Philips
4398fa9bda Add new market from followed user email notification 2022-09-13 09:54:51 -06:00
Ian Philips
3a814a5b5d Detect just settings tab w/o section 2022-09-12 14:41:30 -06:00
Ian Philips
86422f90ea Set all overflow notifs to seen 2022-09-12 14:17:39 -06:00
Ian Philips
5c6328ffc2
[WIP] Fully customizable notifications (#860)
* Notifications Settings page working

* Update import

* Linked notification settings to notification rules

* Add more subscribe types

* It's alive... It's alive, it's moving, it's alive, it's alive, it's alive, it's alive, IT'S ALIVE'

* UI Tweaks

* Clean up comments

* Direct & highlight sections for notif mgmt from emails

* Comment cleanup

* Comment cleanup, lint

* More comment cleanup

* Update email templates to predict

* Move private user out of getDestinationsForUser

* Fix resolution messages

* Remove magic

* Extract switch to switch-setting

* Change tab in url

* Show 0 as invested or payout

* All emails use unsubscribeUrl
2022-09-12 10:34:56 -06:00
mantikoros
28af2063c3 "bet" => "trade" 2022-09-07 14:45:04 -05:00
Ian Philips
8759064ccb new bettors 2022-09-06 16:30:58 -06:00
Ian Philips
00ba3b0c48
Show avatars of tippers and unique bettors (#837)
* Show avatars of tippers and unique bettors

* Make transparent the avatar bg

* fix import
2022-09-01 16:23:12 -06:00
James Grugett
3660830ec1 Don't server side render Notifications page for improved perf 2022-08-31 15:41:34 -05:00
Ian Philips
a0402830c5
liking markets with tip/heart (#798)
* WIP liking markets with tip

* Refactor Userlink, add MultiUserLink

* Lint

* Lint

* Fix merge

* Fix imports

* wip liked contracts list

* Cache likes and liked by user ids on contract

* Refactor tip amount, reduce to M

* Move back to M

* Change positioning for large screens
2022-08-30 09:38:59 -06:00
James Grugett
9c15d5b96c
React-query-ify notifications (#812)
* Use single react query to subscribe to notifications

* Remove 'preferred' in variable names
2022-08-28 15:20:21 -05:00
James Grugett
31db330319 Show "(max)" on streak payout if it is the max payout 2022-08-26 11:38:08 -05:00
James Grugett
e5777f02d8 Expand notifications by default if <= 3 items 2022-08-26 00:00:44 -05:00
Ian Philips
6e3b8fdd4d Show old streak for old streak notifs 2022-08-25 05:10:38 -06:00
Ian Philips
465e219bfc Show old streak for old streak notifs 2022-08-25 05:10:24 -06:00
James Grugett
93739e7990 Fix betting streak number 2022-08-24 23:40:27 -05:00
James Grugett
cffd5dcd31 Weekly => daily loans 2022-08-24 22:03:07 -05:00
Ian Philips
bea94d58c5 Add extra text-sm 2022-08-23 07:55:26 -06:00
mantikoros
8ea9a79760 loan emoji 2022-08-22 10:31:23 -05:00
Ian Philips
571d3e71b5 Only show most recent streak notif, relative econ imports, pubsub emulator 2022-08-22 06:31:30 -06:00
Austin Chen
88bf678ce3
Allow custom environments to override any economic aspect (#787)
* Extract monetary constants to a single file economy.ts

* Add missing import

* Allow environments to override any econ variable

* Update imports

* Update more imports

* Fix import
2022-08-21 22:37:26 -07:00
James Grugett
8b7cd20b6f
Loans2: Bets return you some capital every week (#588)
* Remove some old loan code

* Almost complete implementation of updateLoans cloud function

* Merge fixes

* Use invested instead of sale value, check if eligible, perform payouts

* Run monday 12am

* Implement loan income notification

* Fix imports

* Loan update fixes / debug

* Handle NaN and negative loan calcs

* Working loan notification

* Loan modal!

* Move loans calculation to /common

* Better layout

* Pay back loan on sell shares

* Pay back fraction of loan on redeem

* Sell bet loan: negate buy bet's loan

* Modal tweaks

* Compute and store nextLoanCached for all users

* lint

* Update loans with newest portfolio

* Filter loans to only unresolved contracts

* Tweak spacing

* Increase memory
2022-08-22 00:22:49 -05:00
mantikoros
dd6c5dc97a betting streaks copy 2022-08-20 13:47:26 -05:00
Ian Philips
00c9fa61c3
betting streaks (#777)
* Parse notif, show betting streaks modal, schedule function

* Ignore streaks of 0

* Pass notifyFills the contract

* Turn 9am into a constant

* Lint

* Up streak reward, fix timing logic

* Change wording
2022-08-19 11:10:32 -06:00
Ian Philips
428d9a3692 Move avatar to below card on mobile 2022-08-15 13:49:33 -06:00
mantikoros
b57c84bbd9 notifications title/seo 2022-08-14 23:55:11 -05: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
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
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
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
Marshall Polaris
06948bb98b
Make setNotificationsAsSeen return a promise (#692) 2022-07-25 16:37:23 -07:00
mantikoros
d82c7d7f3e “added liquidity” ⇒ “added a subsidy” 2022-07-25 12:22:38 -07:00
mantikoros
163c990e9d "bettors" => "traders" 2022-07-22 12:03:33 -05:00
Marshall Polaris
bacd546e5d Fix unused import from Ian's code 2022-07-19 20:10:54 -07:00
Ian Philips
4aface583d Remove pesky loading spinner 2022-07-19 16:41:11 -06:00