Skip to content

Commit

Permalink
Merge pull request #171 from Light-it-labs/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
cgarcia-lightit authored Jun 12, 2024
2 parents d93f436 + 2b18daf commit f5312fc
Show file tree
Hide file tree
Showing 17 changed files with 289 additions and 247 deletions.
121 changes: 121 additions & 0 deletions apps/eo_web/dist/assets/main-1935110a.js

Large diffs are not rendered by default.

121 changes: 0 additions & 121 deletions apps/eo_web/dist/assets/main-6bf21a8a.js

This file was deleted.

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions apps/eo_web/dist/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
"src": "../../packages/ui/src/assets/avatar.svg"
},
"src/main.css": {
"file": "assets/main-bab31051.css",
"file": "assets/main-a73a2c36.css",
"src": "src/main.css"
},
"src/main.tsx": {
"assets": [
"assets/UploadFile-694e44b5.svg"
],
"css": [
"assets/main-bab31051.css"
"assets/main-a73a2c36.css"
],
"file": "assets/main-6bf21a8a.js",
"file": "assets/main-1935110a.js",
"isEntry": true,
"src": "src/main.tsx"
}
Expand Down
7 changes: 6 additions & 1 deletion apps/eo_web/src/components/FAQs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ const flowsWithCOrgFaqs: FlowType[] = [
Flows.stupid_cancer,
];

const flowsWithInovaFaqs: FlowType[] = [
Flows.inova,
Flows.uva,
];

