Commit Graph

25 Commits

Author SHA1 Message Date
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