fix(web): offer anonymous screening and doctor contact without identity
CI / ruff · pytest (pull_request) Successful in 2m30s
CI / ruff · pytest (pull_request) Successful in 2m30s
Refs #95, #96
This commit is contained in:
@@ -7,7 +7,6 @@ import { useCatalog } from "../content/reference";
|
||||
import { ru } from "../content/ru";
|
||||
import { useDialog } from "../dialog/DialogContext";
|
||||
import { classify } from "../dialog/step";
|
||||
import { useSession } from "../session/SessionContext";
|
||||
import { WeekDots } from "./Meds";
|
||||
import { humanDate, useToday } from "./useToday";
|
||||
|
||||
@@ -84,7 +83,6 @@ function WeekCard({ rx, onOpen }: { rx: TodayPrescription; onOpen: () => void })
|
||||
export function Today() {
|
||||
const t = ru.today;
|
||||
const navigate = useNavigate();
|
||||
const { session } = useSession();
|
||||
const dialog = useDialog();
|
||||
const { plan, failed } = useToday();
|
||||
const catalog = useCatalog();
|
||||
@@ -119,7 +117,7 @@ export function Today() {
|
||||
!diaryDue &&
|
||||
q?.intake !== "review";
|
||||
const nextDose = plan?.prescriptions.flatMap((p) => p.times).sort()[0];
|
||||
const noDoctor = session?.mode === "anonymous" || (plan !== null && !plan.has_doctor);
|
||||
const noDoctor = plan !== null && !plan.has_doctor;
|
||||
|
||||
const now = plan?.now ?? "00:00";
|
||||
const openDose = (d: TodayDose) => navigate(`/dose/${d.id}`);
|
||||
@@ -292,7 +290,12 @@ export function Today() {
|
||||
{plan?.prescriptions[0] && <WeekCard rx={plan.prescriptions[0]} onOpen={() => navigate("/meds")} />}
|
||||
|
||||
{noDoctor ? (
|
||||
<Notice>{t.noDoctor}</Notice>
|
||||
<div className="stack stack--sm">
|
||||
<Notice>{t.noDoctor}</Notice>
|
||||
<button type="button" className="btn btn--primary" onClick={() => navigate("/doctor")}>
|
||||
{ru.doctor.connect}
|
||||
</button>
|
||||
</div>
|
||||
) : (
|
||||
<div className="quick">
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user