Skip to content

Commit

Permalink
Merge pull request #352 from claushaas/staging
Browse files Browse the repository at this point in the history
pass utm url parameters to checkout
  • Loading branch information
claushaas authored Aug 23, 2024
2 parents c9f47a0 + fb44d5d commit cb64bcd
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 109 deletions.
10 changes: 7 additions & 3 deletions app/components/school-plans-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
CheckCircleIcon,
} from '@heroicons/react/24/outline';
import * as Dialog from '@radix-ui/react-dialog';
import {Link} from '@remix-run/react';
import {Link, useLocation} from '@remix-run/react';
import {Button, ButtonPreset, ButtonType} from './button.js';

type SchoolPlansDialogProperties = {
Expand All @@ -12,6 +12,10 @@ type SchoolPlansDialogProperties = {
};

export default function SchoolPlansDialog({isOpen, onOpenChange}: SchoolPlansDialogProperties) {
const {search} = useLocation();
const searchParameters = search ? search.split('?')[1].split('&') : [];
const marketingSearchParameters = searchParameters.filter(searchParameter => searchParameter.includes('utm_'));

return (
<Dialog.Root open={isOpen} onOpenChange={onOpenChange}>
<Dialog.Portal>
Expand Down Expand Up @@ -65,7 +69,7 @@ export default function SchoolPlansDialog({isOpen, onOpenChange}: SchoolPlansDia

<div className='flex justify-center flex-col items-center gap-3'>
<p>R$ 77,00/mês</p>
<Link to='https://pay.hotmart.com/Y5414825L?off=z0k6km14&hideBillet=1&hidePix=1&showOnlyTrial=1' target='_blank'>
<Link to={`https://pay.hotmart.com/Y5414825L?off=z0k6km14&hideBillet=1&hidePix=1&showOnlyTrial=1&${marketingSearchParameters.join('&')}`} target='_blank'>
<Button
type={ButtonType.Button}
preset={ButtonPreset.Secondary}
Expand Down Expand Up @@ -140,7 +144,7 @@ export default function SchoolPlansDialog({isOpen, onOpenChange}: SchoolPlansDia
<p className='text-xs'>pago anualmente</p>
<p>ou R$ 497,00 por ano</p>
</div>
<Link to='https://pay.hotmart.com/Y5414825L?off=0dc69b6z&hideBillet=1&hidePix=1&showOnlyTrial=1' target='_blank'>
<Link to={`https://pay.hotmart.com/Y5414825L?off=0dc69b6z&hideBillet=1&hidePix=1&showOnlyTrial=1&${marketingSearchParameters.join('&')}`} target='_blank'>
<Button
type={ButtonType.Button}
preset={ButtonPreset.Primary}
Expand Down
1 change: 0 additions & 1 deletion app/routes/escola-online.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import * as Accordion from '@radix-ui/react-accordion';
import {useState} from 'react';
import {Button, ButtonPreset, ButtonType} from '~/components/button.js';
import {Testimonies} from '~/layouts/testimonies.js';
import {History} from '~/layouts/yem-history.js';
import {buildImgSource} from '~/utils/build-cloudflare-image-source.js';
import {PlaylistCard} from '~/components/playlist-card.js';
import {AccordionItem} from '~/components/accordion.js';
Expand Down
Loading

0 comments on commit cb64bcd

Please sign in to comment.