From abc999bf371c44bf91b4dbbcabf80248e54b34a8 Mon Sep 17 00:00:00 2001 From: Chuck Carpenter Date: Thu, 23 May 2024 19:43:39 -0700 Subject: [PATCH] =?UTF-8?q?Landing:=20=F0=9F=9A=9A=20Move=20blog=20to=20in?= =?UTF-8?q?dex=20page=20and=20update=20URLs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 +- app/api/src/functions/auth.ts | 29 +- app/api/src/mail/DemoRequest/DemoRequest.tsx | 2 +- .../src/mail/ResetPassword/ResetPassword.tsx | 2 +- app/api/src/mail/Welcome/Welcome.tsx | 2 +- .../services/subscriptions/subscriptions.ts | 11 +- .../src/components/DemoDialog/DemoDialog.tsx | 12 +- app/web/src/components/Footer/index.tsx | 4 +- .../src/components/Navigation/UnAuthNav.tsx | 17 ++ app/web/src/pages/PricingPage/PricingPage.tsx | 31 +- docs-src/src/content/docs/recipes/cookbook.md | 2 +- landing/astro.config.mjs | 9 +- landing/package.json | 1 + landing/src/components/Header.astro | 102 +------ landing/src/layouts/MainPage.astro | 274 +---------------- landing/src/pages/demo.astro | 277 +++++++++++++++++- landing/src/pages/index.astro | 37 ++- packages/react/README.md | 4 +- pnpm-lock.yaml | 3 + shepherd.js/README.md | 4 +- 20 files changed, 419 insertions(+), 412 deletions(-) diff --git a/README.md b/README.md index 3ec70e9fb..18360ac6d 100644 --- a/README.md +++ b/README.md @@ -46,9 +46,9 @@ Unlock additional capabilities and more full featured Journeys. # Demo See Shepherd Live on our docs website by clicking on the image: - + Guide your users through a tour of your app @@ -82,8 +82,8 @@ If you have an idea or project in mind and would like to engage our team to buil ## Resources - [Website](https://shepherdpro.com/) -- [Documentation](https://shepherdjs.dev/docs/) -- [Demo](https://shepherdjs.dev/demo/) +- [Documentation](https://docs.shepherdpro.com/) +- [Demo](https://blog.shepherdpro.com/demo/) - If you have any questions about our projects you can email [hello@shepherdpro.com](mailto:hello@shepherdpro.com) diff --git a/app/api/src/functions/auth.ts b/app/api/src/functions/auth.ts index 9e087d72f..fcdfaf0c9 100644 --- a/app/api/src/functions/auth.ts +++ b/app/api/src/functions/auth.ts @@ -1,5 +1,5 @@ import type { APIGatewayProxyEvent, Context } from 'aws-lambda'; - +import { PostHog } from 'posthog-node'; import { DbAuthHandler } from '@redwoodjs/auth-dbauth-api'; import type { DbAuthHandlerOptions, @@ -11,7 +11,7 @@ import { db } from 'src/lib/db'; import { generateAPIKey } from 'src/lib/utils'; import { createSubscription, - getSubscriptionCheckoutUrl, + // getSubscriptionCheckoutUrl, } from 'src/services/subscriptions/subscriptions'; import { sendResetEmail, sendWelcomeEmail } from 'src/services/emails'; @@ -20,6 +20,10 @@ interface UserAttributes { plan?: string; } +const phDefaultClient = new PostHog(process.env.POSTHOG_API_KEY, { + host: 'https://us.posthog.com', +}); + export const handler = async ( event: APIGatewayProxyEvent, context: Context @@ -144,7 +148,11 @@ export const handler = async ( }, }); - const userPlan = 'alpha-usd-monthly'; + // Chargebee plan ID for test site defaulted to caps and can't be edited + const userPlan = + process.env.NODE_ENV === 'development' + ? 'Alpha-USD-Monthly' + : 'alpha-usd-monthly'; if (newUser) { sendWelcomeEmail({ @@ -162,6 +170,21 @@ export const handler = async ( }, }); + phDefaultClient.capture({ + distinctId: `shepherd-user-${newUser.id}`, + event: `Shepherd Signup`, + properties: { + $set: { + email: username, + name: userAttributes?.name, + plan: userPlan, + }, + }, + groups: { + account: newAccount.id, + }, + }); + // TODO: Uncomment this when we are ready to start charging users // const { url } = await getSubscriptionCheckoutUrl({ // planId: userPlan, diff --git a/app/api/src/mail/DemoRequest/DemoRequest.tsx b/app/api/src/mail/DemoRequest/DemoRequest.tsx index f1857c0a0..345cb575c 100644 --- a/app/api/src/mail/DemoRequest/DemoRequest.tsx +++ b/app/api/src/mail/DemoRequest/DemoRequest.tsx @@ -39,7 +39,7 @@ export function DemoRequest({ description, from, name, title, when }) { > Shepherd Pro logo Shepherd Pro logo Shepherd Pro logo { // close the dialog and send the request regardless of response closeDialog(); - const response = await requestDemo({ variables: { input: { + const response = await requestDemo({ + variables: { + input: { description: data.description, from: data.email, name: data.name, subject: 'Shepherd Demo Request', title: data.title, - } - } + }, + }, }); if (response.errors) { toast(response.errors[0].message); @@ -120,7 +122,7 @@ const DemoDialog = () => {
@@ -82,6 +90,15 @@ export default function UnAuthNav() { +
+ + Blog + +
+
- - +

+ {plan.description} +

))} diff --git a/docs-src/src/content/docs/recipes/cookbook.md b/docs-src/src/content/docs/recipes/cookbook.md index 088561289..b355aa688 100644 --- a/docs-src/src/content/docs/recipes/cookbook.md +++ b/docs-src/src/content/docs/recipes/cookbook.md @@ -59,7 +59,7 @@ const tour = new Shepherd.Tour({ Using the already exposed API, you could add a progress indicator of your choosing for each step to let your users know how far into a tour they may be. -The example below uses the [Step](https://shepherdjs.dev/docs/Step.html) `options` +The example below uses the [Step](https://docs.shepherdpro.com/api/step/classes/step/) `options` object and adds to `when` on the `show` event. Within that, we create an element to render in the header with text of what step out of all potential steps is now being show. diff --git a/landing/astro.config.mjs b/landing/astro.config.mjs index 35da59bcf..cf0584589 100644 --- a/landing/astro.config.mjs +++ b/landing/astro.config.mjs @@ -6,9 +6,8 @@ import tailwind from '@astrojs/tailwind'; // https://astro.build/config export default defineConfig({ - integrations: [ - mdx(), - sitemap(), - tailwind() - ] + integrations: [mdx(), sitemap(), tailwind()], + redirects: { + '/blog': '/' + } }); diff --git a/landing/package.json b/landing/package.json index f7e893ccb..2fc0be4ca 100644 --- a/landing/package.json +++ b/landing/package.json @@ -17,6 +17,7 @@ "@astrojs/sitemap": "^3.1.2", "@astrojs/tailwind": "^5.0.3", "astro": "^4.8.4", + "shepherd.js": "workspace:*", "tailwindcss": "^3.4.3", "typescript": "^5.4.5" }, diff --git a/landing/src/components/Header.astro b/landing/src/components/Header.astro index 0cdbde5e0..5d3bfb432 100644 --- a/landing/src/components/Header.astro +++ b/landing/src/components/Header.astro @@ -2,8 +2,6 @@ import { SITE_TITLE } from '../consts'; import ShepherdHead from '../images/shepherd-head.svg?raw'; import ShepherdHeader from '../images/shepherd-header.svg'; - -const { isHome } = Astro.props; ---
@@ -30,8 +28,8 @@ const { isHome } = Astro.props; > Docs - - Blog + + Demo @@ -42,11 +40,8 @@ const { isHome } = Astro.props; > Pro - - Pricing + + Blog

- Guide your users through a tour of your app. + Guide your users through a tour of your app

- -
- { - isHome && ( -
-
-
- - -
- -
-

- Accessibility -

- -

- Shepherd has full keyboard navigation support, focus - trapping, and a11y compliance via aria attributes. -

-
- -
-
-
- -
-
- - -
- -
-

- Highly Customizable -

- -

- Shepherd's styles are kept minimal, allowing you to easily - customize the look and feel, but still give you enough to - drop in and be ready to go quickly. -

-
- -
-
-
- -
-
- - -
- -
-

- Framework Ready -

- -

- Shepherd is ready to drop into your application using React, - Ember, Angular, Vue.js, ES Modules, or plain Javascript! -

-
- -
-
-
-
- ) - } -
diff --git a/landing/src/layouts/MainPage.astro b/landing/src/layouts/MainPage.astro index cc57cc67c..942948636 100644 --- a/landing/src/layouts/MainPage.astro +++ b/landing/src/layouts/MainPage.astro @@ -5,7 +5,7 @@ import Header from '../components/Header.astro'; import Footer from '../components/Footer.astro'; import GithubButton from '../components/GithubButton.astro'; import { SITE_TITLE } from '../consts'; -const { isHome } = Astro.props; + const shepherdIncludeCode = ` @@ -14,79 +14,13 @@ const shepherdIncludeCode = ` --- -
+
-
- Demo -
+