Skip to content

Commit

Permalink
feat(tt): turn off pop-up surveys for select pages
Browse files Browse the repository at this point in the history
  • Loading branch information
joelhooks committed Oct 28, 2024
1 parent 1d97162 commit e1cd0b1
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 29 deletions.
4 changes: 3 additions & 1 deletion apps/total-typescript/src/components/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type LayoutProps = {
className?: string
nav?: React.ReactElement | null
footer?: React.ReactElement | null
survey?: boolean
children?: any
}

Expand All @@ -28,6 +29,7 @@ const Layout: FunctionComponent<LayoutProps> = ({
noIndex,
nav,
footer,
survey = true,
}) => {
const router = useRouter()
const {isFeedbackDialogOpen, feedbackComponent} = useFeedback()
Expand Down Expand Up @@ -103,7 +105,7 @@ const Layout: FunctionComponent<LayoutProps> = ({
{children}
</div>
{footer ? footer : isNull(footer) ? null : <Footer />}
<Survey />
{survey && <Survey />}
</div>
)
}
Expand Down
60 changes: 36 additions & 24 deletions apps/total-typescript/src/offer/survey/data-typescript-2024.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function getFinalQuestion(answers: Record<string, string>): string {
(challenge === 'team_adoption' ||
answers.learning_priority === 'team_adoption')
) {
return "We love working with technical leaders who are helping their teams level up with TypeScript! Could you tell us more about your team's TypeScript journey? What specific challenges are you facing with adoption, and what would make the biggest impact for your team right now?"
return "Tell us more about your team's TypeScript journey? What specific challenges are you facing with adoption, and what would make the biggest impact for your team right now?"
}

// Learning Journey variant
Expand All @@ -20,11 +20,11 @@ function getFinalQuestion(answers: Record<string, string>): string {
skillLevel === 'advanced-beginner' ||
challenge === 'fundamentals'
) {
return "Everyone's TypeScript learning journey is unique! Could you tell us about what motivated you to learn TypeScript and what specific concepts or patterns you're most eager to master? What would help you feel more confident using TypeScript in your projects?"
return "Tell us about what motivated you to learn TypeScript and what specific concepts or patterns you're most excited to master? What would help you feel more confident using TypeScript in your projects?"
}

// Individual Developer variant (default)
return "It sounds like you're diving deep into TypeScript's technical challenges! Could you share more about the specific problems you're trying to solve? What kinds of TypeScript patterns or solutions would make the biggest difference in your day-to-day work?"
return "Share more about the specific problems you're trying to solve? What kinds of TypeScript patterns or solutions would make the biggest difference in your day-to-day work?"
}

