From abd011e1c5919991498aea3dbc96e86a7709a5ea Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Thu, 19 May 2022 11:03:29 +0300 Subject: [PATCH 1/6] fix edit url --- www/docs/docusaurus.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/docs/docusaurus.config.js b/www/docs/docusaurus.config.js index 8944b88e84..d6719d091f 100644 --- a/www/docs/docusaurus.config.js +++ b/www/docs/docusaurus.config.js @@ -127,7 +127,7 @@ module.exports = { { docs: { sidebarPath: require.resolve("./sidebars.js"), - editUrl: "https://github.com/medusajs/medusa/edit/master/www/", + editUrl: "https://github.com/medusajs/medusa/tree/master/docs/content", path: docsPath, routeBasePath: "/", remarkPlugins: [ From 8e38f8115c417baff6e65a21a97a79b0dae46601 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Thu, 19 May 2022 11:04:27 +0300 Subject: [PATCH 2/6] change to edit page --- www/docs/docusaurus.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/docs/docusaurus.config.js b/www/docs/docusaurus.config.js index d6719d091f..9f38d26f56 100644 --- a/www/docs/docusaurus.config.js +++ b/www/docs/docusaurus.config.js @@ -127,7 +127,7 @@ module.exports = { { docs: { sidebarPath: require.resolve("./sidebars.js"), - editUrl: "https://github.com/medusajs/medusa/tree/master/docs/content", + editUrl: "https://github.com/medusajs/medusa/edit/master/docs/content", path: docsPath, routeBasePath: "/", remarkPlugins: [ From be3ad001eed8efc842c649f79b7c68de01147a38 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Fri, 20 May 2022 11:40:57 +0300 Subject: [PATCH 3/6] added readme links --- packages/medusa-file-minio/README.md | 18 +++++---- packages/medusa-file-s3/README.md | 18 +++++---- packages/medusa-file-spaces/README.md | 18 +++++---- packages/medusa-payment-paypal/README.md | 17 ++++++--- packages/medusa-payment-stripe/README.md | 14 +++++++ packages/medusa-plugin-algolia/README.md | 8 ++-- packages/medusa-plugin-contentful/README.md | 15 ++++++++ packages/medusa-plugin-mailchimp/README.md | 10 +++-- packages/medusa-plugin-meilisearch/README.md | 6 ++- packages/medusa-plugin-sendgrid/README.md | 38 ++++++++++--------- .../README.md | 15 ++++++++ packages/medusa-plugin-twilio-sms/README.md | 12 +++--- 12 files changed, 127 insertions(+), 62 deletions(-) create mode 100644 packages/medusa-payment-stripe/README.md create mode 100644 packages/medusa-plugin-contentful/README.md create mode 100644 packages/medusa-plugin-slack-notification/README.md diff --git a/packages/medusa-file-minio/README.md b/packages/medusa-file-minio/README.md index 3ce9cae6c0..e2fb95f7fc 100644 --- a/packages/medusa-file-minio/README.md +++ b/packages/medusa-file-minio/README.md @@ -2,13 +2,15 @@ Upload files to a MinIO server. +Learn more about how you can use this plugin in the [documentation](https://docs.medusajs.com/add-plugins/minio). + ## Options -``` - endpoint: [endpoint of your MinIO server], - bucket: [name of your bucket], - access_key_id: [access-key], - secret_access_key: [secret-access-key], -``` - -Follow [this guide](https://docs.medusa-commerce.com/how-to/uploading-images-to-minio) to configure the plugin. +```js +{ + endpoint: "minio.server.com", + bucket: "test", + access_key_id: "YOUR-ACCESS-KEY", + secret_access_key: "YOUR-SECRET-KEY", +} +``` \ No newline at end of file diff --git a/packages/medusa-file-s3/README.md b/packages/medusa-file-s3/README.md index d7b22d3355..7308e66145 100644 --- a/packages/medusa-file-s3/README.md +++ b/packages/medusa-file-s3/README.md @@ -2,14 +2,16 @@ Upload files to an AWS S3 bucket. +Learn more about how you can use this plugin in the [documentaion](https://docs.medusajs.com/add-plugins/s3). + ## Options +```js +{ + s3_url: "https://s3-guide-test.s3.eu-west-1.amazonaws.com", + bucket: "test", + region: "eu-west-1" + access_key_id: "YOUR-ACCESS-KEY", + secret_access_key: "YOUR-SECRET-KEY", +} ``` - s3_url: [url of your s3 bucket], - access_key_id: [access-key], - secret_access_key: [secret-access-key], - bucket: [name of your bucket], - region: [region of your bucket], -``` - -Follow [this guide](https://docs.medusajs.com/how-to/uploading-images-to-s3) to configure the plugin. diff --git a/packages/medusa-file-spaces/README.md b/packages/medusa-file-spaces/README.md index ea1a72e246..9cf6ef2059 100644 --- a/packages/medusa-file-spaces/README.md +++ b/packages/medusa-file-spaces/README.md @@ -2,14 +2,16 @@ Upload files to a DigitalOcean Space. +Learn more about how you can use this plugin in the [documentaion](https://docs.medusajs.com/add-plugins/spaces). + ## Options +```js +{ + spaces_url: "https://test.fra1.digitaloceanspaces.com", + bucket: "test", + endpoint: "fra1.digitaloceanspaces.com", + access_key_id: "YOUR-ACCESS-KEY", + secret_access_key: "YOUR-SECRET-KEY", +} ``` - spaces_url: [url of your DigitalOcean space], - access_key_id: [access-key], - secret_access_key: [secret-access-key], - bucket: [name of your bucket], - endpoint: [endpoint of you DigitalOcean space], -``` - -Follow [this guide](https://docs.medusajs.com/how-to/uploading-images-to-spaces) to configure the plugin. diff --git a/packages/medusa-payment-paypal/README.md b/packages/medusa-payment-paypal/README.md index 777be3ed58..6cc1d6753f 100644 --- a/packages/medusa-payment-paypal/README.md +++ b/packages/medusa-payment-paypal/README.md @@ -1,11 +1,16 @@ # medusa-payment-paypal +Add PayPal as a Payment Provider. + +Learn more about how you can use this plugin in the [documentaion](https://docs.medusajs.com/add-plugins/paypal). + ## Options +```js +{ + sandbox: true, //default false + client_id: "CLIENT_ID", // REQUIRED + client_secret: "CLIENT_SECRET", // REQUIRED + auth_webhook_id: "WEBHOOK_ID" //REQUIRED for webhook to work +} ``` -sandbox: [default: false], -client_id: "CLIENT_ID", REQUIRED -client_secret: "CLIENT_SECRET", REQUIRED -auth_webhook_id: REQUIRED for webhook to work -``` - diff --git a/packages/medusa-payment-stripe/README.md b/packages/medusa-payment-stripe/README.md new file mode 100644 index 0000000000..7d498b0546 --- /dev/null +++ b/packages/medusa-payment-stripe/README.md @@ -0,0 +1,14 @@ +# medusa-payment-stripe + +Add Stripe as a Payment Provider. + +Learn more about how you can use this plugin in the [documentaion](https://docs.medusajs.com/add-plugins/stripe). + +## Options + +```js +{ + api_key: STRIPE_API_KEY, + webhook_secret: STRIPE_WEBHOOK_SECRET, +} +``` diff --git a/packages/medusa-plugin-algolia/README.md b/packages/medusa-plugin-algolia/README.md index 741b0b5fbc..5d726623ec 100644 --- a/packages/medusa-plugin-algolia/README.md +++ b/packages/medusa-plugin-algolia/README.md @@ -1,10 +1,12 @@ # medusa-plugin-algolia -algolia Plugin for Medusa to search for products. +Algolia Plugin for Medusa to search for products. -## Plugin Options +Learn more about how you can use this plugin in the [documentaion](https://docs.medusajs.com/add-plugins/algolia). -``` +## Options + +```js { application_id: "someId", admin_api_key: "someApiKey", diff --git a/packages/medusa-plugin-contentful/README.md b/packages/medusa-plugin-contentful/README.md new file mode 100644 index 0000000000..60c8707751 --- /dev/null +++ b/packages/medusa-plugin-contentful/README.md @@ -0,0 +1,15 @@ +# medusa-payment-contentful + +Integrate Contentful with Medusa for rich CMS functionalities. + +Learn more about how you can use this plugin in the [documentaion](https://docs.medusajs.com/add-plugins/contentful). + +## Options + +```js +{ + space_id: CONTENTFUL_SPACE_ID, + access_token: CONTENTFUL_ACCESS_TOKEN, + environment: CONTENTFUL_ENV, +} +``` diff --git a/packages/medusa-plugin-mailchimp/README.md b/packages/medusa-plugin-mailchimp/README.md index ff000529f3..7dbb50e162 100644 --- a/packages/medusa-plugin-mailchimp/README.md +++ b/packages/medusa-plugin-mailchimp/README.md @@ -2,12 +2,14 @@ Mailchimp plugin for Medusa that supports newsletter subscriptions. -## Plugin Options +Learn more about how you can use this plugin in the [documentaion](https://docs.medusajs.com/add-plugins/mailchimp). -``` +## Options + +```js { - api_key: [your mailchimp api key] (required), - newsletter_list_id: ["123456789"] (required) + api_key: "MAILCHIMP_API_KEY", + newsletter_list_id: ["123456789"] } ``` diff --git a/packages/medusa-plugin-meilisearch/README.md b/packages/medusa-plugin-meilisearch/README.md index b4055107f5..ea8c04f694 100644 --- a/packages/medusa-plugin-meilisearch/README.md +++ b/packages/medusa-plugin-meilisearch/README.md @@ -2,9 +2,11 @@ Meilisearch Plugin for Medusa to search for products. -## Plugin Options +Learn more about how you can use this plugin in the [documentaion](https://docs.medusajs.com/add-plugins/meilisearch). -``` +## Options + +```js { config: { host: [your meilisearch host], diff --git a/packages/medusa-plugin-sendgrid/README.md b/packages/medusa-plugin-sendgrid/README.md index a6aa8d808f..0c21577410 100644 --- a/packages/medusa-plugin-sendgrid/README.md +++ b/packages/medusa-plugin-sendgrid/README.md @@ -2,30 +2,32 @@ Sendgrid Plugin for Medusa to send transactional emails. +Learn more about how you can use this plugin in the [documentaion](https://docs.medusajs.com/add-plugins/sendgrid). + +## Options If no values are defined for a given option, the plugin will not try to send an email for that event. -## Plugin Options -``` +```js { - api_key: [your sendgrid api key] (required), - from: [the from field, i.e. ACME ] (required), - gift_card_created_template: [used on gift_card.created], - order_placed_template: [used on order.placed], - order_canceled_template: [used on order.canceled], - order_shipped_template: [used on order.shipment_created], - order_completed_template: [used on order.completed], - user_password_reset_template: [used on user.password_reset], - customer_password_reset_template: [used on customer.password_reset], + api_key: "SENDGRID_API_KEY", //required + from: "[the from field, i.e. ACME ]", //required + gift_card_created_template: "[used on gift_card.created]", + order_placed_template: "[used on order.placed]", + order_canceled_template: "[used on order.canceled]", + order_shipped_template: "[used on order.shipment_created]", + order_completed_template: "[used on order.completed]", + user_password_reset_template: "[used on user.password_reset]", + customer_password_reset_template: "[used on customer.password_reset]", localization: { "de-DE": { // locale key - gift_card_created_template: [used on gift_card.created], - order_placed_template: [used on order.placed], - order_canceled_template: [used on order.canceled], - order_shipped_template: [used on order.shipment_created], - order_completed_template: [used on order.completed], - user_password_reset_template: [used on user.password_reset], - customer_password_reset_template: [used on customer.password_reset], + gift_card_created_template: "[used on gift_card.created]", + order_placed_template: "[used on order.placed]", + order_canceled_template: "[used on order.canceled]", + order_shipped_template: "[used on order.shipment_created]", + order_completed_template: "[used on order.completed]", + user_password_reset_template: "[used on user.password_reset]", + customer_password_reset_template: "[used on customer.password_reset]", } } } diff --git a/packages/medusa-plugin-slack-notification/README.md b/packages/medusa-plugin-slack-notification/README.md new file mode 100644 index 0000000000..49f824085e --- /dev/null +++ b/packages/medusa-plugin-slack-notification/README.md @@ -0,0 +1,15 @@ +# medusa-plugin-slack-notification + +Slack Integration to receive new order notifications on Slack. + +Learn more about how you can use this plugin in the [documentaion](https://docs.medusajs.com/add-plugins/slack). + +## Options + +```js +{ + show_discount_code: false, + slack_url: ``, + admin_orders_url: `http://localhost:7001/a/orders` +} +``` diff --git a/packages/medusa-plugin-twilio-sms/README.md b/packages/medusa-plugin-twilio-sms/README.md index 6fbdab56f4..eddbb828f8 100644 --- a/packages/medusa-plugin-twilio-sms/README.md +++ b/packages/medusa-plugin-twilio-sms/README.md @@ -2,13 +2,15 @@ Twilio SMS / Messaging plugin. -## Plugin Options +Learn more about how you can use this plugin in the [documentaion](https://docs.medusajs.com/add-plugins/twilio-sms). -``` +## Options + +```js { - account_sid: [twilio messaging account sid] (required), - auth_token: [twilio massaging authentication token] (required), - from_number: [the number used as sender SMS], + account_sid: "[twilio messaging account sid]", // required + auth_token: "[twilio massaging authentication token]", // required + from_number: "[the number used as sender SMS]", } ``` From b4f077120287a870f7fea5a48079ff8f2c94e20b Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Fri, 20 May 2022 11:44:20 +0300 Subject: [PATCH 4/6] small fixes --- packages/medusa-payment-stripe/README.md | 4 ++-- packages/medusa-plugin-contentful/README.md | 6 +++--- packages/medusa-plugin-meilisearch/README.md | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/medusa-payment-stripe/README.md b/packages/medusa-payment-stripe/README.md index 7d498b0546..78b2ed7ee0 100644 --- a/packages/medusa-payment-stripe/README.md +++ b/packages/medusa-payment-stripe/README.md @@ -8,7 +8,7 @@ Learn more about how you can use this plugin in the [documentaion](https://docs. ```js { - api_key: STRIPE_API_KEY, - webhook_secret: STRIPE_WEBHOOK_SECRET, + api_key: "STRIPE_API_KEY", + webhook_secret: "STRIPE_WEBHOOK_SECRET", } ``` diff --git a/packages/medusa-plugin-contentful/README.md b/packages/medusa-plugin-contentful/README.md index 60c8707751..aace02037c 100644 --- a/packages/medusa-plugin-contentful/README.md +++ b/packages/medusa-plugin-contentful/README.md @@ -8,8 +8,8 @@ Learn more about how you can use this plugin in the [documentaion](https://docs. ```js { - space_id: CONTENTFUL_SPACE_ID, - access_token: CONTENTFUL_ACCESS_TOKEN, - environment: CONTENTFUL_ENV, + space_id: "CONTENTFUL_SPACE_ID", + access_token: "CONTENTFUL_ACCESS_TOKEN", + environment: "CONTENTFUL_ENV", } ``` diff --git a/packages/medusa-plugin-meilisearch/README.md b/packages/medusa-plugin-meilisearch/README.md index ea8c04f694..a2f81bfbff 100644 --- a/packages/medusa-plugin-meilisearch/README.md +++ b/packages/medusa-plugin-meilisearch/README.md @@ -9,10 +9,10 @@ Learn more about how you can use this plugin in the [documentaion](https://docs. ```js { config: { - host: [your meilisearch host], + host: "[your meilisearch host]", }, settings: { - [indexName]: [meilisearch settings passed to meilisearch's `updateSettings()` method] + "[indexName]": "[meilisearch settings passed to meilisearch's `updateSettings()` method]" // example products: { searchableAttributes: ["title", "description", "variant_sku", "type_value"], From 5428195af3bf0b1ce87b268ca1dd08fa96272329 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Sun, 22 May 2022 17:48:26 +0300 Subject: [PATCH 5/6] docs: Fixed broken PayPal link (#1490) --- docs/content/advanced/backend/payment/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/advanced/backend/payment/overview.md b/docs/content/advanced/backend/payment/overview.md index c65119176a..a34c19e4e3 100644 --- a/docs/content/advanced/backend/payment/overview.md +++ b/docs/content/advanced/backend/payment/overview.md @@ -127,4 +127,4 @@ This prevents any payment issues from occurring with the customers and allows fo ## What’s Next 🚀 - [Check out how the checkout flow is implemented on the frontend.](./frontend-payment-flow-in-checkout.md) -- Check out payment plugins like [Stripe](../../../add-plugins/stripe.md), [Paypal](../../../add-plugins/paypal.md), and [Klarna](../../../add-plugins/klarna.md). +- Check out payment plugins like [Stripe](../../../add-plugins/stripe.md), [Paypal](/add-plugins/paypal), and [Klarna](../../../add-plugins/klarna.md). From 5e0e5b90fc30876b3fea6045d896f7e8ab41a73b Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Sun, 22 May 2022 17:51:13 +0300 Subject: [PATCH 6/6] docs: Fix dark mode logos in API reference (#1504) --- .../src/components/ColorModeToggler/index.js | 41 ++++++++++++++----- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/www/reference/src/components/ColorModeToggler/index.js b/www/reference/src/components/ColorModeToggler/index.js index 7b990bc539..67aa6fd83e 100644 --- a/www/reference/src/components/ColorModeToggler/index.js +++ b/www/reference/src/components/ColorModeToggler/index.js @@ -8,19 +8,40 @@ import { useColorMode } from 'theme-ui' export default function ColorModeToggler () { const [, setColorMode] = useColorMode() + + function checkLocalStorage (currentTheme, toggleTheme) { + //check that theme local storage values are set correctly + let themeUiColorMode = window.localStorage.getItem('theme-ui-color-mode'); + let theme = window.localStorage.getItem('theme') + if (!themeUiColorMode) { + themeUiColorMode = theme || currentTheme + window.localStorage.setItem('theme-ui-color-mode', themeUiColorMode); + setColorMode(themeUiColorMode); + } + if (!theme) { + theme = themeUiColorMode || currentTheme + window.localStorage.setItem('theme', theme); + toggleTheme(theme) + } + + return theme || themeUiColorMode || currentTheme; + } return ( - {({ theme, toggleTheme }) => ( - - )} + {({ theme, toggleTheme }) => { + const currentTheme = checkLocalStorage(theme, toggleTheme); + return ( + + ); + }} ) } \ No newline at end of file