Commit Graph

50 Commits

Author SHA1 Message Date
Sinclair Chen
fb0a09664e delete bannerUrl from user type 2022-10-10 13:51:27 -07: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
FRC
06571a3657
Flag incorrectly resolved markets, warn about unreliable creators (#945)
* Flag incorrectly resolved markets, warn about unreliable creators

* Address James' review nits

* Added a loading state and some copy-changes

* Fix missing refactor

* Fix vercel error

* Fix merging issues
2022-10-03 10:49:19 +01:00
Ian Philips
df316fc4da
Portfolio update emails (#928)
* Stats computing correctly

* Styles propagating - testing in prod now

* Formatting html

* Reset portfolio flag on mondays at 12am

* Add profit, styling

* More styling, less reports

* Cleanup

* Comments

* comment

* Try to send higher signal emails

* Send emails to proper email address
2022-09-26 17:49:06 -04:00
Ian Philips
6c3338f5d7 Remove unused unsubscribe attributes 2022-09-20 09:59:48 -04:00
mantikoros
24cf42284f replace "predictor" => "trader" 2022-09-19 14:03:52 -05:00
mantikoros
f71791bdd5 fix labels 2022-09-17 19:10:34 -05:00
Phil
52ecd79736
Twitch prerelease (#887)
* Bot linking button functional.

* Implemented initial prototype of new Twitch signup page.

* Removed old Twitch signup page.

* Moved new Twitch page to correct URL.

* Twitch account linking functional.

* Fixed charity link.

* Changed to point to live bot server.

* Slightly improve spacing and alignment on Twitch page

* Tidy up, handle some errors when talking to bot

* Seriously do the thing where Twitch link is hidden by default

* Fixed secondary Get Started button. Copy overlay and dock link now functional.

* Add/remove bot from channel working.

* Removed legacy Twitch controls from user profile.

* Links provided by dock/overlay buttons are now correct.

* Minor profile cleanup post merge.

* Fixed unnecessary relinking Twitch account when logging in on Twitch page.

* Added confirmation popup to refresh API key. Refreshing API key now requires a user to relink their Twitch account.

* Removed legacy twitch-panel.tsx

Co-authored-by: Marshall Polaris <marshall@pol.rs>
2022-09-16 08:43:49 -07:00
Ian Philips
e9f136a653 Single source of truth for predict 2022-09-15 09:12:56 -06:00
Ian Philips
3efd968058 Allow one-click unsubscribe, slight refactor 2022-09-14 17:17:32 -06:00
Ian Philips
7ba2eab65e Rename user notification preferences 2022-09-14 10:26:08 -06:00
mantikoros
a2d61a1daa
Twitch integration (#815)
* twitch account linking; profile page twitch panel; twitch landing page

* fix import

* twitch logo

* save twitch credentials cloud function

* use user id instead of bot id, add manifold api endpoint

* properly add function to index

* Added support for new redirect Twitch auth.

* Added clean error handling in case of Twitch link fail.

* remove simulator

* Removed legacy non-redirect Twitch auth code. Added "add bot to channel" button in user profile and relevant data to user type.

* Removed unnecessary imports.

* Fixed line endings.

* Allow users to modify private user twitchInfo firestore object

* Local dev on savetwitchcredentials function

Co-authored-by: Phil <phil.bladen@gmail.com>
Co-authored-by: Marshall Polaris <marshall@pol.rs>
2022-09-14 01:52:31 -07: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
James Grugett
c1287a4a25
Small updates to experimental home (#870)
* Line clamp question in prob change table

* Tweaks

* Expand option for daily movers

* Snap scrolling for carousel

* Add arrows to section headers

* Remove carousel from experimental/home

* React querify fetching your groups

* Edit home is its own page

* Add daily profit and balance

* Merge branch 'main' into new-home

* Make experimental search by your followed groups/creators

* Just submit, allow xs on pills

* Weigh in

* Use next/future/image component to optimize avatar images

* Inga/challenge icon (#857)

* changed challenge icon to custom icon
* fixed tip button alignment

* weighing in and trading "weigh in" for "trade"

* Delete closing soon, mark new as New for you, trending is site-wide

* Delete your trades. Factor out section item

* Don't allow hiding of home sections

* Convert daily movers into a section

* Tweaks for loading daily movers

* Prob change table shows variable number of rows

* Fix double negative

Co-authored-by: Ian Philips <iansphilips@gmail.com>
Co-authored-by: Austin Chen <akrolsmir@gmail.com>
Co-authored-by: ingawei <46611122+ingawei@users.noreply.github.com>
Co-authored-by: mantikoros <sgrugett@gmail.com>
2022-09-12 00:39:04 -05:00
James Grugett
849402ed70 Rearrange home sections. Load more in carousel. 2022-08-30 23:47:09 -05:00
mantikoros
03e07037ea
ban users from posting (#810) 2022-08-28 00:23:25 -05:00
Ian Philips
b9f0da9d3b Give all users 5 free markets 2022-08-25 05:51:56 -06:00
Ian Philips
f50b4775a1
Allow to follow/unfollow markets, backfill as well (#794)
* Allow to follow/unfollow markets, backfill as well

* remove yarn script edit

* add decrement comment

* Lint

* Decrement follow count on unfollow

* Follow/unfollow button logic

* Unfollow/follow => heart

* Add user to followers in place-bet and sell-shares

* Add tracking

* Show contract follow modal for first time following

* Increment follower count as well

* Remove add follow from bet trigger

* restore on-create-bet

* Add pubsub to dev.sh, show heart on FR, remove from answer trigger
2022-08-24 10:49:53 -06:00
Ian Philips
e1775681aa Add weekly email sent flag, filter out manifold grouped markets 2022-08-22 16:36:39 -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
Ian Philips
a0f62ba172
Markets emails (#764)
* Send out email template for 3 trending markets

* Rich text to plaintext descriptions, other ui changes

* Lint

* Filter for closed markets

* Change sign

* First order must be closeTime

* Send 6 emails, check flag twice

* Exclude contracts with trump and president in the name

* interesting markets email

* sendInterestingMarketsEmail

* Change subject line back

Co-authored-by: mantikoros <sgrugett@gmail.com>
2022-08-19 11:43:57 -06: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
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
ingawei
ae2e7dfe30
noobify welcome demo (#699)
* noobify welcome
* also beginning to add greyscale color scheme
2022-07-30 02:50:03 -05:00
Austin Chen
dcd2ccae1b Allow environments to override the referral bonus 2022-07-18 23:29:32 -07:00
Ian Philips
39c38a669e Referrals bug fix and attribute group 2022-07-18 10:40:44 -06:00
Ian Philips
a6cbb6b759 Small notifications ux improvements 2022-07-15 11:53:30 -06:00
Ian Philips
dd9d24e657 Show online users on desktop 2022-07-15 08:45:52 -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
Austin Chen
9839b7b5a4 Allow customizing starting balance & antes 2022-07-03 16:46:15 -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
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
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
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
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
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
mantikoros
b00814a8c4
Template emails (#185)
* unsubscribe from generic emails

* new welcome email

* fix from address

* thank you email

* one week bonus email
2022-05-11 10:51:58 -05: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
Marshall Polaris
bf8e09b6c1
Represent DB avatar URLs as non-null (#128) 2022-05-04 11:07:22 -07:00
James Grugett
cb7c8ba7c2 Send email to market creator on new answer 2022-02-23 00:05:04 -06:00
James Grugett
7522b6af3c Send emails for new comments on markets you commented on or created. 2022-02-22 20:35:07 -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
mantikoros
4528615863
Private user (#32)
* PrivateUser

* createUser: create private user; detect multiple signups

* include user properties in private user

* script: create private users

* unsubscribing from market resolution emails

* track total deposits
2022-01-18 21:36:46 -06:00
mantikoros
908c8c03e6
Create user cloud function (#31)
* createUser cloud function; change User object

* initial commit

* listenForLogin: avoid race condition

* createUser: allow capital letters in username

* remove debugging

* leaderboard: empty url for undefined avatar image
2022-01-18 01:18:38 -06:00
jahooma
56c7e2597d Schedule cloud function to update user metrics: totalPnL, creatorVolume 2022-01-17 15:39:34 -06:00
mantikoros
9a834526c0 formatting 2022-01-10 17:52:03 -06:00
mantikoros
b97a65cf2c refactor data structures, calculations to common directory 2022-01-10 15:07:57 -06:00