const getFAQCopies = (flow?: FlowType) => {
if (flow && flowsWithCOrgFaqs.includes(flow)) return cOrgFaqs;
if (flow === Flows.inova) return inovaFaqs;
if (flow && flowsWithInovaFaqs.includes(flow)) return inovaFaqs;
if (flow === Flows.cancer_pilot) return pilotFaqs;

return paidFaqs;
Expand Down
29 changes: 24 additions & 5 deletions apps/eo_web/src/components/HowEOWorks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,39 @@ import React from "react";

import { Typography } from "@eo/ui";

import { CancerPilotCarrouselItems, CarrouselItems } from "~/copy/copy";
import {
CancerPilotCarrouselItems,
CarrouselItems,
InovaItems,
type CarrouselItem,
} from "~/copy/copy";
import { Flows, type FlowType } from "~/stores/useProfilingStore";
import { EoCarousel } from "./Carousel";


interface HowEOWorksProps {
pilot?: boolean
flow?: FlowType;
}

export const HowEOWorks = ({ pilot = false }: HowEOWorksProps) => {
const carouselItems = pilot ? CancerPilotCarrouselItems : CarrouselItems;
export const HowEOWorks = ({ flow }: HowEOWorksProps) => {
let carouselItems: CarrouselItem[] = [];
switch (flow) {
case Flows.cancer_pilot:
carouselItems = CancerPilotCarrouselItems;
break;
case Flows.inova:
carouselItems = InovaItems;
break;
default:
carouselItems = CarrouselItems;
}

return (
<section className="bg-white px-6 py-12 md:px-[50px] md:py-[100px] ">
<Typography font="bold" variant="large" className="mb-20 text-center">
{pilot ? "How the EO Pilot Works" : "How EO Care Plans Work"}
{flow === Flows.cancer_pilot
? "How the EO Pilot Works"
: "How EO Care Plans Work"}
</Typography>
<EoCarousel>
{carouselItems.map(({ title, content, step, icon: Icon }) => (
Expand Down
2 changes: 2 additions & 0 deletions apps/eo_web/src/components/ThankYou.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Typography } from "@eo/ui";

import { Loading } from "~/components/Loading";
import { useMount } from "~/hooks/useMount";
import { type Channel } from "~/stores/useProfilingStore";
import { AllDonePanel } from "./AllDonePanel";


Expand All @@ -15,6 +16,7 @@ type ThankYouProps = HTMLAttributes<HTMLElement> & {
email: string;
phase?: string;
submission_id: string;
channel: Channel;
};
mutationKey: string[];
mutationFunction: (data: object) => Promise<any>;
Expand Down
152 changes: 71 additions & 81 deletions apps/eo_web/src/copy/copy.tsx
Original file line number Diff line number Diff line change
@@ -1,106 +1,96 @@
import { type ReactNode } from "react";
import { type ElementType, type ReactNode } from "react";

import { icons } from "@eo/ui";





export type Copy = {
export type CarrouselItem = {
step: string;
title: string;
content: string | ReactNode;
icon: ElementType;
};

export const CancerPilotCarrouselItems = [
{
step: "STEP 1",
title: "Profile & subscribe",
content:
"In 5-10 minutes, you can share the key information our clinical team needs to create your initial plan.",
icon: icons.ProfileIconWhite,
},
{
step: "STEP 2",
title: "Get your care plan",
content:
"In under 24 hours, you’ll receive an email with a link to your personalized, clinician-approved care plan.",
icon: icons.HandHeartWhite,
},
const STEP_1: CarrouselItem = {
step: "STEP 1",
title: "Profile & subscribe",
content:
"In 5-10 minutes, you can share the key information our clinical team needs to create your initial plan.",
icon: icons.ProfileIconWhite,
};
const STEP_2: CarrouselItem = {
step: "STEP 2",
title: "Get your care plan",
content:
"In under 24 hours, you’ll receive an email with a link to your personalized, clinician-approved care plan.",
icon: icons.HandHeartWhite,
};
const STEP_3: CarrouselItem = {
step: "STEP 3",
title: "Get your products",
content:
"You’ll order recommended CDB and Delta-9 THC products online for easy home delivery. Typically, there’s no need to visit a dispensary.",
icon: icons.PillsWhite,
};
const STEP_4: CarrouselItem = {
step: "STEP 4",
title: "Provide feedback",
content:
"As you use your recommended products per the directions in your care plan, we’ll check in regularly and ask you to complete brief, periodic surveys.",
icon: icons.FeedBackWhite,
};

const STEP_5: CarrouselItem = {
step: "STEP 5",
title: "Get refined plans",
content:
"Early on, we’ll provide updated plans every 3-7 days based on your inputs. We’ll then regularly tune your plan for efficacy, safety and affordability.",
icon: icons.CalendarChecked,
};

const STEP_6: CarrouselItem = {
step: "ALWAYS",
title: "Be supported",
content:
"You can message our clinical team anytime as needs or questions arise - as often as you like. We’ll respond in under 24 hours - and usually within minutes.",
icon: icons.SupportIconWhite,
};

export const CancerPilotCarrouselItems: CarrouselItem[] = [
STEP_1,
STEP_2,
{
step: "STEP 3",
title: "Get your products",
...STEP_3,
content:
"You’ll order recommended CDB and Delta-9 THC products online for easy home delivery. Our team will provide details on how to be reimbursed for all purchases.",
icon: icons.PillsWhite,
},
{
step: "STEP 4",
title: "Provide feedback",
content:
"As you use your recommended products per the directions in your care plan, we’ll check in regularly and ask you to complete brief, periodic surveys.",
icon: icons.FeedBackWhite,
},
{
step: "STEP 5",
title: "Get refined plans",
content:
"Early on, we’ll provide updated plans every 3-7 days based on your inputs. We’ll then regularly tune your plan for efficacy, safety and affordability.",
icon: icons.CalendarChecked,
},
{
step: "ALWAYS",
title: "Be supported",
content:
"You can message our clinical team anytime as needs or questions arise - as often as you like. We’ll respond in under 24 hours - and usually within minutes.",
icon: icons.SupportIconWhite,
},
STEP_4,
STEP_5,
STEP_6,
];

export const CarrouselItems = [
{
step: "STEP 1",
title: "Profile & subscribe",
content:
"In 5-10 minutes, you can share the key information our clinical team needs to create your initial plan.",
icon: icons.ProfileIconWhite,
},
{
step: "STEP 2",
title: "Get your care plan",
content:
"In under 24 hours, you’ll receive an email with a link to your personalized, clinician-approved care plan.",
icon: icons.HandHeartWhite,
},
export const InovaItems: CarrouselItem[] = [
STEP_1,
STEP_2,
{
step: "STEP 3",
title: "Get your products",
...STEP_3,
content:
"You’ll order recommended CDB and Delta-9 THC products online for easy home delivery. Typically, there’s no need to visit a dispensary.",
icon: icons.PillsWhite,
},
{
step: "STEP 4",
title: "Provide feedback",
content:
"As you use your recommended products per the directions in your care plan, we’ll check in regularly and ask you to complete brief, periodic surveys.",
icon: icons.FeedBackWhite,
},
{
step: "STEP 5",
title: "Get refined plans",
content:
"Early on, we’ll provide updated plans every 3-7 days based on your inputs. We’ll then regularly tune your plan for efficacy, safety and affordability.",
icon: icons.CalendarChecked,
},
{
step: "ALWAYS",
title: "Be supported",
content:
"You can message our clinical team anytime as needs or questions arise - as often as you like. We’ll respond in under 24 hours - and usually within minutes.",
icon: icons.SupportIconWhite,
},
STEP_4,
STEP_5,
STEP_6,
];

export const CarrouselItems = [STEP_1, STEP_2, STEP_3, STEP_4, STEP_5, STEP_6];

export type Copy = {
title: string;
content: string | ReactNode;
};

export const cOrgFaqs: Copy[] = [
{
title: "How much does an EO care plan cost?",
Expand Down Expand Up @@ -361,7 +351,7 @@ export const inovaFaqs: Copy[] = [
{
title: "How much does EO cost?",
content:
"Your care is completely free. And we’ll reimburse you for the cost of your products over your first 90 days of care. Just send a picture of your receipt to [email protected] each time you make a purchase and we’ll provide you with an Amazon gift card in an equal amount.",
"Your care is completely free. This includes your clinician-reviewed plan, ongoing plan optimization based on your feedback and unlimited phone calls and in-app messaging with our care team. All you pay for are your products.",
},
{
title: "How do I get my products?",
Expand Down
6 changes: 6 additions & 0 deletions apps/eo_web/src/layouts/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ const inova = [
...basicData,
];

const uva = [
{ title: "About EO", url: "https://partner.eo.care/inova/about" },
...basicData,
];

const twist_out_cancer = [
{ title: "About EO", url: "https://partner.eo.care/twist-out-cancer/about" },
{
Expand Down Expand Up @@ -139,6 +144,7 @@ const allData = {
resource_center_1,
resource_center_2,
inova,
uva,
imerman,
unite_for_her,
mass_retirees,
Expand Down
32 changes: 18 additions & 14 deletions apps/eo_web/src/screens/Cancer/CancerSurveyThankYou.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { Navigate, useSearchParams } from "react-router-dom";

import { useApi } from "~/api/useApi";
import { ThankYou } from "~/components";
import { FAQs } from "~/components/FAQs";
import { HowEOWorks } from "~/components/HowEOWorks";
import { LayoutDefault } from "~/layouts";
import { Footer } from "~/layouts/Footer";
import { FooterFull } from "~/layouts/FooterFull";
import { Flows, type FlowType } from "~/stores/useProfilingStore";
import { Footer } from "~/layouts/Footer";
import { ThankYou } from "~/components";
import { useSurveyStore } from "~/stores/useSurveyStore";
import { useApi } from "~/api/useApi";
import { Navigate, useSearchParams } from "react-router-dom";


const flowsWithSmallFooter: FlowType[] = [
Flows.c_org,
Expand All @@ -18,33 +20,35 @@ const flowsWithSmallFooter: FlowType[] = [
Flows.resource_center_2,
Flows.employer_center,
Flows.inova,
Flows.uva,
];

export const CancerSurveyThankYou = () => {
const { flow, email, phase } = useSurveyStore();
const { flow, email, phase, channel } = useSurveyStore();

const [searchParams] = useSearchParams();
const submission_id = searchParams.get("submission_id") ?? "";

const { postCancerSurveyFormSubmission } = useApi();

if (!submission_id) {
return <Navigate to={'/'} />
if (!submission_id || !channel) {
return <Navigate to={"/"} />;
}


return (
<LayoutDefault>
<ThankYou
mutationKey={["postCancerSurveyFormSubmission", submission_id]}
mutationFunction={postCancerSurveyFormSubmission}
mutationsParams={{ email, phase, submission_id }}
mutationsParams={{ email, phase, submission_id, channel }}
/>
<HowEOWorks pilot={flow === Flows.cancer_pilot} />
<HowEOWorks flow={flow} />
<FAQs flow={flow} />
{flowsWithSmallFooter.includes(flow)
? <Footer flow={flow} />
: <FooterFull />}
</LayoutDefault >
{flowsWithSmallFooter.includes(flow) ? (
<Footer flow={flow} />
) : (
<FooterFull />
)}
</LayoutDefault>
);
};
6 changes: 4 additions & 2 deletions apps/eo_web/src/screens/Cancer/SurveyForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ import {
import { getUrlFromHost, scapeParamFromQuery } from "~/helpers";
import { useMount } from "~/hooks/useMount";
import { LayoutDefault } from "~/layouts";
import { Flows } from "~/stores/useProfilingStore";
import { Channels, Flows } from "~/stores/useProfilingStore";
import { useSurveyStore } from "~/stores/useSurveyStore";


export const SurveyForm = () => {
const [searchParams] = useSearchParams();
const { setPhase, setEmail, setFlow } = useSurveyStore();
const { setPhase, setEmail, setFlow, setChannel } = useSurveyStore();
const { surveyStatus, getProfilingFlow } = useApi();

const email = scapeParamFromQuery("email", searchParams);
Expand All @@ -33,6 +34,7 @@ export const SurveyForm = () => {
useMount(() => {
setPhase(phase);
setEmail(email as string);
setChannel(Channels.cancer);
});

const { data, isLoading, isSuccess } = useQuery({
Expand Down
Loading

0 comments on commit f5312fc

Please sign in to comment.