Commit Graph

1192 Commits

Author SHA1 Message Date
Peter Zimon
20007db0c7 Replaced site logo span with img 2020-09-18 09:34:45 +02:00
Rish
e3e79d5c5d v0.9.1 2020-09-17 21:17:43 +05:30
Peter Zimon
4180727d29 Cleanup unnecessary containers
no refs.
- removed unnecessary `<div>`s
2020-09-17 16:19:53 +02:00
Rish
fb13d12015 Fixed stripe checkout not working on plan upgarde
no issue

- Incorrectly passed plan name was causing bad stripe request
2020-09-17 19:25:05 +05:30
Peter Zimon
5caa8433d9 Fixed and cleaned input field style 2020-09-17 15:54:44 +02:00
Peter Zimon
e9a27cdafc Fixed background color of inputs 2020-09-17 15:47:15 +02:00
Peter Zimon
ba7c66cb29 Fixed regression of single plan checkbox 2020-09-16 21:30:20 +02:00
Rish
454c01f2ae v0.9.0 2020-09-16 23:44:18 +05:30
Rish
ef235ad148 Updated plan update start date
no issue

- Updates the new plan's start date based on billing interval change
- If current and new billing interval is same, plan starts at period end, immediately otherwise
2020-09-16 23:43:19 +05:30
Rish
1baa21ddab Removed preceding 0 in date string
no issue

- Removes preceding 0 in `date` section of a date string
For ex. - 05 June -> 5 June
2020-09-16 23:35:13 +05:30
Rish
fa7258b247 Refactored plan upgrade flow for free members
no issue

- Refactors the plan upgrade flow for a free member
- Removes confirmation for free member and brings back checkboxes
- Takes straight to stripe checkout on plan confirmation
2020-09-16 23:03:59 +05:30
Rish
8729740c96 Some refinements 2020-09-16 23:03:59 +05:30
Peter Zimon
26c921d3cd Updated mobile styles for footers
no refs.
- fixed footer for signup and signin page considering various Portal settings
2020-09-16 18:12:59 +02:00
Peter Zimon
ee1d1c80f3 Updated responsive sizes for account home 2020-09-16 17:20:06 +02:00
Peter Zimon
8bbbfd9e49 Updated copy on free account home 2020-09-16 16:04:00 +02:00
Peter Zimon
7985c658fe Refined plan change confirmation
no refs.
- refined copy and design for plan change and confirmation
2020-09-16 16:00:48 +02:00
Rish
a32683fbb0 Updated change Plan UX
no issue

- Updates various flows to update/change plan for a member
- Adds a confirmation step for different change plan actions
- Adds new helpers for plans and members
- Updates Account plan page to use more streamlined components
- Fixed lint
2020-09-16 13:05:24 +05:30
Peter Zimon
fcd266e16a Fixed animation bug for mobile 2020-09-16 07:28:42 +02:00
Peter Zimon
9744b449bb Fixed input border for mobile 2020-09-16 07:21:06 +02:00
Peter Zimon
c4a628ebac Updated cancel confirmation copy 2020-09-15 17:37:38 +02:00
Peter Zimon
2dd9190bf2 Style updates for change plan
no refs.
2020-09-15 17:16:45 +02:00
Peter Zimon
59787099e2 Updated icon 2 2020-09-15 14:49:47 +02:00
Peter Zimon
6c1c2ee0f6 Updated portal icons
no refs.
2020-09-15 14:49:47 +02:00
Rish
51382bbee9 Updated account plan page to include confirmation screen
no issue

Adds confirmation screen on plan change/cancel on the plans screen
2020-09-15 18:17:14 +05:30
Peter Zimon
856f56f04e Added signup spacing logic
no refs.
- added logic to handle spacing on signup screen based on Portal settings
2020-09-15 13:32:44 +02:00
Peter Zimon
533b3fcbbb Added dynamic popup width
no refs.
- set popup width for signup and signin pages based on the number of plans
2020-09-15 12:22:13 +02:00
Peter Zimon
9a233e8210 Mobile size fixes
no refs.
- fixed account home margin
- fixed change plan bottom margin
2020-09-15 11:47:48 +02:00
Peter Zimon
6bf8451231 Removed debugger 2020-09-15 11:40:44 +02:00
Peter Zimon
6d45b0a295 Removed padding on account home + debugger cleanup
no refs.
2020-09-15 11:39:29 +02:00
Rish
3365e513d7 Refactored Account plan page into smaller components
no issue
2020-09-15 15:05:02 +05:30
Peter Zimon
8f9cef5a68 Fixed merge error 2020-09-15 15:05:02 +05:30
Peter Zimon
fab3e3ff3b Added back button and rearranged logout 2020-09-15 15:05:02 +05:30
Peter Zimon
24a29773e2 Removed cancel/confirm button from change plan 2020-09-15 15:05:02 +05:30
Peter Zimon
878bc146c2 Updated placement of continue sub button 2020-09-15 15:05:02 +05:30
Rish
3111ff9dde v0.8.25 2020-09-14 18:19:27 +05:30
Peter Zimon
36135588a6 Added responsive styles to logged out state
no refs.
- changed popup container to cover the whole screen on smaller screen sizes
- updated sizes on signup and signin screen for mobile devices
2020-09-11 18:20:01 +02:00
Peter Zimon
7ff541bf04 Updated z-index of iframes 2020-09-11 17:18:18 +02:00
Peter Zimon
740192f077 Restructure containers for responsive sizes
no refs.
Prepared the container system to responsive sizes.
- added inner scrollable container for all content
- made footer sticky
- set max height for each screen
2020-09-11 16:50:16 +02:00
Peter Zimon
9de17e2e2d Updated site title line height and spacing 2020-09-11 14:15:06 +02:00
Peter Zimon
bd4fc4e867 Updated site title size and alignment 2020-09-11 14:08:24 +02:00
Peter Zimon
47ceb55c5e Updated signup page for single plan case
no refs.

For when a signle plan is enabled in Portal settings:
- removed selected style from the plan on the signup page
- updated the width of the popup
2020-09-10 14:47:13 +02:00
Renovate Bot
9b23da05e2 Update dependency @testing-library/user-event to v12.1.4 2020-09-09 22:03:53 +00:00
Rish
dfa3160b6f v0.8.24 2020-09-08 20:52:40 +05:30
Rish
e3a957deb6 Added members support address from site data
closes https://github.com/TryGhost/members.js/issues/90

- Uses new members support address from site data for "Contact Support" button
2020-09-08 20:51:43 +05:30
Renovate Bot
d32a19f66c Update dependency @testing-library/react to v11 2020-09-08 18:59:36 +05:30
Rish
01cb5567ad Fixed esc not working for newsletter switch
refs https://github.com/TryGhost/members.js/issues/95

- Newsletter switch was taking over the focus and Esc didn't work on click, fixes by preventing the default behavior of switch
2020-09-08 18:52:20 +05:30
Rish
21a7d61c85 Updated newsletter updated messaging
refs https://github.com/TryGhost/members.js/issues/95

- Updates the newsletter status update as part of existing label
2020-09-08 18:43:50 +05:30
Rish
baf15f577c Fixed tests
no issue

- Fixed signup page test using updated label for button
2020-09-08 18:32:42 +05:30
Rish
62d572613f Updated esc key handling on iframe
no issue

- Updates the key event on owner document from the node
2020-09-08 18:29:59 +05:30
Peter Zimon
c90a947d94 Hid free plan if free is the only enabled plan
no refs.
- hides free plan if that's the only enabled plan
- refined copy for sign up button when no plans are available (e.g. Stripe is not set up or free is the only plan)
2020-09-08 14:56:18 +02:00
Rish
593e139860 Refactored site plan handling on plans page
no issue

- Extracts the account plans structure formation to helper from account plans page to make it reusable
2020-09-08 17:55:47 +05:30
Rish
e33c91f638 Added newsletter subscription status update
refs https://github.com/TryGhost/members.js/issues/95

- Adds a small update notification about newsletter subscription status update on toggle
2020-09-08 17:55:47 +05:30
Rish
af160b19f1 Fixed custom trigger button event listener removal
no issue

- Fixes event listeners for custom trigger button not being removed on unmount and initial setup
2020-09-08 17:55:47 +05:30
Rish
2dee51ee80 Handled closing popup with Esc key
refs https://github.com/TryGhost/members.js/issues/95

- Hitting Esc key closes the Portal popup as long is its not inside any `<input>` field for entering data
2020-09-08 17:55:47 +05:30
Rish
cd85e839ef Refactored account home page
no issue

- Cleans up the code structure used to render different sections for paid members on account home
- Adds new member helper method to check if the member is complimentary or not
2020-09-08 17:55:47 +05:30
Peter Zimon
a0fdb1d21f Removed welcome message if Stripe is not set up 2020-09-08 13:51:31 +02:00
Peter Zimon
c28184263d Removed plan and billing for complimentary
no refs.
- removed the ability to change plan and billing info section from account home for members with complimentary plan
- refined copy for plan section
2020-09-07 17:16:17 +02:00
Peter Zimon
7c8e3e6f80 Removed title tag from svgs 2020-09-04 16:47:35 +02:00
Peter Zimon
995bef0f57 Added default text if name is missing 2020-09-04 15:28:22 +02:00
Rish
c94be8cea7 v0.8.23 2020-09-04 17:20:50 +05:30
Rish
db9ca1322e Updated usage script to include site attribute
no issue

- To correctly inject the members.js script to any theme, it needs to know the correct site URL to access Ghost APIs.
- `data-ghost` attribute is needed on the script to define the correct Site url
2020-09-04 17:19:37 +05:30
Rish
1c2890036b Reset any "last page" state on closing popup
no issue

- We don't want to keep any old "last page" state for the popup once its closed, which is used to determine which page to to go back to with "Cancel"
- If no "last page" is found, going back closes the popup instead which is expected behavior
2020-09-04 13:07:08 +05:30
Peter Zimon
fc490f9ae5 Fixed outline for buttons 2020-09-04 08:42:07 +02:00
Rish
7d0f12395a Added UI refinements for free member plan page
no refs