export const dataTypescript2024: QuizResource = {
Expand Down Expand Up @@ -89,10 +89,6 @@ export const dataTypescript2024: QuizResource = {
answer: 'fullstack',
label: 'Full-stack (both frontend and backend)',
},
{
answer: 'none',
label: "I don't use TypeScript",
},
],
},
role: {
Expand Down Expand Up @@ -130,24 +126,36 @@ export const dataTypescript2024: QuizResource = {
label: 'React',
},
{
answer: 'nextjs',
label: 'Next.js',
answer: 'vue',
label: 'Vue',
},
{
answer: 'svelte',
label: 'Svelte',
},
{
answer: 'solid',
label: 'Solid',
},
{
answer: 'nodejs',
label: 'Node.js',
},
{
answer: 'express',
label: 'Express',
answer: 'bun',
label: 'Bun',
},
{
answer: 'deno',
label: 'Deno',
},
{
answer: 'nestjs',
label: 'NestJS',
answer: 'zod',
label: 'Zod',
},
{
answer: 'vanilla',
label: 'Vanilla TypeScript',
answer: 'trpc',
label: 'tRPC',
},
{
answer: 'other',
Expand All @@ -156,21 +164,25 @@ export const dataTypescript2024: QuizResource = {
],
},
current_challenge: {
question: "What's your biggest TypeScript challenge right now?",
question: 'What is your biggest TypeScript challenge right now?',
type: 'multiple-choice',
shuffleChoices: true,
choices: [
{
answer: 'types',
label: 'Writing better types for my code',
answer: 'debugging',
label: 'Debugging type errors',
},
{
answer: 'complex_types',
label: 'Managing complex type systems',
answer: 'speed',
label: 'Not moving fast enough',
},
{
answer: 'setup',
label: 'Setting up and configuring TypeScript projects',
answer: 'better_types',
label: 'Writing better types for my code',
},
{
answer: 'config',
label: 'Configuring TypeScript projects',
},
{
answer: 'team_adoption',
Expand All @@ -181,8 +193,8 @@ export const dataTypescript2024: QuizResource = {
label: 'Understanding advanced TypeScript features',
},
{
answer: 'debugging',
label: 'Debugging type-related issues',
answer: 'migration',
label: 'Migrating to TypeScript',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const Invoice: React.FC<
meta={{title: `Invoice for ${productName}`}}
footer={null}
className="print:bg-white print:text-black"
survey={false}
>
<main className="mx-auto max-w-screen-md">
<div className="flex flex-col items-center justify-between px-5 pb-8 pt-20 text-center sm:pt-28 md:text-left print:hidden">
Expand Down
2 changes: 1 addition & 1 deletion apps/total-typescript/src/pages/invoices/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const Learn: React.FC<React.PropsWithChildren<{purchases: Purchase[]}>> = ({
purchases = [],
}) => {
return (
<Layout meta={{title: 'Invoices'}}>
<Layout meta={{title: 'Invoices'}} survey={false}>
<main className="mx-auto flex h-full w-full max-w-2xl flex-grow flex-col px-5 py-24 sm:py-32">
<h1 className="pb-4 font-text text-3xl font-medium text-white">
Your Invoices
Expand Down
3 changes: 2 additions & 1 deletion apps/total-typescript/src/pages/survey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ const SurveyPageWrapper: React.FC = () => {
return (
<Layout
meta={{
title: 'Survey',
title: 'Total TypeScript 2024 Survey',
}}
survey={false}
>
<div id="ask">
{isLoading ? (
Expand Down
1 change: 1 addition & 0 deletions apps/total-typescript/src/pages/team/buy-more-seats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ const BuyMoreSeatsPage: React.FC<
meta={{
title: `Buy more seats`,
}}
survey={false}
>
<div
id="buy-more-seats"
Expand Down
5 changes: 4 additions & 1 deletion apps/total-typescript/src/pages/team/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ const TeamPage: React.FC<React.PropsWithChildren<TeamPageProps>> = ({
)

return (
<Layout meta={{title: 'Invite your team to Total TypeScript'}}>
<Layout
meta={{title: 'Invite your team to Total TypeScript'}}
survey={false}
>
<main
data-team-page=""
className="mx-auto flex w-full max-w-xl flex-grow flex-col items-center justify-center gap-3 p-5 pb-16 pt-28 text-gray-900"
Expand Down
2 changes: 1 addition & 1 deletion apps/total-typescript/src/pages/thanks/redeem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const ThanksRedeem: React.FC<
React.PropsWithChildren<{purchase: any; email: string}>
> = ({email}) => {
return (
<Layout footer={null}>
<Layout footer={null} survey={false}>
<main className="flex flex-grow flex-col items-center justify-center px-5 pb-16 pt-5">
<div className="mx-auto w-full max-w-3xl">
<h1 className="w-full pb-3 font-semibold uppercase tracking-wide">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const Welcome = ({
<Layout
meta={{title: `Welcome to ${process.env.NEXT_PUBLIC_SITE_TITLE}`}}
footer={null}
survey={false}
>
<main className="mx-auto flex w-full flex-grow flex-col items-center justify-center px-5 py-24 sm:py-32">
{data?.transferState === 'INITIATED' && (
Expand Down
1 change: 1 addition & 0 deletions apps/total-typescript/src/pages/welcome/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ const Welcome: React.FC<
<Layout
meta={{title: `Welcome to ${process.env.NEXT_PUBLIC_SITE_TITLE}`}}
footer={null}
survey={false}
>
<main
className="mx-auto flex w-full flex-grow flex-col items-center justify-center px-5 pb-32 pt-24"
Expand Down

0 comments on commit e1cd0b1

Please sign in to comment.