From ce1e853f686c1888edeaf3140b1ef4caf75875f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B5=D0=BD=D0=B8=D1=81=20=D0=9A=D0=B0=D1=82=D0=B0?= =?UTF-8?q?=D0=B5=D0=B2?= Date: Sun, 4 Feb 2024 01:09:49 +0000 Subject: [PATCH] feat: some edits --- src/components/Answer/index.tsx | 4 +- src/components/Answer/styles.module.css | 4 ++ src/components/EmailEnterPage/index.tsx | 2 +- .../EmailEnterPage/styles.module.css | 2 +- src/components/PlacePicker/index.tsx | 10 ++- src/components/PlacePicker/styles.module.css | 4 ++ .../CustomAnswers/BirthPlace/index.tsx | 61 ++++++++++++------- .../BirthPlace/styles.module.css | 44 +++++++++++++ .../CustomAnswers/MultipleAnswers/index.tsx | 13 ++++ src/components/pages/TrialChoice/index.tsx | 2 +- .../components/YourReading/index.tsx | 2 +- src/data/reviews.ts | 6 +- 12 files changed, 124 insertions(+), 30 deletions(-) mode change 100644 => 100755 src/components/PlacePicker/index.tsx mode change 100644 => 100755 src/components/pages/Questionnaire/CustomAnswers/BirthPlace/index.tsx mode change 100644 => 100755 src/components/pages/Questionnaire/CustomAnswers/BirthPlace/styles.module.css diff --git a/src/components/Answer/index.tsx b/src/components/Answer/index.tsx index 32efe87..9460ef9 100755 --- a/src/components/Answer/index.tsx +++ b/src/components/Answer/index.tsx @@ -6,6 +6,7 @@ interface IAnswerProps { answer: IAnswer; type?: "multiply" | "single" | "only-text-single"; active?: boolean; + disabled?: boolean; onClick: () => void; } @@ -14,13 +15,14 @@ function Answer({ type = "single", active, classNameContainer = "", + disabled = false, onClick, }: IAnswerProps) { return (
{type !== "only-text-single" && ( diff --git a/src/components/Answer/styles.module.css b/src/components/Answer/styles.module.css index 6243f62..8e53dc1 100755 --- a/src/components/Answer/styles.module.css +++ b/src/components/Answer/styles.module.css @@ -19,6 +19,10 @@ background: rgb(234, 238, 247); } +.container.disabled { + opacity: 0.5; +} + .container.active { background: linear-gradient( 165.54deg, diff --git a/src/components/EmailEnterPage/index.tsx b/src/components/EmailEnterPage/index.tsx index 7e40fdb..ff5669b 100755 --- a/src/components/EmailEnterPage/index.tsx +++ b/src/components/EmailEnterPage/index.tsx @@ -152,7 +152,7 @@ function EmailEnterPage(): JSX.Element { return (
- Enter your email to see how you can find your perfect partner + Enter your email

{t("we_dont_share")}

void; } -function PlacePicker({ name, value, maxLength, onChange }: IPlacePickerProps) { +function PlacePicker({ + name, + value, + maxLength, + isDisabled = false, + onChange, +}: IPlacePickerProps) { const handleChange = (e: React.ChangeEvent) => { const place = e.target.value; onChange(place); @@ -20,6 +27,7 @@ function PlacePicker({ name, value, maxLength, onChange }: IPlacePickerProps) { name={name} type="text" placeholder="Enter city of birth" + disabled={isDisabled} maxLength={maxLength} value={value} onChange={handleChange} diff --git a/src/components/PlacePicker/styles.module.css b/src/components/PlacePicker/styles.module.css index 132d183..09d24c5 100755 --- a/src/components/PlacePicker/styles.module.css +++ b/src/components/PlacePicker/styles.module.css @@ -12,3 +12,7 @@ line-height: 24px; font-size: 16px; } + +.full-address:disabled { + opacity: 0.5; +} diff --git a/src/components/pages/Questionnaire/CustomAnswers/BirthPlace/index.tsx b/src/components/pages/Questionnaire/CustomAnswers/BirthPlace/index.tsx old mode 100644 new mode 100755 index 4c4218c..b5f84b1 --- a/src/components/pages/Questionnaire/CustomAnswers/BirthPlace/index.tsx +++ b/src/components/pages/Questionnaire/CustomAnswers/BirthPlace/index.tsx @@ -6,6 +6,7 @@ import { useTranslation } from "react-i18next"; import { useNavigate } from "react-router-dom"; import routes from "@/routes"; import PlacePicker from "@/components/PlacePicker"; +import { useState } from "react"; interface IBirthPlaceCustomAnswerProps { affiliation?: "self" | "partner"; @@ -23,39 +24,57 @@ function BirthPlaceCustomAnswer({ ? questionnaire.birthPlace : questionnaire.partnerBirthPlace; + const [isKnownPartnerBirthPlace, setIsKnownPartnerBirthPlace] = + useState(true); + const handleChange = (birthPlace: string) => { if (affiliation === "partner") { - dispatch(actions.questionnaire.update({ partnerBirthPlace: birthPlace })); - } - if (affiliation === "self") { - dispatch(actions.questionnaire.update({ birthPlace })); + return dispatch( + actions.questionnaire.update({ partnerBirthPlace: birthPlace }) + ); } + // affiliation === "self" + return dispatch(actions.questionnaire.update({ birthPlace })); }; const handleNext = () => { - if (affiliation === "self") { - navigate(routes.client.loadingInRelationship()); - } if (affiliation === "partner") { - navigate(routes.client.relationshipAlmostThere()); + return navigate(routes.client.relationshipAlmostThere()); } + // affiliation === "self" + return navigate(routes.client.loadingInRelationship()); }; return ( -
- - - {!!birthPlace.length && ( - - {t("next")} - + <> + {affiliation === "partner" && ( + )} -
+
+ + + {(!!birthPlace.length || !isKnownPartnerBirthPlace) && ( + + {t("next")} + + )} +
+ ); } diff --git a/src/components/pages/Questionnaire/CustomAnswers/BirthPlace/styles.module.css b/src/components/pages/Questionnaire/CustomAnswers/BirthPlace/styles.module.css old mode 100644 new mode 100755 index 17ce781..63aacac --- a/src/components/pages/Questionnaire/CustomAnswers/BirthPlace/styles.module.css +++ b/src/components/pages/Questionnaire/CustomAnswers/BirthPlace/styles.module.css @@ -18,3 +18,47 @@ border-radius: 12px; margin-top: 26px; } + +.checkbox-container { + display: flex; + flex-direction: row; + align-items: center; + gap: 10px; + color: #000; +} + +.checkbox-container input[type="checkbox"] { + -webkit-appearance: none; + appearance: none; + background-color: #fff; + margin: 0; + font: inherit; + color: currentColor; + width: 1.15em; + height: 1.15em; + border: 0.15em solid currentColor; + border-radius: 0.15em; + transform: translateY(-0.075em); + + display: grid; + place-content: center; +} + +.checkbox-container input[type="checkbox"]::before { + content: ""; + width: 0.65em; + height: 0.65em; + border-radius: 2px; + transform: scale(0); + transition: 120ms transform ease-in-out; + box-shadow: inset 1em 1em #6939a2; +} + +.checkbox-container input[type="checkbox"]:checked::before { + transform: scale(1); +} + +.checkbox-container input[type="checkbox"]:focus { + outline: max(2px, 0.15em) solid currentColor; + outline-offset: max(2px, 0.15em); +} diff --git a/src/components/pages/Questionnaire/CustomAnswers/MultipleAnswers/index.tsx b/src/components/pages/Questionnaire/CustomAnswers/MultipleAnswers/index.tsx index e30f3c8..7f3f819 100755 --- a/src/components/pages/Questionnaire/CustomAnswers/MultipleAnswers/index.tsx +++ b/src/components/pages/Questionnaire/CustomAnswers/MultipleAnswers/index.tsx @@ -28,6 +28,15 @@ function MultiplyAnswers({ answers }: IMultiplyAnswersProps) { prevState.filter((item) => item !== answer.id) ); } + if (answer.id === "none_of_these") { + return setSelectedAnswers([answer.id]); + } + if ( + selectedAnswers.includes("none_of_these") && + answer.id !== "none_of_these" + ) { + return; + } return setSelectedAnswers((prevState) => [...prevState, answer.id]); }; @@ -46,6 +55,10 @@ function MultiplyAnswers({ answers }: IMultiplyAnswersProps) { handleClick(answer)} diff --git a/src/components/pages/TrialChoice/index.tsx b/src/components/pages/TrialChoice/index.tsx index 014e683..440739f 100755 --- a/src/components/pages/TrialChoice/index.tsx +++ b/src/components/pages/TrialChoice/index.tsx @@ -105,7 +105,7 @@ function TrialChoicePage() { See my plan

- *Cost of trial as of February 2023 + *Cost of trial as of February 2024

); diff --git a/src/components/pages/TrialPayment/components/YourReading/index.tsx b/src/components/pages/TrialPayment/components/YourReading/index.tsx index 7575076..7e6a8bc 100755 --- a/src/components/pages/TrialPayment/components/YourReading/index.tsx +++ b/src/components/pages/TrialPayment/components/YourReading/index.tsx @@ -47,7 +47,7 @@ function YourReading({ gender, zodiacSign, buttonClick }: IYourReadingProps) {

  • -

    Your horoscope and upcoming events for 2023

    +

    Your horoscope and upcoming events for 2024

  • diff --git a/src/data/reviews.ts b/src/data/reviews.ts index 33689a3..a661646 100755 --- a/src/data/reviews.ts +++ b/src/data/reviews.ts @@ -8,19 +8,19 @@ interface IReview { export const reviews: IReview[] = [ { username: "ria._.panwar", - date: "02/17/2023", + date: "02/17/2024", text: "It was really helpful and had provided me the clarity that I needed for my current relationship situation. It gives me hope that my relationship could still be save. Thank you. Highly recommended!", mark: 5, }, { username: "jp63_", - date: "02/17/2023", + date: "02/17/2024", text: "Amazing, absolutely amazing! The affirmations I received and nurturing advice, was worth everything ! Truly, thank you !!", mark: 5, }, { username: "therealslimmazi", - date: "02/17/2023", + date: "02/17/2024", text: "It helps me be able to trust my self and my choices for the future by giving me reassurance with the information i get. My goals and dreams are going to happen and and now i trust myself to do as a need and wish", mark: 4.6, },