-  Changed title to "Choose your subscription"
- The primary button label changed to "Continue"
2020-09-03 21:07:20 +05:30
Rish
5083094308 Updated cancel button to close modal when no back
no refs

- Cancel button previously was not closing the modal where no last page was found to go back to, fixed
2020-09-03 21:06:21 +05:30
Rish
3a01015618 v0.8.22 2020-09-03 17:15:24 +05:30
Rish
b563ab05a9 Fixed default plan for complimentary members
refs https://github.com/TryGhost/members.js/issues/77

- Fixes members on complimentary plan not having a default plan selected on account plan page
2020-09-03 17:13:38 +05:30
Rish
a8d2c03f9c Fixed class attribute usage
no issue

- React expects class attribute on element to be defined as `className`
2020-09-03 17:11:42 +05:30
Rish
b2dae5fc44 Added fixture for complimentary member
no issue

- Adds a fixture for complimentary member for testing
2020-09-03 17:10:47 +05:30
Rish
4474a21a4d Fixed incorrect usage of class
no refs

- React expects `class` on elements to be defined as `className`
2020-09-03 16:27:35 +05:30
Rish
23e0a76ea3 v0.8.21 2020-09-02 12:26:30 +05:30
Rish
4490586de8 Added new member fixture for preview mode
no issue

- Admin Preview mode has its own member fixture now to represent logged in member behavior
2020-09-02 12:25:36 +05:30
Peter Zimon
f2cc49c00a Updated cancel/continue styles 2020-09-02 08:12:07 +02:00
Peter Zimon
eb5e64ad36 Removed oldschool divider line in header 2020-09-02 07:59:57 +02:00
Renovate Bot
76e6f9f28b Update dependency @testing-library/user-event to v12 2020-09-02 00:15:52 +05:30
Rish
6e2ce8fad3 v0.8.20 2020-09-01 21:01:55 +05:30
Rish
819031e909 Fixed tests
no refs
2020-09-01 21:01:12 +05:30
Rish
8648bf111b Restructured dev mode data to top
no refs

- Updates dev mode data structure to top of the page for easy access and changes
2020-09-01 21:01:12 +05:30
Rish
a39587c495 Updated cancel subscription flow
no refs

- Adds continue subscription option on account home
- Cleans up methods to render cancel continue behavior
2020-09-01 21:01:12 +05:30
Rish
cfc96aa603 Added subscription cancel/continue button
no issue

- Allows member to cancel or continue their subscription at period end
- Updates subscription cancellation setting in stripe
2020-09-01 21:01:12 +05:30
Rish
9b899d4c54 Added subscription cancel action handler
no issue

- Adds cancel/continue action handler for a subscription
2020-09-01 21:01:12 +05:30
Rish
7aa3a448f7 Fixed action reset timeout causing incorrect state
no issue

- Previously, a timeout after 5s for previous action was resetting the action state, but didn't take into account any consecutive action and reset state incorrectly
- Timeout is reset on every action so only the last action outside timelimit causes action state to reset
2020-09-01 21:01:12 +05:30
Renovate Bot
3a5a3527bb Lock file maintenance 2020-09-01 12:48:13 +05:30
Rish
7a73869b75 Fixed tests
no issue
2020-08-27 21:40:43 +05:30
Peter Zimon
97ac0f01ec Refined primary button
no refs.
- increased the default height of primary button
- added loading spinner to sign in and sign up button loading state
2020-08-27 17:58:36 +02:00
Peter Zimon
2e429e8c8c Updated sign up/in button height 2020-08-27 17:08:49 +02:00
Rish
bd844c3568 v0.8.19 2020-08-26 00:52:17 +05:30
Rish
e50576b420 Updated cancel button behavior for account pages
no issue

- By default, Cancel button on Account plan/profile pages goes back to last open page like accountHome
- In case the page is opened directly via custom trigger button, there is no last open page so the popup didn't close
- Closes popup for back actions in case no last page is found
2020-08-26 00:50:55 +05:30
Rish
c721eda332 v0.8.18 2020-08-26 00:34:55 +05:30
Rish
f647f5e3d9 Fixed lint warnings
no issue
2020-08-26 00:34:21 +05:30
Rish
df6448cf84 Fixed flickering for signup/signin button state on success
refs https://github.com/TryGhost/members.js/issues/77

Weird behavior -
(1) enabled "Send login link" -> (2) disabled "Sending" -> (3) enabled "Send login link" -> (4) check your inbox page.

New expected behavior -
 (1) -> (2) -> (4)
2020-08-26 00:31:30 +05:30
Rish
c64e9181c6 Fixed form error handling update
no issue

- Form was not updating the error messages onBlur
- Updates error message handling and form submit
2020-08-26 00:24:34 +05:30
Renovate Bot
7a74ac21a0 Update dependency @testing-library/jest-dom to v5.11.4 2020-08-25 03:05:29 +00:00
Renovate Bot
dda2f84c16 Update dependency @testing-library/react to v10.4.9 2020-08-24 01:05:44 +00:00
Peter Zimon
1ff013d3f5 Refined disabled primary button style 2020-08-19 18:33:04 +02:00
Peter Zimon
3ad708da9d Fixed width of primary button 2020-08-19 18:26:03 +02:00
Peter Zimon
abad1d4e6b Refined subscribe button height 2020-08-19 18:12:02 +02:00
Rish
d863496bbe v0.8.17 2020-08-17 09:51:34 +05:30
Rish
ffb9e95594 Removed Stripe JS script load
no issue

- Stripe JS is enabled as part of members in ghost_head based on stripe connection
- Portal should expect Stripe to be already added to page via Ghost_Head, so removes explicit check and load here
2020-08-17 09:50:51 +05:30
Renovate Bot
040efb77cf Update dependency react-scripts to v3.4.3 2020-08-14 16:04:34 +00:00
Renovate Bot
b7002ef34e Update dependency @testing-library/jest-dom to v5.11.3 2020-08-14 15:06:07 +00:00
Rish
25f5e66268 Removed unused ref and styles
closes https://github.com/TryGhost/members.js/issues/76

- Removes unused ref calculation for height as its moved inline with frame changes
2020-08-13 18:11:01 +05:30
Renovate Bot
790057bfa8 Update dependency react-scripts to v3.4.2 2020-08-12 12:04:49 +00:00
Renovate Bot
90161206e4 Update dependency @testing-library/react to v10.4.8 2020-08-07 17:05:18 +00:00
Rish
ce7cf575ed v0.8.16 2020-08-07 21:51:29 +05:30
Rish
19d39babc8 Fixed lint
no issue
2020-08-05 14:28:20 +05:30
Rish
95ec778920 Fixed tests
no issue

- Updated tests for account plan and profile pages
2020-08-05 13:33:49 +05:30
Rish
1e2fe6be48 Updated default selected plan for paid/free members
refs https://github.com/TryGhost/members.js/issues/77

When changing plan from the account page, there should always be a default selected plan:

- for free members the first plan,
- for paid members the current plan
2020-08-05 13:14:39 +05:30
Rish
e0ac0652db Updated discount value logic for yearly plan
refs https://github.com/TryGhost/members.js/issues/77

- Updated discount value for yearly plan to be only applied if monthly plan is visible
- Doesn't make sense to show discount if no monthly plan is visible
2020-08-05 13:01:01 +05:30
Rish
308297b238 Updated account profile to redirect to home on save
refs https://github.com/TryGhost/members.js/issues/77

When clicking on "Save" on account profile, the user should be redirected to the account home page in case of successful save.
2020-08-05 12:57:58 +05:30
Rish
7de783a252 Updated default page to always open from trigger button
refs https://github.com/TryGhost/members.js/issues/77

- Portal button should always show the Subscribe/Account Home screen based on logged-in status
- Resets state to expected page on every open toggle
2020-08-05 12:56:46 +05:30
Renovate Bot
bb7dba6fea Update dependency @testing-library/jest-dom to v5.11.2 2020-07-31 16:04:55 +00:00
Rish
b33b95c5e7 v0.8.15 2020-07-30 20:35:55 +05:30
Peter Zimon
4f465aa127 Refined error styles 2020-07-30 15:26:32 +02:00
Rish
3249226876 Fixed tests and form validation errors data
refs https://github.com/TryGhost/members.js/issues/78

- Fixed error object post validation to not include keys for fields without error
- Fixed tests for Signup/Signin to use correct member context
2020-07-30 16:20:15 +05:30
Peter Zimon
f356fe621f Updated trigger button position 2020-07-30 12:24:12 +02:00
Peter Zimon
06471449f1 Added transitions to top buttons 2020-07-30 12:24:12 +02:00
Peter Zimon
c99c4da8fd Set button min-width 2020-07-30 12:24:12 +02:00
Rish
290a7493f2 Updated error handling for on blur
refs https://github.com/TryGhost/members.js/issues/78

- Updates error handling to only trigger error for specific field on blur instead of all fields
2020-07-30 15:49:56 +05:30
Peter Zimon
64f80ed1b0 Moved logout to account home page
no refs.
- moved logout back to account home as that's the only place it's used
- removed "Settings" button from tests
2020-07-30 11:20:47 +02:00
Peter Zimon
848c0d8ec7 Moved logout to top left
no refs.
- logout button was too prominent so I moved it to the top left as an icon (todo: show tooptip on hover)
2020-07-29 18:06:48 +02:00
Peter Zimon
2ad2098bba Unify free + paid account home pages
no refs.
- used similar design patterns for free and paid home pages
2020-07-29 16:54:20 +02:00
Peter Zimon
bafdac7bd2 Refined logo position 2020-07-29 16:10:48 +02:00
Peter Zimon
3eaa30e1f3 Refined background color + plan label 2020-07-29 16:04:47 +02:00
Peter Zimon
a37e682f6b Applied custom preview style + fixed account
no refs.
- applied custom style for popup container and background for Admin preview to make the UX more focused
- fixed dummy paid member as the preview content of the account home page
2020-07-29 15:51:55 +02:00
Peter Zimon
9efede024a Added discount to Account/Plan page
no refs.
- moved discount calculation to util
- added discount to account/plan page to make it consistent with signup
2020-07-29 12:35:19 +02:00
Peter Zimon
6af7ab674a Restructured links page layout
no refs.
- used table for link page structur
2020-07-29 12:11:07 +02:00
Peter Zimon
a1a51b5704 Fix trigger icon style bug 2020-07-28 17:15:04 +02:00
Peter Zimon
e877dd5e37 Updated trigger button design
no refs.
- added separate trigger button styles file
- restructured and updated styles
2020-07-28 17:02:17 +02:00
Rish
f47cacd299 Fixed lint
no issue

