Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE][86dqm7ndu] Add experience with cannabis #40

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 0 additions & 120 deletions apps/eo_web/dist/assets/main-03507f56.js

This file was deleted.

120 changes: 120 additions & 0 deletions apps/eo_web/dist/assets/main-89f32e6d.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/eo_web/dist/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"css": [
"assets/main-20667dcd.css"
],
"file": "assets/main-03507f56.js",
"file": "assets/main-89f32e6d.js",
"isEntry": true,
"src": "src/main.tsx"
}
Expand Down
4 changes: 4 additions & 0 deletions apps/eo_web/src/screens/AccountCreation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export const AccountCreation = () => {
setIntroQuestionSubmissionId,
channel,
setState,
setExperience,
} = useProfilingStore((state) => state);
// const navigate = useNavigate();
const { eligibleEmail } = useApi();
Expand Down Expand Up @@ -108,6 +109,8 @@ export const AccountCreation = () => {
useMount(() => {
const submissionId = useParams.get("submission_id");
const state = useParams.get("state");
const experience = useParams.get("experience") ?? "";

if (!submissionId) {
toast.error(
<p>
Expand All @@ -118,6 +121,7 @@ export const AccountCreation = () => {
} else {
setState(state);
setIntroQuestionSubmissionId(submissionId);
setExperience(experience);
}
});

Expand Down
6 changes: 3 additions & 3 deletions apps/eo_web/src/screens/Cancer/Profiling.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import { useProfilingStore } from "~/stores/useProfilingStore";


export const Profiling = () => {
const { type, symptoms, state, usePayment, origin } = useProfilingStore(
(state) => state,
);
const { type, symptoms, state, usePayment, origin, experience } =
useProfilingStore((state) => state);

const searchParam = new URLSearchParams({
states: state ?? "",
symptoms: symptoms.join(","),
payment: usePayment ? "yes" : "no",
origin,
experience,
});

const navigate = useNavigate();
Expand Down
6 changes: 3 additions & 3 deletions apps/eo_web/src/screens/Senior/Profiling.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import { useProfilingStore } from "~/stores/useProfilingStore";


export const Profiling = () => {
const { type, symptoms, state, usePayment, origin } = useProfilingStore(
(state) => state,
);
const { type, symptoms, state, usePayment, origin, experience } =
useProfilingStore((state) => state);
const searchParam = new URLSearchParams({
states: state ?? "",
symptoms: symptoms.join(","),
payment: usePayment ? "yes" : "no",
origin,
experience,
});
const navigate = useNavigate();

Expand Down
2 changes: 1 addition & 1 deletion apps/eo_web/src/screens/UserRolSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const UserRolSelector = () => {
const redirectForm = (type: Type) => {
const channel = searchParams.get("channel") as Channel;
const symptoms = searchParams.get("symptoms") ?? "";
const origin = searchParams.get("origin") ?? "http://localhost:5173";
const origin = searchParams.get("origin") ?? "localhost:5173";

setOrigin(origin);
setSymptoms(symptoms.split(","));
Expand Down
6 changes: 6 additions & 0 deletions apps/eo_web/src/stores/useProfilingStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export interface ProfilingStore {
introQuestionSubmissionId?: string | null;
usePayment: boolean;
origin: string;
experience: string;
account: Account;
setAccountData: (account: Account) => void;
setChannel: (channel: Channel) => void;
Expand All @@ -37,6 +38,7 @@ export interface ProfilingStore {
setUsePayment: (usePayment: boolean) => void;
resetProfilingStore: () => void;
setOrigin: (origin: string) => void;
setExperience: (experience: string) => void;
}

const defaultState = {
Expand All @@ -46,6 +48,7 @@ const defaultState = {
symptoms: [],
state: null,
origin: "",
experience: "",
account: {
email: "",
password: "",
Expand Down Expand Up @@ -88,6 +91,9 @@ export const useProfilingStore = create<ProfilingStore>()(
setOrigin: (origin: string) => {
set({ origin });
},
setExperience: (experience: string) => {
set({ experience });
},
...defaultState,
}),
{
Expand Down