- Fixed useless-escape in validator email regex
2020-07-28 18:37:06 +05:30
Rish
c2d52681ed Added error handling for plan checkout
refs https://github.com/TryGhost/members.js/issues/78

- Adds error handling for plan checkout when trying to checkout existing plan
2020-07-28 18:19:03 +05:30
Rish
3430cbf3bb Added error handling for input fields
refs https://github.com/TryGhost/members.js/issues/78

- Adds error handling framework for input fields in forms - Signup/Signin/Account Profile
- Shows required and invalid email errors for input fields
2020-07-28 18:19:03 +05:30
Peter Zimon
32149a5d48 Added new default button icons 2020-07-28 13:34:32 +02:00
Rish
4b29d0ce15 Fixed email subscription label on account home
no issue

- Hardcoded label was being used on account home for newsletter subscriptions status
- Updated to use label based on subscribed status, same as profile page
2020-07-24 21:04:45 +05:30
Rish
a51052c320 v0.8.14 2020-07-24 15:39:58 +05:30
Peter Zimon
e8279c132a Cleaned up CSS property order 2020-07-24 11:30:20 +02:00
Peter Zimon
7e7277544e Refined site logo spacing 2020-07-24 11:16:20 +02:00
Peter Zimon
e8ea5fef83 Added CSS variable colors 2020-07-24 11:06:56 +02:00
Peter Zimon
5484d5e2d8 Cleaned up style attributes 2020-07-24 10:46:13 +02:00
Peter Zimon
e1640740f4 Added semantic HTML to pages 2020-07-24 10:37:39 +02:00
Peter Zimon
be016409d0 Cleaned up all tachyons styles 2020-07-24 10:22:09 +02:00
Peter Zimon
9e001fa8a9 Cleaned up HTML attribute orders 2020-07-24 10:03:48 +02:00
Peter Zimon
b035a0ae57 Added appearance animation
no refs.
- restructured iframe hierarchy
- added appearance animation
2020-07-23 19:01:15 +02:00
Rish
6fe329bdb0 v0.8.13 2020-07-23 20:55:48 +05:30
Rish
c2ee482293 Updated publication image in popup header to use icon
closes https://github.com/TryGhost/members.js/issues/72

- Portal previously user publication logo as header image on logged out pages
- Replaces `logo` setting with publication `icon` for header image
2020-07-23 17:12:57 +05:30
Peter Zimon
14998061bd Fixed signin heading spacing 2020-07-23 12:33:27 +02:00
Peter Zimon
a95262a963 Fixed input field focus style bug 2020-07-23 12:15:30 +02:00
Peter Zimon
1aa9652970 Fixed signin page test 2020-07-23 12:05:55 +02:00
Peter Zimon
849ecae000 Updated signup, signin, magic link pages designs
no refs.
- added envelope to magic link page
- removed label and divider on signup page
- refined close icon color
2020-07-23 11:57:07 +02:00
Peter Zimon
ce47f3ba48 Fix account home test 2020-07-23 11:39:48 +02:00
Peter Zimon
4dcdfb7cad Updated paid and free account design
no refs.
- updated design of account page to use global list styles for paid members
- removed "Contact support" from free members
2020-07-23 11:33:41 +02:00
Peter Zimon
c3cb46da02 Account page refinements
no refs.
- removed back button from detail screens
- refined layout
- made switch smaller
2020-07-22 17:42:42 +02:00
Peter Zimon
d649605f22 Refined popup width 2020-07-22 17:15:33 +02:00
Peter Zimon
aaf37d046c Refined plan pricing section design 2020-07-22 17:11:14 +02:00
Rish
2de8c376f3 v0.8.12 2020-07-22 16:22:21 +05:30
Rish
2578856c8d Updated portal button icon handling
no issue

- Added default icon svgs for button icon
- Updated rendering for default button icon
2020-07-22 16:09:59 +05:30
Peter Zimon
0486f04c7d Added breakline in free plan description 2020-07-22 10:50:24 +02:00
Peter Zimon
31407ba6a3 Fixed plan detail spacings 2020-07-22 10:47:39 +02:00
Peter Zimon
933fbfb079 Refined checkmark size 2020-07-22 10:45:22 +02:00
Peter Zimon
f25d5b2e20 Fixed switch UI bugs
no refs.
- fixed switch basic styles
- applied brandcolor to switch ON style
- fixed account page layout bug
2020-07-22 10:28:12 +02:00
Peter Zimon
741a1d1942 Added checkmark styles to plan selector 2020-07-22 10:13:23 +02:00
Peter Zimon
b2bfca4d0b Aligned plan section to center 2020-07-22 10:00:13 +02:00
Rish
8c98bf753e v0.8.11 2020-07-22 13:11:25 +05:30
Peter Zimon
9969276d37 Plan selection refinements 2020-07-21 17:06:48 +02:00
Peter Zimon
4173a921ae Added basic plan selection styles
no refs.
2020-07-21 17:03:51 +02:00
Peter Zimon
29abe4688f Basic styles for magic link page 2020-07-21 16:03:35 +02:00
Peter Zimon
2094a0950a Basic styling for signin page
no refs.
2020-07-21 15:58:47 +02:00
Peter Zimon
263f00bdd2 Basic signup page styling
no refs.
- applied basic styling to signup page
2020-07-21 15:43:01 +02:00
Rish
b86ea31079 Removed extra commented code
no issue

- Removes commented out code
2020-07-21 17:05:21 +05:30
Rish
7b5ee1ec9d Fixed lint 2020-07-21 17:03:57 +05:30
Rish
0e30b63f62 Refactored app setup to more modular structure
no issue

- Adds new mode check util for dev, preview and test, cleaned up manual checks
- Extracts Pages setup to its own file allowing common use
- Extracts action handling to its own file for neater structure
- Breaks up main App.js into proper methods for data fetching across usecases
- Adds better handling for App context through state
- Fixed trigger button test
2020-07-21 16:43:13 +05:30
Peter Zimon
47e7b86637 Applied brandcolor to account icon 2020-07-21 11:45:19 +02:00
Peter Zimon
2449991847 Added icon to 'Back' button 2020-07-21 11:26:39 +02:00
Peter Zimon
e7459437cb Added brand color CSS variable
no refs.
- added brand color CSS variable to iframe styles so that it's possible to use on UI elements
2020-07-21 11:06:11 +02:00
Peter Zimon
94093a2041 Refined paid account styles 2020-07-21 10:40:39 +02:00
Peter Zimon
73ee017b12 Removed paddings in plans page
no refs.
2020-07-20 18:03:34 +02:00
Peter Zimon
9f01f70777 Applied basic styles to account profile
no refs.
2020-07-20 17:57:56 +02:00
Peter Zimon
45c6dd3b8b Updated paid account styles
no refs.
- added basic styling to paid account settings styles
2020-07-20 17:33:10 +02:00
Peter Zimon
e45663dcb0 Added free account home screen styles
no refs.
- updated inline styles to CSS classes for free account home screen
2020-07-20 16:21:14 +02:00
Peter Zimon
cfe6829538 Changed style namespace
no refs.
- changed style namespace from `ghp` to `gh-portal`
2020-07-20 16:05:27 +02:00
Peter Zimon
eb8ad7b493 Added account home CSS styles
no refs.
- added styles for free account home screen
2020-07-20 16:02:58 +02:00
Peter Zimon
81ea9427f2 Updated switch and button styles
no refs.
- applied namespace to switch and button styles
2020-07-20 15:34:48 +02:00
Peter Zimon
5021689e16 Cleaned up popup modal styles
no refs.
- moved a couple of styles that are inside the iframe to CSS classes
2020-07-20 15:32:00 +02:00
Peter Zimon
2b49f6d08a Distributed CSS in JS styles to components
no refs.
- moved switch and action button styles to their respective components to tidy up the style structure
2020-07-20 14:52:47 +02:00
Peter Zimon
d0b9ff40f3 Added global style for main action button
no refs.
2020-07-17 14:52:55 +02:00
Peter Zimon
a52afa8c2a Updated basic styles for Account home page
no refs.
- applied layout, typography, color basics
2020-07-17 14:36:56 +02:00
Rish
d8cd5d1860 v0.8.10 2020-07-16 12:48:06 +05:30
Rish
d240b85319 Fixed empty member for logged in state
no issue

- Fetching member for preview or dev mode was overwtiting member as null for prod
- Fixes by returning default member state for non preview/dev mode
2020-07-16 12:47:19 +05:30
Rish
4eec6f31ec Fixed tests
no issue

 - Fixed signup test with correct plan value
2020-07-16 12:11:01 +05:30
Rish
398d851e7b v0.8.9 2020-07-16 12:09:10 +05:30
Rish
3b8b2c3f2a Updated development mode to handle account pages
no issue

- Allows development mode to open account pages with dummy member for testing
2020-07-16 12:08:24 +05:30
Rish
9ccbef5db1 Fixed overflow for portal button
refs https://github.com/TryGhost/members.js/issues/66

- Portal button showed scrollbars in some OS/browsers combination
- Hides overflow for portal button as we don't show scroll for any case
2020-07-16 12:07:35 +05:30
Rish
322096db5a Fixed default plan selection for signup page
closes https://github.com/TryGhost/members.js/issues/68

Signup screen can have any combination of available plans out of 3 currently allowed - free, monthly, yearly. This fix

- Always sets a default plan on screen based on which plans are available
- Uses `Free` as default if all plans are available, falls back to first plan in list otherwise
2020-07-16 11:57:19 +05:30
Renovate Bot
792b698d87 Update dependency @testing-library/jest-dom to v5.11.1 2020-07-15 15:05:12 +00:00
Renovate Bot
629f910615 Update dependency @testing-library/react to v10.4.7 2020-07-15 14:05:01 +00:00
Renovate Bot
bb6de1c31d Update dependency @testing-library/react to v10.4.6 2020-07-13 19:04:57 +00:00
Rish
4c43a1bc9e Fixed member state for portal preview page
closes https://github.com/TryGhost/members.js/issues/67

- Portal preview state was incorrectly adding logged-in member state
- Updates member state to be used only for account pages
2020-07-13 17:48:34 +05:30
Rish
9da9c3a21e v0.8.8 2020-07-09 11:09:28 +05:30
Rish
e721d9242b Handled trailing slash for site url
no issue

- Site url might be added with trailing slash, which causes site apis to be called with double slash
- Removes trailing slash from siteUrl if present
2020-07-09 11:08:52 +05:30
Renovate Bot
db6e02b3fa Update dependency @testing-library/react to v10.4.5 2020-07-08 19:14:19 +00:00
Rish
797f784296 v0.8.7 2020-07-08 20:54:41 +05:30
Rish
a6ab7fd626 Fixed null checks for accent color
no issue

- Fixes null checks for accent color
2020-07-08 20:54:10 +05:30
Rish
4b28df8506 v0.8.6 2020-07-08 10:43:09 +05:30
Rish
01423f974b Fixed page path set for links
no issue

- Fixes incorrect page path set for different links
2020-07-08 10:42:28 +05:30
Rish
ad5d05c023 v0.8.5 2020-07-08 10:38:50 +05:30
Rish
9eb1df17d1 Fixed link page urls with extra slash
no issue

- Fixes extra slash in link values on Link page for popup states
2020-07-08 10:37:59 +05:30
Rish
9ac11c562e Added check for preview mode to allow mock pages
no issue

- By default, we have guards to allow pages based on logged in state
- For preview mode, we switch off this guard to allow signin/signup pages to open
2020-07-08 10:37:28 +05:30
Rish
df1952ba01 v0.8.4 2020-07-08 10:26:55 +05:30
Rish
2e0a3d87ad Updated readme
no issue

- Updated readme to reflect correct custom data attribute
2020-07-08 10:26:14 +05:30
Rish
c1eb4e6540 Updated custom data attribute name and value
no issue

- Adds guard to open right page based on member logged in state from data attribute
- Updated data attribute name to `data-portal` and values same as link handling
2020-07-08 10:25:57 +05:30
Rish
2ed7ebb03d Fixed path handling for direct page links
no issue

- Updates handling for direct links to open specific pages
- Added guard for member not logged in for account pages
2020-07-08 10:05:21 +05:30
Rish
439761e992 v0.8.3 2020-07-07 19:57:44 +05:30
Rish
14d92e1c52 Handled card info for complimentary plan
closes https://github.com/TryGhost/members.js/issues/52

- No card details are on file for complimentary plan, show Complimentary instead
2020-07-07 19:56:53 +05:30
renovate[bot]
6106219123 Lock file maintenance (#62)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-07-07 19:53:48 +05:30
Rishabh Garg
fb6a2c950f Added links page and look feel settings handling (#64)
no issue

- Handles new look feel settings for portal icon button
- Adds auto width calculation for portal button based on text
- Adds new link page for portal links and data attributes
- Added contrast color calculation for accent color complimentary text
- Added copy text utility for allowing copy to clipboard
2020-07-07 19:53:26 +05:30
Renovate Bot
c1f6545915 Update dependency @testing-library/react to v10.4.4 2020-07-06 01:05:38 +00:00
Rish
b776af6a7c v0.8.2 2020-07-01 15:36:49 +05:30
Rish
2e5ddfa05c Removed unused top level css
no issue

- CSS was added as part of App initialization and not used in project
- Top-level css leaks through on the page when script is added unlike the frame's css/inline-style
2020-07-01 15:36:13 +05:30
Rish
79666590e2 v0.8.1 2020-06-26 02:12:38 +05:30
Rishabh Garg
679ee80c81 Added setup to handle preview mode from URL (#60)
no issue

- Adds handling of preview URL used in Admin for showing popup state
- Updates popup state based on url hash changes
2020-06-26 02:11:57 +05:30
Renovate Bot
f6ee798a95 Update dependency @testing-library/jest-dom to v5.11.0 2020-06-25 17:16:18 +00:00
Renovate Bot
f623c8aa1c Update dependency @testing-library/react to v10.4.3 2020-06-25 05:01:13 +00:00
Renovate Bot
eef3726578 Update dependency @testing-library/react to v10.4.2 2020-06-24 20:33:46 +00:00
Rish
fb00813f2e v0.8.0 2020-06-25 00:25:19 +05:30
Renovate Bot
66b073feca Update dependency @testing-library/react to v10.4.1 2020-06-23 23:21:14 +00:00
Renovate Bot
0759eb52da Update dependency @testing-library/react to v10.4.0 2020-06-23 17:20:29 +00:00
Rish
7a9d7497fb Updated site url fetch from data attribute
closes https://github.com/TryGhost/members.js/issues/54

- Site url is added as data attribute on script tag load in Ghost head
- was previously fetched via meta tag which was inserted on site
2020-06-22 17:46:40 +05:30
Rish
aaa8fd3535 Updated new portal settings naming
no issue

- Previously, the settings used for customization were `show_beacon`, `show_signup_name` and `allowed_plans`
- These settings were renamed to `portal_button`, `portal_name` and `portal_plans` respectively
- Updates usage of settings to new names
2020-06-19 21:37:22 +05:30
Renovate Bot
affc000be5 Update dependency webpack-cli to v3.3.12 2020-06-18 13:22:40 +00:00
Rish
8361cfabc2 v0.7.0 2020-06-18 17:50:31 +05:30
Rish
6c8c77de5d Handled new modal settings for basic customization
no issue

- Uses `show_beacon` setting to show/hide the default beacon
- Uses `show_signup_name` setting to show/hide the signup name
- Uses `allowed_plans` to show/hide the plans
2020-06-18 17:16:05 +05:30
Rish
905bc30a90 Added dynamic height calculation for popup
no issue

- So far, we had to specify fixed height to iframe based on content of page, but this was not dynamic
- Calculates height of popup dynamically with refs and assigns to iframe to allow dynamic updates as content changes
- Allows configuration and different case handling for popup without worrying about proper height
2020-06-18 11:35:53 +05:30
Renovate Bot
20b637e404 Update dependency @testing-library/react to v10.3.0 2020-06-18 01:19:17 +00:00
Renovate Bot
6bb146abcc Update dependency @testing-library/jest-dom to v5.10.1 2020-06-15 01:21:06 +00:00
Rish
c0fa057533 v0.6.3 2020-06-12 18:53:06 +05:30
Rish
3a4c93b82d Fixed default page value
no issue

- Fixes Incorrect assignment of default page in case of missing data set
2020-06-12 18:52:05 +05:30
Rish
a873554be3 v0.6.2 2020-06-12 18:48:16 +05:30
Rish
3e06a71dc8 Fixed empty page from custom trigger button
no issue

- Custom trigger button with empty page value was not setting the default page
- Adds default page in case of no value
2020-06-12 18:47:29 +05:30
Rish
e376c60764 v0.6.1 2020-06-12 17:50:19 +05:30
Rish
432caae79c Updated site url to read from ghost:site meta tag on theme
closes https://github.com/TryGhost/members.js/issues/39

- Script needs correct ghost site url to initialize correct API endpoints for fetching site/members data
- `window.location.origin` won't work as correct ghost site url in all cases, specially for sites using subdirectory setup
- New meta tag `ghost:site` is inserted on themes with correct `siteUrl`, which is used to initialize api
2020-06-12 16:59:44 +05:30
Rish
8df822d317 Refactered App structure and naming
no issue

- Moved `ParentContainer.js` to redundant empty top level `App.js` to remove extra nesting and improved naming
- Renamed `ParentContext` to `AppContext` and exported as default
- Fixed imports in all the components and test-utils with new structure
- Passed `siteUrl` to api setup from main App to allow easier configuration
- Updated App tests
2020-06-12 14:19:08 +05:30
Renovate Bot
1fc8f86507 Update dependency @testing-library/user-event to v11.4.2 2020-06-11 17:19:51 +00:00
Renovate Bot
a83ae73578 Update dependency @testing-library/jest-dom to v5.10.0 2020-06-11 15:31:39 +00:00
Rish
0baa47da31 v0.6.0 2020-06-11 18:37:18 +05:30
Rish
9f6450b2fc Allowed multiple custom trigger buttons with start page
closes https://github.com/TryGhost/members.js/issues/45

- Allows multiple trigger buttons on the page with data attribute `data-members-trigger-button`
- Allows passing page value to custom trigger button to show the popup on specified page, like signup
- Removes event handlers on unmount
2020-06-11 15:38:37 +05:30
Renovate Bot
472af65f12 Update dependency @testing-library/user-event to v11.4.1 2020-06-10 20:17:38 +00:00
Rish
85889491cf Added check for stripe configuration in UI flows
closes https://github.com/TryGhost/members.js/issues/43

- Handle plans/payment flow based on new `isStripeConfigured` flag in members site data - Added in 82cf095600
- Hides plan update/subscribe/paid-signup flows if stripe is not setup
2020-06-10 21:18:00 +05:30
Rish
6623235bb9 Handled allowSelfSignup option for allowed plans
refs https://github.com/TryGhost/members.js/issues/43

- If the self signup flag is off in member settings, removes the free plan option from Signup flow
2020-06-10 19:52:38 +05:30
Rish
66479c1990 Added error handling for checkout/signup failure
closes https://github.com/TryGhost/members.js/issues/38

- Added error state to signup action button in case of action failure like checkout session rejection
- Checkout session rejection was previously incorrectly timing out and returning 200
2020-06-10 18:05:08 +05:30
Rish
e538f9b363 Removed error state action reset
no issue

- Don't reset the button/error state in case of a failure, similar behavior as Ghost Admin
2020-06-10 18:05:08 +05:30
Rish
9ab1ef3dc3 Added retry option to action button
no issue

- Allows updating action buttons to use error states to update background color
2020-06-10 18:05:08 +05:30
Renovate Bot
2955c7ee20 Update dependency @testing-library/user-event to v11.4.0 2020-06-10 05:20:49 +00:00
Renovate Bot
c3f8a529e8 Update dependency @testing-library/user-event to v11.3.2 2020-06-09 14:21:44 +00:00
Renovate Bot
4d7b8914be Update dependency @testing-library/user-event to v11.3.1 2020-06-08 19:39:44 +00:00
Rish
0ff2f9df9e Fixed lint in build script
no issue
2020-06-07 01:26:58 +05:30
Rish
aa228a8df2 Updated tests structure
no issue

- Use jsdom-fourteen to allow waitFor tests from testing lib - https://github.com/facebook/create-react-app/issues/7491#issuecomment-534832697
- Updated test-utils to pass context
- Added tests for account plan and profile using new test options
2020-06-07 01:26:41 +05:30
Rish
3c734af54e Disabled plan checkout without plan selection
no issue

- Disable plan checkout step if no plan is selected
2020-06-07 01:25:20 +05:30
Renovate Bot
70c2bd9a90 Update dependency @testing-library/react to v10 2020-06-07 01:06:49 +05:30
Renovate Bot
67c42b3277 Update dependency @testing-library/user-event to v11 2020-06-07 01:05:51 +05:30
Renovate Bot
08a809f156 Update dependency @testing-library/jest-dom to v5 2020-06-07 01:04:57 +05:30
Rish
0d50b68596 Updated publish note in readme
no issue

- Removes redundant manual version update line as `yarn ship` shows a prompt
2020-06-06 20:18:23 +05:30
Rish
4689061d49 Added custom trigger button note to readme
no issue

- Adds note on how custom trigger button works for theme devs
2020-06-06 20:10:26 +05:30
Rish
31f04851e5 Updated prop types for trigger button
refs https://github.com/TryGhost/members.js/issues/5

- Only place where we pass down props to check popup state
- Adds propType for popup state
2020-06-03 10:58:38 +05:30
Rish
4d94188d1c v0.5.1 2020-06-03 10:55:13 +05:30
Rish
e8a7f6aec9 Updated save state handling for button
closes https://github.com/TryGhost/members.js/issues/34

- Updates save state handling for button to show intermediary Saved state before resetting
- Updates labels based on action running state
2020-06-03 10:50:14 +05:30
Rish
9387cf2131 v0.5.0 2020-06-02 00:16:29 +05:30
Rish
535f9070bc Enabled data attribute handling for existing members script feature
no issue

- This was disabled before last release to not overlap with existing member's script in latest version
- Enabled again to handle data attributes in a theme same as existing script
2020-05-28 20:41:59 +05:30
Rishabh Garg
0db1874095 Added email change flow for logged-in member (#33)
refs https://github.com/TryGhost/members.js/issues/30
Depends on https://github.com/TryGhost/Members/pull/161

- Calls send magic link API with old email option when a member updates their email address
- Allows member to update their email address by clicking on magic link on new email address
2020-05-28 20:39:27 +05:30
Rish
bbeffb04be v0.4.1 2020-05-28 17:32:48 +05:30
Rish
565e9dfd73 Disabled data attribute handling
no issue

- Disables data attribute handling(existing members.js functionality) as it can attach handlers twice if loaded together with existing members.js
- Can be easily enabled once the new script is loaded from core
2020-05-28 17:32:07 +05:30
Rish
47b6415c93 Updated contact support button to disabled look
no issue

- No functionality is currently attached to contact support so greying out, will enable once its updated
2020-05-28 17:28:27 +05:30
Rish
f0d6320da9 Removed delete account button from profile page
no issue

- Cleanup: We currently don't have any functionality hooked to delete account button
2020-05-28 17:24:19 +05:30
Rish
503cb53f4f Removed email from update member action
no issue

- Removes email from update member action as it cannot be modified directly
2020-05-28 17:23:48 +05:30
Rish
b361754ea9 Cleaned action running states
no issue

- Adds running states for action buttons on plan and profile pages
2020-05-28 17:21:46 +05:30
Rish
a9a083f2f1 Cleanup
no issue

- Extract root div id so its easy to change it in one place in future
- Add stripe load method
- Extract all initial non-ui handling to setup method
2020-05-27 18:04:06 +05:30
Rish
9cf8e0e435 Added stripe load method
no issue

- Load Stripe script if not already loaded on page
- Many members.js features rely on Stripe script to be loaded on the page to allow checkout/billing updates etc.
2020-05-27 18:03:12 +05:30
Rish
fc75d9881d Initialized existing members.js data attribute handling
refs https://github.com/TryGhost/members.js/issues/32

- Inits data attribute handling from the copied over members.js file from core
- Uses `window.location.origin` as site url for api calls in data attribute handling
2020-05-27 17:32:41 +05:30
Rish
514e022520 Copied existing public members.js script from core
refs https://github.com/TryGhost/members.js/issues/32

- Copies over existing members.js script from core
- Handles members functionality in a theme using data-attributes assinged
- Only modification is tto use `siteUrl` value passed to the function for API calls
2020-05-27 17:32:41 +05:30
Rish
bb7200dabf Fixed lint warnings
no issue
2020-05-27 17:11:43 +05:30
Rish
5640137bd3 Renamed update plan action to update subscription
no issue

- Renames update plan action to update subscription as it can be also used to cancel current subscription
- Pass cancelAtPeriodEnd option to update subscription API call
2020-05-26 20:40:54 +05:30
Renovate Bot
838c440a5a Update dependency eslint-plugin-ghost to v1.5.0 2020-05-25 10:17:09 +00:00
Rish
25269953a2 v0.4.0 2020-05-22 15:47:14 +05:30
Rish
97319dee7c Redirected member to home after plan update
no issue

- Takes member to home page popup on plan update
- Fetches new member session data via API to show updated plan
2020-05-22 15:44:35 +05:30
Rish
dd2ad02e68 Refactored profile page for free/paid member
no issue

- Updates profile page for free/paid member to render newsletter based on context
- Disable editing email field till we have the full flow for it
2020-05-22 15:43:24 +05:30
Rish
7cc028ba0d Added default plan for paid member
no issue

- Selects member's current plan by default on plan selection page
2020-05-22 15:41:58 +05:30
Rish
11e1b84298 Refactored account home page to dynamically load for free/paid
no issue

- Updates style based on context
- Combines account home page for free/paid members to load based on member status
2020-05-22 15:41:27 +05:30
Rish
f94f16a90d Combined account home pages in single file
no issue

- Cleanup: Combines home page for both free and paid member in single file for cleaner split
2020-05-22 12:38:06 +05:30
Rish
d8072971b5 Updated newsletter subscription label
no issue

- Updates newsletter subscription label based on current state on profile page
2020-05-22 12:36:38 +05:30
Rish
1049955007 Removed env variable for default page
no issue

- Removes env variable which could be previously set for local development in favor of `process.env.NODE_ENV` check for development version
2020-05-22 12:35:33 +05:30
Rish
08a4611ee3 Fixed page switch message UI margin
no issue

- Adds margin for page switch message between signup/signin at bottom
2020-05-22 12:34:21 +05:30
Rish
9432e4f166 Fixed Switch element tests
no issue

- Updated attaching onToggle to correct element on switch test
2020-05-21 12:02:41 +05:30
Rish
ca0bdab60b Hooked newsletter subscription toggle to API
refs https://github.com/TryGhost/members.js/issues/20

- Allows paid/free member to update their newsletter subscription status
- Newsletter subscription status is immediately updated on toggle
2020-05-21 11:54:44 +05:30
Rish
a859da1aa4 Updated magic link api to send member name
refs https://github.com/TryGhost/members.js/issues/26

- Includes member name in the magic link creation API which can be later read from token and stored on signup.
2020-05-21 09:05:41 +05:30
Rish
680572f499 Added profile update action from profile page
refs https://github.com/TryGhost/members.js/issues/20

- Updates profile update action name in Profile Page
- Adds new action to update member info from profile page if member is logged in
2020-05-20 00:14:22 +05:30
Rish
197be15e63 Renamed plan -> planName for update subscription api call
refs https://github.com/TryGhost/members.js/issues/20

- API uses planName for update subscription api call
2020-05-20 00:14:22 +05:30
Rish
2b34ee5c28 Updated paid signup action of member to include name
refs https://github.com/TryGhost/members.js/issues/29

- Uses updated API endpoint for checkout to pass member name in stripe checkout session metadata
2020-05-20 00:14:21 +05:30
Rish
43106c037e Added api to update member's profile info
refs https://github.com/TryGhost/members.js/issues/20

- Uses new member update endpoint to update logged-in member's profile info
- Member can update their name, email and newsletter subscription status
2020-05-20 00:14:21 +05:30
Rish
f257a35dce Updated checkout plan api to include member name in metadata
refs https://github.com/TryGhost/members.js/issues/29

- Create stripe checkout session in Ghost now supports passing metadata for custom info like name
- This allows storing member name post-signup after payment through stripe checkout is completed
2020-05-20 00:14:21 +05:30
Rish
b865d002a9 Added update subscription API
refs https://github.com/TryGhost/members.js/issues/20

- Adds update subscription api for member
- API allows updating plan for a particular subscription for logged-in member
2020-05-20 00:14:21 +05:30
Renovate Bot
f59d8213f6 Update dependency eslint-plugin-ghost to v1.4.1 2020-05-11 10:15:34 +00:00
Rish
748f56ee47 Added update plan setup for paid members
refs https://github.com/TryGhost/members.js/issues/20

- Adds update plan action for paid members to allow switching plans
2020-05-08 23:00:32 +05:30
Rish
3f738b1088 Added edit billing flow to paid account home
refs https://github.com/TryGhost/members.js/issues/20

- Opens stripe checkout update session from paid account area for a member
- Allows paid member to update their stripe billing info
2020-05-08 18:33:36 +05:30
Rish
e185c1ee47 Added edit stripe billing api method
refs https://github.com/TryGhost/members.js/issues/20

- Adds new editBilling method for stripe update billing info checkout flow
2020-05-08 18:32:22 +05:30
Rish
5a1fa6fdf4 Added edit profile page UI for paid member
refs https://github.com/TryGhost/members.js/issues/20

- Connects account profile page to edit button for paid member's account home area
2020-05-07 21:11:17 +05:30
Rish
694ec683fe Added free account home to use account profile
refs https://github.com/TryGhost/members.js/issues/20

- Clicking settings on free member's account home now takes them to profile page
2020-05-07 21:04:31 +05:30
Rish
fe1cb02203 Removed default margin style for Button component
no issue

- Adding default margin for action button can cause unwanted behavior where margin needs to be avoided.
- Allow higher level components to directly add margin if needed
2020-05-07 21:03:08 +05:30
Rish
12ac303fb2 Added profile page UI
refs https://github.com/TryGhost/members.js/issues/20

- Adds v1 for account profile page for both free and paid members
2020-05-07 18:06:29 +05:30
Renovate Bot
4078483bb7 Update dependency eslint-plugin-ghost to v1.4.0 2020-05-06 18:15:04 +00:00
Rish
8c42813666 v0.3.3 2020-05-01 23:20:53 +05:30
Rish
e8b25fc6e4 Fixed plan value in paid account home
no issue

- The plan value we get from API for a member is in cents and needs to be converted to dollars before showing.
2020-05-01 23:20:12 +05:30
Rish
21661e8eb8 v0.3.2 2020-05-01 22:24:44 +05:30
Rish
614c3f02fc Added fixture for paid member
no issue

- Adds fixture for paid member for local development
2020-05-01 22:23:37 +05:30
Rish
7abeb0a247 Updated local env file example to use default page
no issue

- Updates local env file to specify a default page for local UI development
2020-05-01 22:21:44 +05:30
Rish
eac5035451 Updated default page handling for paid member
refs https://github.com/TryGhost/members.js/issues/20

- Adds default page handling for paid member to open paid account area
- Refactors dev mode default page to be picked from env file if available
2020-05-01 22:21:16 +05:30
Rish
094d32a88d Added new paid account home area
refs https://github.com/TryGhost/members.js/issues/20

- Adds new page for home account area of paid member
- Updates popup modal to add paid account home page in list
2020-05-01 22:20:18 +05:30
Rish
26e1fd9dd3 Updated custom trigger button popup state classes
no issue

- Fixes custom trigger button not getting close class through any other way other than trigger
- Updates class name for open and close state by adding `gh-members-` namespace
2020-05-01 21:26:19 +05:30
Rish
2789ea3a10 v0.3.1 2020-05-01 20:58:55 +05:30
Rish
a61ce9c690 Fixed lint 2020-05-01 20:58:29 +05:30
Rish
216d8b1a14 Added subscribe navigation to account home
refs https://github.com/TryGhost/members.js/issues/20

- Adds navigation and last page setup for account home -> account plan chooser
2020-05-01 20:56:46 +05:30
Rish
767fbc1112 Cleaned up checkoutPlan action
no issue

- Removed checkoutUrls as we use default value for now
2020-05-01 20:55:20 +05:30
Rish
7dd4282520 Added back action to action list
no issue

- Adds back action to action list to allow pages to navigate back to last page
2020-05-01 20:54:48 +05:30
Rish
ec407eae5f Added new account plan page to popup modal flow
no issue

- Adds modal style and page value for new account plan page to modal
2020-05-01 20:53:48 +05:30
Rish
c6cf81664c Added new accountPlan page
no issue

- Adds new page for choosing a plan for logged in member
2020-05-01 20:52:56 +05:30
Rish
859b5502eb Refactored swtichPage action call syntax
no issue

Updates switchPage syntax to pass object so we can pass `lastPage` value as well for back button
2020-05-01 20:52:18 +05:30
Rish
4931ea68bd Updated plans section component plans prop
no issue

- Updates plans section component to take simpler plans array as prop for rendering plans
2020-05-01 20:49:35 +05:30
Rish
9cc5badd2f Added new switch component for toggle UI
no issue

- Mimics behavior and UI of toggle button in Ghost Admin
2020-05-01 20:12:13 +05:30
Rish
ee1dfbc0af v0.3.0 2020-05-01 17:18:54 +05:30
Rish
dae6d75f17 Fixed lint 2020-05-01 17:17:09 +05:30
Rish
98354e9de0 Updated script usage in readme to remove explicit init and adminUrl
refs https://github.com/TryGhost/members.js/issues/25

- No dependency on adminUrl anymore as endpoints exist on site url
- Members.js script is auto initialized, no need for explicit init in themes anymore
- No local .env values need to be set for development as script loads data from fixtures directly
2020-05-01 17:10:17 +05:30
Rish
2aef0d57f8 Refactored app initialization to remove admin url dependency
closes https://github.com/TryGhost/members.js/issues/25

- Remove dependency on admin url for initialization as member endpoints now exist on site directly
- Auto initializes the script on load as need not wait on any external dependency
- API fetch cleanup in parent container
- Updates tests
2020-05-01 17:06:58 +05:30
Rish
e291e7075b Updated api endpoints to use new member endpoints on site
refs https://github.com/TryGhost/members.js/issues/25

- Members endpoints were refactored in core to exist directly on site as `<SITE>/members/api/<RESOURCE>`
- All endpoints needed are now directly on SITE and removes the need for AdminURL
- Init method is updated to read site data from fixtures for local development, as no admin endpoint exists now

Core Refs:
0cba02b370
fa4dfa1b21
c70c49258e
2020-05-01 17:00:52 +05:30
Rish
a373239fcb Added small style hack to insert css inside iframe components
no issue

-  By default, CRA's webpack bundle combines and appends the main css at root level, so they are not applied inside any iframe.
- JSX Styles don't work for `:hover` and other similar selectors which is needed to style certain components like checkboxes
- This uses a hack where we append `<style> </style>` tag with all CSS inside the head of iframe dynamically as string
- We can create separate variables to keep styles grouped logically, and export them as one appended style string to apply styles in iframe.
2020-05-01 16:03:07 +05:30
Rish
d4f604d091 v0.2.4 2020-05-01 13:05:23 +05:30
Rish
29c4b6be0f Updated yarn ship script
no issue

- Updates `yarn script` to use same consistent format we use across org
- Removes use of `npm` in publish
- Adds `preship` to run lint - ideally should run tests but react tests run in interactive mode and are very slow atm, need to sort that out first.
2020-05-01 13:02:27 +05:30
Rish
c67ec1f730 Added no-op subscribe button handling
refs https://github.com/TryGhost/members.js/issues/20

- adds no-op method to handle subscribe option in account page
- fixes lint
2020-05-01 12:46:20 +05:30
Rish
67a07893b0 Updated account home page UI for free member
refs https://github.com/TryGhost/members.js/issues/20

- Updates UI for free member's account page based on spec
- Updates popup to show account home page like normal modal
- Updates tests
2020-05-01 12:41:33 +05:30
Rish
21df87e388 Updated trigger to use member gravatar when logged-in
refs https://github.com/TryGhost/members.js/issues/20

Updates trigger default icon to use member's gravatar if logged in via common component, which fallbacks to user icon when gravatar is blank.
2020-05-01 12:36:57 +05:30
Rish
d2098a783e Added common members avatar component
refs https://github.com/TryGhost/members.js/issues/20

- Adds a common component to render member gravatar with backup of user icon where gravatar is not available or is blank.
- Used in both Trigger component for logged in member as well as account areas.
2020-05-01 12:35:51 +05:30
Rish
462eb1c1b2 Reset popup state to default on closing magic link
closes https://github.com/TryGhost/members.js/issues/21

- Resets popup state to default page when magic link popup message is closed
2020-04-30 20:35:26 +05:30
Rish
49606f8fdf Added explicit npm registry in publishConfig
no issue

The members-js package is published on npm and this ensures `yarn ship` attempts to push to correct registry instead of yarn registry in case not set globally.
2020-04-30 17:37:29 +05:30
Rish
02d968dd4e 0.2.3 2020-04-30 17:25:36 +05:30
Rish
d11afe363f Updated checkout flow to pre-fill member email
refs https://github.com/TryGhost/members.js/issues/10

- Takes advantage of change here - 24b83bdc49 - to pre-fill customer email in anonymous checkout flow
- Member cannot change their email in this checkout session, allowing consistency and correct linking post checkout
2020-04-30 17:23:23 +05:30
Rish
f813185cc3 Added stripe url handling for checkout success
refs https://github.com/TryGhost/membersjs/issues/10

We use stripe query param `?stripe=<state>` for redirects from checkout session, this handles the magic link popup for checkout success state on redirect.
2020-04-30 11:55:16 +05:30
Rish
712ac5cd74 Updated tests for magiclink page
no issue

- Add test for close button firing correct action(closePopup) on magic link page
- Use common test utils setup
2020-04-30 11:49:18 +05:30
Rish
30a14023cf Fixed close action handling on magic link page
no issue

Fixes magic link action button using incorrect action method - `handleSignin` - which failed on click, replaced with close popup action.
2020-04-30 11:39:19 +05:30
Rish
9aefe26ba7 Fixed lint 2020-04-30 00:24:31 +05:30
Rish
24e98cfb21 Used common plans section component in signup page
refs https://github.com/TryGhost/members.js/issues/10

We want to use the common UI component for rendering the plans section. Also fixes the weird dom sync problem with checkboxes by adding a timeout for small lag to keep the state in sync.
2020-04-30 00:19:28 +05:30
Rish
886ee7e9ec Added new component for membership plans
refs https://github.com/TryGhost/members.js/issues/10

Create common plans section UI component as its used in multiple places in app
2020-04-30 00:17:16 +05:30
Rish
9edb3d2e58 Reworded usage section in readme
Simple rewording to make usage section shorter and to point
2020-04-29 13:38:29 +05:30
Rish
87215f56a0 0.2.2 2020-04-28 23:41:52 +05:30
Rish
f237a6ee37 Updated unpkg link in readme to use latest version
no issue

Instead of pinning to specific released version, we use `@latest` for picking the last released version automatically
2020-04-28 23:41:20 +05:30
Rish
7fee47b9a7 Added yarn ship for publishing to npm/unpkg
refs https://github.com/TryGhost/members.js/issues/5

We use `yarn ship` across all our packages for publishing new versions.
2020-04-28 23:38:24 +05:30
Rish
4d99e881d7 Added basic anoymous checkout flow setup
refs https://github.com/TryGhost/members.js/issues/10

Adds happy path flow for triggering anonymous checkout from signup page when monthly or yearly plan is selected. Opens the stripe checkout session with empty email, and currently doesn't handle the success or failure redirect.
2020-04-28 23:33:22 +05:30
Rish
e0c222f25c Fixed incorrect default page load
no issue

Missed passing `member` param while fetching default page, which then always returns `signup` page even if member is signed in
2020-04-28 23:31:20 +05:30
Rish
7da315acba Switched to recommended absolute test-utils path setup
refs https://github.com/TryGhost/members.js/issues/5

Switched to using absolute path for default test-utils setup file as relative imports become too messy when we keep tests for a component next to it. This setup allows using absolute path for common test-utils file which is used in almost all tests for initial setup.
2020-04-28 23:29:56 +05:30
Rish
d83382ffb5 Allowed .env file in source control for test-utils setup
refs https://github.com/TryGhost/members.js/issues/5

- We want to allow .env in source control mainly to use react-testing-library's recommended setup for common test-utils. It uses .env file to define NODE_PATH, which helps in avoiding relative imports in tests as we keep test files next to UI components.
- CRA also by default suggests committing .env files to source control
2020-04-28 23:15:09 +05:30
Rish
c3907f24dd Fixed tests
Fixed incorrect fixtures path
2020-04-28 13:12:11 +05:30
Rish
c86550a68f Cleaned up initialization and data fetching
refs https://github.com/TryGhost/members.js/issues/5

- Streamlined data init flow
- Streamlined development mode initialization
- Moved fixtures to utils
- Removed unused or redundant methods
2020-04-28 13:08:17 +05:30
Renovate Bot
971afdf468 Update dependency eslint-plugin-ghost to v1.3.0 2020-04-28 06:14:02 +00:00
Rish
4b01a1eac9 Fixed eslint no-console error
no issue

- Throws error on signout failure instead of console log
- Disables eslint for data initialization failure to allow logging error to console
2020-04-28 10:39:04 +05:30
Renovate Bot
982c9d19ef Pin dependencies 2020-04-28 08:51:04 +05:30
Rish
197070bcfe Updated readme
Added note about adding drop-in script in code injection footer in admin
2020-04-28 01:22:44 +05:30
Rish
e7e9ceab7d Updated readme
Removes comment about explicit need for admin url not ending in trailing slash, we handle trailing slash in code now.
2020-04-28 01:12:10 +05:30
Rish
9bf219459b Updated admin url for local env
refs https://github.com/TryGhost/members.js/issues/5

- Removes `/ghost` from local development .env file
2020-04-28 01:11:12 +05:30
Rish
487bea51b2 Refactored code structure using react context
ref https://github.com/TryGhost/members.js/issues/5

React context allows us cleaner setup in codebase with shared data and methods across components at different nesting levels. This should allow faster iteration and easier development going forward.

- Uses Parent context for shared data and methods across different components instead of passed down props
- Uses new `init` method in API for data initialization
- Removes `PopupMenu` component in favor of `PopupModal`
- Adds new test util for custom render for easier base setup - https://testing-library.com/docs/react-testing-library/setup#custom-render
- Updates tests to use new test util for easier test setup
2020-04-28 01:10:08 +05:30
Rish
2214a5048b Added new parent context
refs https://github.com/TryGhost/members.js/issues/5

- Adds new parent context with default values for all common context data we want to pass through

This adds base for using contexts (https://reactjs.org/docs/context.html) in our application as that allows easier overall base data and method sharing between different components instead of passing them down
2020-04-28 01:04:30 +05:30
Rish
e8a05c252b Added init method to api
refs https://github.com/TryGhost/members.js/issues/5

- renamed default function name
- Adds `init` method to api for fetching site data and member session data together
- Update site url from site data to remove window.location.origin dependency in case of iframe
2020-04-28 00:52:21 +05:30
Rish
ead29b9e23 Fixed account button action logging out
no issue

Account button was incorrectly mapped to logout action, adds a temp no-op action for account area
2020-04-27 15:39:02 +05:30
Rish
1a29d0926e Added render tests for common components
no issue

- Adds tests for ActionButton and InputField components
2020-04-27 15:37:48 +05:30
Rish
eb4ed70303 Added id and aria-label values for input field component
no issue

- Adds `aria-label` on input fields and id for label's `for` to map to form control
- Fixes tests
2020-04-27 14:09:12 +05:30
Rish
c53654d89b Updated pages to use common components
no issue

- Updates Signin page to use common ActionButton and Input component
- Updates Signup page to use common ActionButton and Input component
- Updates MagicLink page to use common ActionButton component
2020-04-27 13:51:25 +05:30
Rish
100bfa7b5b Extracted common Input and Button components
no issue

- Add new InputField common component for input fields with label
- Add new ActionButton common component for action <button>
2020-04-27 13:49:59 +05:30
Rish
61de34aac8 Updated readme
Fixed CI status badge
2020-04-27 11:53:18 +05:30
Rish
4565cfb646 Update readme
Bump unpkg version to 0.2.1
2020-04-23 21:21:09 +05:30
Rish
3baffcc3e6 0.2.1 2020-04-23 21:19:23 +05:30
Rish
c44241e27d Fixed signup with email not working on free plan
closes https://github.com/TryGhost/members.js/issues/16

This fix sends magic link to member when they choose free plan to signup using name and email.

Note: We are not storing `name` atm in magic link, so it gets ignored in actual member data on signup atm.
2020-04-23 21:18:34 +05:30
Rish
1fdc514c1f Fixed token handling in url for magic-link
closes https://github.com/TryGhost/members.js/issues/14

This adds handling of url update when signing-in with magic link by removing the token query param, which can cause accidental re-login on refresh.
2020-04-23 20:46:14 +05:30
Rish
72b8a376c6 Updated readme
Updated unpkg link to point to correct version
2020-04-23 18:02:43 +05:30
Rish
067fc9a1bd v0.2.0 2020-04-23 17:58:12 +05:30
Rish
1a97c7d161 Updated readme
Updated reference to admin url needed for initialization as api domain, same as used by other api clients.
2020-04-23 17:57:41 +05:30
Rish
c1a5c67e37 Refactored API setup and admin url initialization
refs https://github.com/TryGhost/members.js/issues/6

- Refactored API util to be more consistent with existing API SDKs
- Updated init method to expect admin url same as other SDKs
2020-04-23 17:54:21 +05:30
Rish
c58f29f1a9 Updated readme to tag latest unpkg version in script
Unpkg recommends tagging exact version in the url to avoid redirects and faster load times. Also ensures the init script is in sync with the unpkg version being picked up in case of any changes.
2020-04-23 13:56:09 +05:30
Rish
884e197cca v0.1.1 2020-04-23 13:03:17 +05:30
Rish
f79d022909 Fixed lint 2020-04-23 12:59:47 +05:30
Rish
2cf40fa6b8 Updated readme
Updated example admin url value for local setup
2020-04-23 12:59:26 +05:30
Rish
e999bcd146 Fixed tests
no issue
2020-04-23 12:59:08 +05:30
Rish
93a14eea2e Renamed script init method
refs https://github.com/TryGhost/members.js/issues/6

- Renames script initialization method from `initMembersJS` to simply `init`
- Updates readme
2020-04-23 12:51:51 +05:30
Rish
0a5e0648c8 Refactored fixutres data for site and member
refs https://github.com/TryGhost/members.js/issues/10

Refactored to include free member data and added dummy data for testing
2020-04-23 12:43:28 +05:30
Rish
275655584e Refactored UI structure and component naming
refs https://github.com/TryGhost/members.js/issues/10

- Added `/page` in components to structure all UI page flows for the app
- Renamed components to highlight just actual purpose/utility
- Cleaned up data loading flow
2020-04-23 12:42:55 +05:30
Rish
b50abb5ad2 Fixed firefox iframe append issue
no issue

Firefox doesn't allow adding content to iframe body without passing `srcDoc={`<!DOCTYPE html>` to the iframe, this allows iframe to load properly
2020-04-22 19:39:06 +05:30
Rish
e7973cf37a Updated Readme
Fixed init method
2020-04-21 15:18:12 +05:30
Rish
e36b6a8ae5 Updated readme 2020-04-21 14:51:16 +05:30
Rish
c05f3916c0 Updated readme
Cleaned up usage instructions
2020-04-21 11:17:23 +05:30
Rish
5eaa243003 Updated readme
Updates admin url format for initialization
2020-04-20 23:37:44 +05:30
Rish
86340abdc7 Updated Readme
Added Usage section
2020-04-20 23:26:55 +05:30
Rish
0539c543a7 Updated Readme 2020-04-20 23:03:24 +05:30
Rish
0b7707fe7a Added initial dom element insertion in init
no issue

Previously, we expected theme to include an empty div with id as `root` where we loaded our widget. This change automatically adds a root div to the document and renders widget inside it.
2020-04-20 22:44:47 +05:30
Rish
88d8008bcf Updated Readme 2020-04-20 22:12:30 +05:30
Rish
e59e8186bd Cleaned up script intiailization data
refs https://github.com/TryGhost/members.js/issues/6

Removes all data initialization setup except `adminUrl` as we now fetch everything directly from API
2020-04-20 22:12:08 +05:30
Rish
028139a0e1 Updated build and publish setup for unpkg deployment
refs https://github.com/TryGhost/members.js/issues/12

- Updates package name and add umd/unpkg setup in `package.json`
- Updated webpack config to publish minified bundle at `umd/memebrs.min.js`
- Updated .gitignore to remove build folders
2020-04-20 22:10:58 +05:30
Rish
89a1cab4c1 Fixed lint for webpack config
no issue
2020-04-20 11:57:14 +05:30
Rish
f529959b78 Updated data initialization for member
refs https://github.com/TryGhost/members.js/issues/6

Updates member data initialization through API method instead of using data passed through from theme.
2020-04-20 11:57:14 +05:30
Rish
aafc228ffd Added method to fetch member data from session
refs https://github.com/TryGhost/members.js/issues/6

Adds method to fetch member's data in exchange of identity/session for data initialization
2020-04-20 11:57:14 +05:30
Renovate Bot
b71104b1de Update dependency eslint-plugin-ghost to v1.2.0 2020-04-17 11:14:03 +00:00
Rish
066ec7fcae Added site data initilization through APIs
refs https://github.com/TryGhost/members.js/issues/6

Use member identity and public site data admin API to fetch site data which was previously being passed down from the theme. This change allows us to be directly fetch all relevant site data except adminUrl and use it to initialize the flows.

Also adds a basic loading behavior till we finish fetching site and member logged-in data from API.
2020-04-17 14:53:10 +05:30
Rish
0c0e1069ae Added member identity and site data APIs
refs https://github.com/TryGhost/members.js/issues/6

To self-contain all the data needs for members.js, we load the site data and member's logged in state using available APIs instead of passing them down the theme
- Member Identity API uses member cookie and `/ssr` endpoint to identify if a member is currently logged in or not
- Site data API is the public admin API endpoint for fetching public site data like title, description, logo, brand etc.
2020-04-17 14:50:18 +05:30
Rish
4ba70683a8 Added new basic Loading page for data init
We want to show some kind of loading state till we fetch initial site or member data to load the relevant page
2020-04-17 14:46:55 +05:30
Rish
bf901c99cd Added action tests for SIgnup page
Adds test to check actions for signing up with name, email, plan and switching to signin page
2020-04-16 14:30:02 +05:30
Rish
4789f473e3 Added action tests for Account Page
Adds signout button test for account page
2020-04-16 14:20:04 +05:30
Rish
22bee293bc Added action tests to Signin page
Adds tests for send magic link and subscribe button actions
2020-04-16 14:13:37 +05:30
Rish
117a27f86b Setup render tests for components
Adds basic rendering test for all components/pages for expected outputs
2020-04-16 12:21:49 +05:30
Rish
909eb16ced Fixed basic top-level App test 2020-04-15 21:15:56 +05:30
Rish
5b18b464d1 Initialized script with plans
Added default plans value on init for testing
2020-04-14 12:42:35 +05:30
Rish
4d71056e12 Handled empty plans for site
[Temp] Hide the plans section if plans are not present
2020-04-14 12:42:35 +05:30
Rish
f727fdd1ed Refactored Parent pages to use pages
Refactors Parent and Popup-menu pages to load different pages as per UI flows and pass necessary data and actions down to UI components.
2020-04-14 12:42:35 +05:30
Rish
3cbe8d6f0c Added new Signin/Signup/MagicLink pages
Added new pages for different UI flows

- Sign-in Page: Allow member to signin with magic link
- Signup Page: Allow member to signup with name + email, also allow choosing plan in checkout
- Signed-in Page: Default account page if member is signed in
- Magic Link Page: Info page which shows magic link is sent to inbox
2020-04-14 12:42:35 +05:30
Rish
582bc46176 Removed unused name prop in App 2020-04-14 12:42:35 +05:30
Rish
768af49ebd Updated members api to return promise
This allows controlling UI state for API actions using async/await
2020-04-14 12:42:35 +05:30
Daniel Lockyer
41303348bb Updated Renovate config
no issue
2020-04-13 10:46:29 +01:00
Renovate Bot
2788eccd49 Add renovate.json 2020-04-13 10:46:29 +01:00
Rish
8be660def0 Updated local dev env configuration
- Use local dev config only for development mode
- `.env.local` by default gets triggered for production builds as well, unlike `.env.development.local`
2020-04-13 13:09:15 +05:30
Hannah Wolfe
c3d13f2451 Added local dev env configuration
- call init by default if there's an env var for ADMIN_URL
- add an example local dev config
2020-04-10 17:41:16 +01:00
Hannah Wolfe
e9a193445d Swapped blog -> site
- this is our preferred wording
2020-04-10 16:52:29 +01:00
Hannah Wolfe
af543c0cc9 Added basic github workflow for running tests
- copied from https://github.com/TryGhost/billing-management/blob/master/.github/workflows/test.yml
2020-04-10 16:42:25 +01:00
Hannah Wolfe
4c358d2cec Added ghost browser ESLint config and fixed errors
- added eslint-plugin-ghost, extended ghost/browser config & fixed all the issues
- did this because basic things like indent, quotes and semi-colons weren't being enforced resulting in inconsistencies
- we can customise this or create a ghost/react if desired
2020-04-10 16:32:37 +01:00
Hannah Wolfe
4f1c95edb8 Removed service worker code
- I don't think it will ever be appropriate to use a service worker in our widget context
2020-04-10 16:30:21 +01:00
Rish
d6bad7132f Updated welcome text for signin/signup
no issue
2020-04-09 13:56:47 +05:30
Rish
0615d54505 Added handling for custom trigger button in theme
refs https://github.com/TryGhost/membersjs/issues/8

This allows theme developers to use a custom trigger button in their theme instead of default UI created by script by marking the custom button with data attribute - `data-members-trigger-button` .

In case of a custom trigger button, CRA doesn't render the default trigger button and attaches click event handling to the custom button to control the popup UI. Script also adds new custom class `popup-open` and `popup-close` based on popup state to allow theme developers to handle button UI based on popup state.
2020-04-09 13:54:49 +05:30
Rish
4310a18150 Added basic signup/signin UI flow
refs https://github.com/TryGhost/membersjs/issues/3

Adds signup/signin flow to theme when no member is logged in, uses api utils to send magic-link to member's email which can be used to signup/signin
2020-04-08 22:37:50 +05:30
Rish
f7f683bfc0 Removed default initialization for members script
no issue

We need to initialize members script with data passed down from the theme atm, the default initialization is only useful for quick local testing and UI development but not when script is used directly inside a theme.
2020-04-08 22:34:38 +05:30
Rish
bab35b3637 Added util to handle members-api/ssr requests
refs https://github.com/TryGhost/membersjs/issues/2

We need to make requests to members Admin API and SSR endpoints to handle member's session on theme, send magic-link on email and also for using stripe checkout. This adds a small util that wraps all such external requests for use in CRA UI based on user action

Note: The util setup needs `blogUrl` and `adminUrl` values to setup the API endpoints, which we currently pass from the theme. This might change in immediate future based on how we decide to get these values in CRA script.
2020-04-08 22:32:58 +05:30
Peter Zimon
93a634ce5f Added basic styles
no refs.
- added icon for trigger button open/close state to indicate account menu
- updated style of trigger button for better contrast
- updated base font style and size for html and body to access global typographic styles
2020-04-06 11:25:04 +02:00
Rish
b782048421 Added default initialization for local development
no issue
2020-04-02 17:06:22 +05:30
Rish
f4f5a8331d Updated app flow to use external members data
no issue

- Wraps the react rendering initialisation in a function which is accessed by theme to render the members UI as needed
- Uses site logo and logged in member email for rendering
2020-04-02 13:48:54 +05:30
Rish
ee3fd5a18e Updated Frame component to a simpler version
no issue

Makes frame component more efficient and easier to understand
2020-04-02 13:48:54 +05:30
Hannah Wolfe
4ddddabe85 Added linting scripts
- Incorrectly assumed this was automatically part of `react-scripts test`.
2020-04-01 12:43:42 +01:00
Rish
31b80d8270 Added new Frame Component for iframe encapsulation
no issue

- Adds new FrameComponent which allows encapsulating any React Component inside Iframe directly
- Wraps the Popup and Trigger components inside frame components to be rendered inside iframe
2020-03-31 13:51:48 +05:30
Rish
3dca602545 Added trigger and popup UI components - v1
no issue

- Adds new components for membersJs trigger button and popup menu with style
- Adds basic trigger interaction between trigger button and popup menu
- Uses hardcoded member values
- Adds `prop-types` dependency
2020-03-30 19:05:35 +05:30
Rish
f761672e32 Updated Readme 2020-03-30 19:02:19 +05:30
Rish
c23a80e6f0 Updated build process for single minified script
no issue

By default, CRAs build process creates chunked script files and adds them to default index.html. The updated build process uses `rewire` and `webpack` to -

- Tweak CRAs default behavior by switching off chunking, which leads to a single script
- Uses webpack locally to combine JS and CSS built by above step into a single `bundle.min.js`
2020-03-24 18:49:04 +05:30
Rish
1b91730c48 Initial commit 2020-03-24 18:37:38 +05:30
Rish
4ff29d2735 Initialize project using Create React App 2020-03-24 18:37:04 +05:30